oracle rman simple backup

◇◆丶佛笑我妖孽 提交于 2019-12-13 20:39:45

问题


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).

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

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

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.

Thanks

Hubidubi


回答1:


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.



来源:https://stackoverflow.com/questions/3149348/oracle-rman-simple-backup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!