简单的说
recover database until cancel用于不完全恢复,可以一步一步的跳也就是一个一个归档的应用,也可以AUTO全部应用,当然也可以在恢复完某个archivelog后cancel退出,但是他不会恢复 current logfile如果需要恢复current logfile需要自己指定。如下,我的当前日志sequence 是11
recover database 用于完全恢复,全部一起应用,包含current logfile,但是如果没有current logfile当然也会报错
SQL> recover database ;
Media recovery complete.
实际两者没有太多的区别,区别就在于是否手动和应用当前logfile。
recover database until cancel用于不完全恢复,可以一步一步的跳也就是一个一个归档的应用,也可以AUTO全部应用,当然也可以在恢复完某个archivelog后cancel退出,但是他不会恢复 current logfile如果需要恢复current logfile需要自己指定。如下,我的当前日志sequence 是11
Specify log: {=suggested | filename | AUTO | CANCEL}
ORA-00279: change 1253078 generated at 08/29/2016 14:52:55 needed for thread 1
ORA-00289: suggestion : /home/oracle/archivelog/DG/1_10_921163363.dbf
ORA-00280: change 1253078 for thread 1 is in sequence #10
ORA-00278: log file '/home/oracle/archivelog/DG/1_9_921163363.dbf' no longer
needed for this recovery
Specify log: {=suggested | filename | AUTO | CANCEL}
ORA-00279: change 1253084 generated at 08/29/2016 14:52:58 needed for thread 1
ORA-00289: suggestion : /home/oracle/archivelog/DG/1_11_921163363.dbf
ORA-00280: change 1253084 for thread 1 is in sequence #11
ORA-00278: log file '/home/oracle/archivelog/DG/1_10_921163363.dbf' no longer
needed for this recovery
Specify log: {=suggested | filename | AUTO | CANCEL}
ORA-00308: cannot open archived log
'/home/oracle/archivelog/DG/1_11_921163363.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
这里我们指定我们的current logfile的绝对路径即可
ORA-00279: change 1253078 generated at 08/29/2016 14:52:55 needed for thread 1
ORA-00289: suggestion : /home/oracle/archivelog/DG/1_10_921163363.dbf
ORA-00280: change 1253078 for thread 1 is in sequence #10
ORA-00278: log file '/home/oracle/archivelog/DG/1_9_921163363.dbf' no longer
needed for this recovery
Specify log: {=suggested | filename | AUTO | CANCEL}
ORA-00279: change 1253084 generated at 08/29/2016 14:52:58 needed for thread 1
ORA-00289: suggestion : /home/oracle/archivelog/DG/1_11_921163363.dbf
ORA-00280: change 1253084 for thread 1 is in sequence #11
ORA-00278: log file '/home/oracle/archivelog/DG/1_10_921163363.dbf' no longer
needed for this recovery
Specify log: {=suggested | filename | AUTO | CANCEL}
ORA-00308: cannot open archived log
'/home/oracle/archivelog/DG/1_11_921163363.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
这里我们指定我们的current logfile的绝对路径即可
recover database 用于完全恢复,全部一起应用,包含current logfile,但是如果没有current logfile当然也会报错
SQL> recover database ;
Media recovery complete.
实际两者没有太多的区别,区别就在于是否手动和应用当前logfile。