1,记录误删除备库数据文件的current_scn及resetlogs_change#
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
576545
2,模拟删除备库的数据文件
mv line1.dbf line1.dbf.bak
3,关备库,起备库
4,恢复备库
RMAN> restore database;
Starting restore at 29-JAN-10
using channel ORA_DISK_1
skipping datafile 1; already restored to file /oracle/oradata/centos/centos/system01.dbf
skipping datafile 2; already restored to file /oracle/oradata/centos/centos/undotbs01.dbf
skipping datafile 3; already restored to file /oracle/oradata/centos/centos/sysaux01.dbf
skipping datafile 4; already restored to file /oracle/oradata/centos/centos/users01.dbf
skipping datafile 5; already restored to file /oracle/oradata/centos/centos/egg01.dbf
skipping datafile 6; already restored to file /oracle/oradata/centos/centos/what1.dbf
skipping datafile 7; already restored to file /oracle/oradata/centos/centos/five1.dbf
skipping datafile 8; already restored to file /oracle/oradata/centos/centos/unix1.dbf
skipping datafile 9; already restored to file /oracle/oradata/centos/centos/another1.dbf
skipping datafile 11; already restored to file /oracle/oradata/centos/centos/big01.dbf
skipping datafile 12; already restored to file /oracle/oradata/centos/centos/big02.dbf
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00010 to /oracle/oradata/centos/centos/line1.dbf
channel ORA_DISK_1: reading from backup piece /oracle/product/10.2.0/db_1/dbs/07l4m2a8_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/product/10.2.0/db_1/dbs/07l4m2a8_1_1 tag=TAG20100129T121047
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 29-JAN-10
RMAN> recover database until scn 576546;
Starting recover at 29-JAN-10
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/29/2010 12:23:56
RMAN-06054: media recovery requesting unknown log: thread 1 seq 2 lowscn 576546;--此错误不用理会
5,打开备库
alter database open;--resetlogs
SQL> select current_scn from v$database;
CURRENT_SCN
-----------
576545
2,模拟删除备库的数据文件
mv line1.dbf line1.dbf.bak
3,关备库,起备库
4,恢复备库
RMAN> restore database;
Starting restore at 29-JAN-10
using channel ORA_DISK_1
skipping datafile 1; already restored to file /oracle/oradata/centos/centos/system01.dbf
skipping datafile 2; already restored to file /oracle/oradata/centos/centos/undotbs01.dbf
skipping datafile 3; already restored to file /oracle/oradata/centos/centos/sysaux01.dbf
skipping datafile 4; already restored to file /oracle/oradata/centos/centos/users01.dbf
skipping datafile 5; already restored to file /oracle/oradata/centos/centos/egg01.dbf
skipping datafile 6; already restored to file /oracle/oradata/centos/centos/what1.dbf
skipping datafile 7; already restored to file /oracle/oradata/centos/centos/five1.dbf
skipping datafile 8; already restored to file /oracle/oradata/centos/centos/unix1.dbf
skipping datafile 9; already restored to file /oracle/oradata/centos/centos/another1.dbf
skipping datafile 11; already restored to file /oracle/oradata/centos/centos/big01.dbf
skipping datafile 12; already restored to file /oracle/oradata/centos/centos/big02.dbf
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00010 to /oracle/oradata/centos/centos/line1.dbf
channel ORA_DISK_1: reading from backup piece /oracle/product/10.2.0/db_1/dbs/07l4m2a8_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/product/10.2.0/db_1/dbs/07l4m2a8_1_1 tag=TAG20100129T121047
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
Finished restore at 29-JAN-10
RMAN> recover database until scn 576546;
Starting recover at 29-JAN-10
using channel ORA_DISK_1
starting media recovery
unable to find archive log
archive log thread=1 sequence=2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 01/29/2010 12:23:56
RMAN-06054: media recovery requesting unknown log: thread 1 seq 2 lowscn 576546;--此错误不用理会
5,打开备库
alter database open;--resetlogs
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-626466/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9240380/viewspace-626466/