1.1.1. RMAN-06556
日期:2014-05-21 16:33
環境:測試環境
【情景描述】
使用RMAN進行了全庫備份,但是在進行不完全恢復的時候遇到報錯,提示某個數據文件必須從比給出的SCN更早的備份中恢復。
【報錯信息】
備份數據庫:
RMAN> backup database plus archivelog;
Starting backup at 2014-05-21 15:02:13
current log archived
......
Finished backup at 2014-05-21 15:02:15
Starting backup at 2014-05-21 15:02:15
using channel ORA_DISK_1
file 5 is excluded from whole databasebackup
file 8 is excluded from whole databasebackup
file 9 is excluded from whole databasebackup
channel ORA_DISK_1: starting full datafilebackup set
channel ORA_DISK_1: specifying datafile(s)in backup set
input datafile file number=00001name=/U01/app/oracle/oradata/testdb/system01.dbf
input datafile file number=00002name=/U01/app/oracle/oradata/testdb/sysaux01.dbf
input datafile file number=00003name=/U01/app/oracle/oradata/testdb/undotbs01.dbf
input datafile file number=00007name=/U01/app/oracle/oradata/testdb/hesper_hq_data01.dbf
input datafile file number=00010name=/U01/app/oracle/oradata/testdb/rcat_data01.dbf
input datafile file number=00006name=/U01/app/oracle/oradata/testdb/testdb01_index.dbf
input datafile file number=00004name=/U01/app/oracle/oradata/testdb/users01.dbf
channel ORA_DISK_1: starting piece 1 at2014-05-21 15:02:15
......
channel ORA_DISK_1: backup set complete,elapsed time: 00:00:55
Finished backup at 2014-05-21 15:03:10
Starting backup at 2014-05-21 15:03:10
current log archived
......
Finished backup at 2014-05-21 15:03:12
Starting Control File and SPFILE Autobackupat 2014-05-21 15:03:12
piecehandle=/home/oracle/rman/backup_recovery/testdb_c-2607759728-20140521-01comment=NONE
Finished Control File and SPFILE Autobackupat 2014-05-21 15:03:13
RMAN>
還原恢復:
RMAN> run {
2> allocate channel ch1 type disk;
3> allocate channel ch2 type disk;
4> set until scn 1519297;
5> restore database;
6> recover database;
7> release channel ch1;
8> release channel ch2;
9> }
allocated channel: ch1
channel ch1: SID=63 device type=DISK
allocated channel: ch2
channel ch2: SID=129 device type=DISK
executing command: SET until clause
Starting restore at 2014-05-21 15:11:07
file 5 is excluded from whole databasebackup
file 8 is excluded from whole databasebackup
file 9 is excluded from whole databasebackup
channel ch1: starting datafile backup setrestore
channel ch1: specifying datafile(s) torestore from backup set
channel ch1: restoring datafile 00001 to/U01/app/oracle/oradata/testdb/system01.dbf
channel ch1: restoring datafile 00002 to/U01/app/oracle/oradata/testdb/sysaux01.dbf
channel ch1: restoring datafile 00003 to/U01/app/oracle/oradata/testdb/undotbs01.dbf
channel ch1: restoring datafile 00004 to/U01/app/oracle/oradata/testdb/users01.dbf
channel ch1: restoring datafile 00006 to/U01/app/oracle/oradata/testdb/testdb01_index.dbf
channel ch1: restoring datafile 00007 to/U01/app/oracle/oradata/testdb/hesper_hq_data01.dbf
channel ch1: restoring datafile 00010 to/U01/app/oracle/oradata/testdb/rcat_data01.dbf
channel ch1: reading from backup piece/U01/app/test/rman/fra/TESTDB/backupset/2014_05_21/o1_mf_nnndf_TAG20140521T150215_9qrmvr0y_.bkp
channel ch1: piecehandle=/U01/app/test/rman/fra/TESTDB/backupset/2014_05_21/o1_mf_nnndf_TAG20140521T150215_9qrmvr0y_.bkptag=TAG20140521T150215
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsedtime: 00:00:55
failover to previous backup
Finished restore at 2014-05-21 15:12:02
Starting recover at 2014-05-21 15:12:02
released channel: ch1
released channel: ch2
RMAN-00571:===========================================================
RMAN-00569: =============== ERROR MESSAGESTACK FOLLOWS ===============
RMAN-00571:===========================================================
RMAN-03002: failure of recover command at05/21/2014 15:12:02
RMAN-06556: datafile 5 must be restoredfrom backup older than SCN 1519297
RMAN>
【報錯原因】
仔細觀察備份過程和還原恢復過程的輸出信息,會發現裡面包含3條信息記錄:
file5 is excluded from whole database backup
file8 is excluded from whole database backup
file9 is excluded from whole database backup
意思是說file 5、8、9沒有進行備份,也沒有進行還原恢復。
【解決方法】
修改RMAN備份策略中的排除規則
修改前:
CONFIGURE EXCLUDE FOR TABLESPACE'TESTDB_DATA';
修改後:
RMAN> CONFIGURE EXCLUDE FOR TABLESPACE'TESTDB_DATA' clear;
Tablespace TESTDB_DATA will be included infuture whole database backups
old RMAN configuration parameters aresuccessfully deleted
RMAN>
查看表空間備份策略(INCLUDED_IN_DATABASE_BACKUP):
SQL> select * from v$tablespace order by3;
TS# NAME INC BIG FLAENC
---------- --------------- --- --- --- ---
3 TEMP NO NO YES
1 SYSAUX YES NO YES
2 UNDOTBS1 YES NO YES
4 USERS YES NO YES
9 RCAT_DATA YES NO YES
6 TESTDB_DATA YES NO YES
7 TESTDB_INDEX YES NO YES
8 HESPER_HQ YES NO YES
0 SYSTEM YES NO YES
9 rows selected.