recover database backup recovery of the oracle four statements difference
HTTPS: // www.cnblogs.com/andy6/p/5925433.html need to learn about.
1 recover database using backup controlfile
This paper describes the following four
restore
meaning the difference between the way:
1. recover database using backup controlfile
If the current control file is lost, cold backup when the control file recovery, used to tell the Oracle , in the scn Do not controlfile as the end of recovery;
2. recover database until cancel
If you lose your current / active redo when manually specify the endpoint.
3. recover database using backup controlfile until cancel;
If you lose your current controlfile and current / active redo all is lost, it will go automatically apply archived logs, you can achieve maximum recovery;
4. recover database until cancel using backup controlfile;
If you lose your current controlfile and current / active redo all lost to redo the old scn to restore the finish. Because there is no application archive log, all data will be lost.
To understand using backup controlfile recover database, first understanding recover database, that is, without using backup controlfile the case.
In ordinary recover database or recover tablespace, when recover datafile, Oracle will record the current SCN controlfile subject, use the redo log and archive log redo entry, restore the datafile block related to "current controlfile record of the SCN "
And in some cases, Oracle need to restore data to the controlfile than the current record SCN also depends on the position (for example, control file is a backup controlfile, or trace create the controlfile is based.) This time, we need by using backup controlfile. recovery will not be affected by the "current controlfile recorded SCN" restrictions. This time limit will come from your statement (until time, until scn), or available archive log (until cancel) ...
The results are as follows: Conclusion:
The results can be drawn, if the old database backup, archive log and online log to save all intact under the circumstances, the use recover database or recover database using backup controlfile. No loss of data
just do not fully recover until cancel
Online log files are missing: If normal database, then an error at startup: SQL> alter database open;
数据库已更改。 |
https://www.cnblogs.com/andy6/p/5925433.html 需要学习一下.
1 recover database using backup controlfile
本文主要介绍以下四种
恢复方式的含义与区别:
1. recover database using backup controlfile
如果丢失当前控制文件,用冷 备份的控制文件恢复的时候,用来告诉 oracle,不要以controlfile中的scn作为恢复的终点;
2. recover database until cancel
如果丢失current/active redo的时候,手动指定终点。
3. recover database using backup controlfile until cancel;
如果丢失当前controlfile并且current/active redo都丢失,会先去自动应用归档日志,可以实现最大的恢复;
4. recover database until cancel using backup controlfile;
如果丢失当前controlfile并且current/active redo都丢失,以旧的redo中的scn为恢复终点。因为没有应用归档日志,所有会丢失数据。
要理解recover database using backup controlfile,先理解 recover database,也就是说,不加using backup controlfile的情况。
在普通的recover database 或者 recover tablespace, recover datafile时, Oracle会以当前controlfile所纪录的SCN为准,利用archive log和 redo log的redo entry, 把相关的datafile 的 block恢复到“当前controlfile所纪录的SCN”
而某些情况下,Oracle需要把数据恢复到比当前controlfile所纪录的SCN还要靠后的位置(比如说,control file是backup controlfile , 或者 controlfile是根据trace create的。),这时候,就需要用using backup controlfile. 恢复就不会受“当前controlfile所记录的SCN”的限制。这时候的限制就来自于你的语句(until time , until scn),或者可用的archive log(until cancel) ...
结果如下: 结论:
可以得出结果,如果有旧的数据库备份,在归档日志和在线日志全部保存完好的情况下,使用recover database或recover database using backup controlfile。则不丢失数据
until cancel就是不完全恢复
在线日志文件丢失: 如果正常关闭数据库,然后启动时报错: SQL> alter database open;
数据库已更改。 |