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


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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23135684/viewspace-733818/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值