ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 使用RMAN准确指定恢复的序列号、时间或SCN

使用RMAN准确指定恢复的序列号、时间或SCN

原创 Linux操作系统 作者:尛样儿 时间:2012-06-26 14:07:49 0 删除 编辑

RMAN> run{
2> set until sequence 107 thread 2;
3> restore database ;
4> recover database;}

executing command: SET until clause

Starting restore at 2012-06-20 22:27:12
using channel ORA_DISK_1

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 06/20/2012 22:27:13
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 6 found to restore

        RMAN针对序列的恢复,是恢复到n-1的序列日志。所以上面的操作只会恢复到thread 2 106号的序列。如果恢复的序列号不存在,那么可能出现以上的错误。执行以下的命令将数据库不完全恢复到thread 2 107:

RMAN> run{
2> set until sequence 108 thread 2;
3> restore database;
4> recover database;}

executing command: SET until clause

Starting restore at 2012-06-20 22:27:45
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DBFILE1/ractest/datafile/system.256.754173057
channel ORA_DISK_1: restoring datafile 00002 to +DBFILE1/ractest/datafile/sysaux.257.754173057
channel ORA_DISK_1: restoring datafile 00003 to +DBFILE1/ractest/datafile/undotbs1.258.754173059
channel ORA_DISK_1: restoring datafile 00004 to +DBFILE1/ractest/datafile/users.259.754173059
channel ORA_DISK_1: restoring datafile 00005 to +DBFILE1/ractest/datafile/undotbs2.264.754173315
channel ORA_DISK_1: restoring datafile 00006 to +DBFILE1/ractest/datafile/soe.274.686330585
channel ORA_DISK_1: reading from backup piece +FRA1/ractest/backupset/2012_06_20/nnndf0_tag20120620t213939_0.492.786490781
channel ORA_DISK_1: piece handle=+FRA1/ractest/backupset/2012_06_20/nnndf0_tag20120620t213939_0.492.786490781 tag=TAG20120620T213939
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:45
Finished restore at 2012-06-20 22:30:31

Starting recover at 2012-06-20 22:30:31
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 132 is already on disk as file +FRA1/ractest/archivelog/2012_06_20/thread_1_seq_132.493.786490831
archived log for thread 1 with sequence 133 is already on disk as file +FRA1/ractest/archivelog/2012_06_20/thread_1_seq_133.496.786490883
archived log for thread 2 with sequence 107 is already on disk as file +FRA1/ractest/archivelog/2012_06_20/thread_2_seq_107.494.786490865
archived log file name=+FRA1/ractest/archivelog/2012_06_20/thread_1_seq_132.493.786490831 thread=1 sequence=132
archived log file name=+FRA1/ractest/archivelog/2012_06_20/thread_2_seq_107.494.786490865 thread=2 sequence=107
archived log file name=+FRA1/ractest/archivelog/2012_06_20/thread_1_seq_133.496.786490883 thread=1 sequence=133
media recovery complete, elapsed time: 00:00:02
Finished recover at 2012-06-20 22:30:38

         从以上的例子可以看出,错误的指定序列号会导致恢复操作的失败。数据库实例序列号可能是不连续的,同样的道理SCN号也可能是不连续的,指定不准确的序列号、时间或SCN号都可能导致数据库不完全恢复操作的失败。



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23135684/viewspace-733818/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle数据库管理员,Oracle数据库系统构架员;2012年7月出版《构建最高可用Oracle数据库系统:Oracle 11gR2 RAC管理、维护与性能优化》一书;Oracle 10g OCM。

注册时间:2010-01-05

  • 博文量
    483
  • 访问量
    5247902