欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

【oracle案例】RMAN-06556

程序员文章站 2023-08-25 14:49:40
1.1.1. rman-06556 日期:2014-05-21 16:33 环境:测试环境 【情景描述】 使用rman进行了全库备份,但是在进行不完全恢复的时候遇到报错,提...

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.