oracle rman简单备份 [英] oracle rman simple backup

查看:77
本文介绍了oracle rman简单备份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想尽可能简单地备份Oracle 10G. 它处于NOARCHIVELOG模式,我可以关闭进行备份(它只是一个开发服务器).

I would like to backup an Oracle 10G as simple as possible. It is in NOARCHIVELOG mode and I can shut down for backup (it is only a development server).

在阅读了大量有关rman的文档之后,我在rman中尝试了这种方式:

After reading tons of documentation abour rman I tried this way in rman:

shutdown immediate;
startup mount
backup database;
sql 'alter database open';

我认为它工作正常,list backup显示备份.

As I see it works fine, list backup shows backups.

比我进行了一些修改(删除一些表,添加数据),然后尝试还原备份:

Than I made some modifications (droping some tables, adding data) and I tried to restore backup:

shutdown immediate;
startup mount
restore database;
recover database;
sql 'alter database open';

它似乎也可以正常工作,但是我无法恢复数据库的先前状态.我不明白为什么.我也不明白为什么需要使用恢复.

It also seems to work fine but I can't get back the previous state of the database. I don't understand why. I also don't understand why need to use recover.

谢谢

Hubidubi

推荐答案

还原数据库;"该命令将从备份媒体中读取备份,以便您的数据库文件与上次备份时的文件完全相同.它不会还原控制文件.

恢复数据库";该命令将应用增量备份(不适用-您的示例仅具有完整备份)并应用存档日志(同样不适用,您处于"NOARCHIVELOG"模式.)它也可能写入控制文件-如果这样做,则您可以看到为什么需要它.

在问题中发出的restore/recover/open命令之后,数据库与备份时一样.备份之后提交的所有事务都将丢失,并且无法恢复,因为您处于"NOARCHIVELOG"模式.您需要处于"ARCHIVELOG"模式才能完成完整的时间点"恢复.

BYW,您删除,重命名或移动了哪些文件以真正模拟真正的介质故障(如果有的话)?我敢打赌,您没有删除其中一个控制文件.您需要练习这种情况.

The "restore database;" command will read the backup from the backup media media so that your database files are exactly like they were when the last backup was taken. It does not restore control files.

The "recover database;" command will apply incremental backups (not applicable - your example only has a full backup) and apply archive logs (also not applicable, you're in "NOARCHIVELOG" mode.) It may also write to the control files - if it does, you can see why it's required.

After the restore/recover/open commands you issued in your question your database is as it was at the time of the backup. Any transactions committed after the backup are lost and can't be recovered because you're in "NOARCHIVELOG" mode. You need to be in "ARCHIVELOG" mode to do a complete "point in time" recovery.

byw, what files, if any did you delete, rename or move to really simulate a true media failure? I'll bet you didn't delete one of your control files. You need to practice that scenario.

这篇关于oracle rman简单备份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆