数据库:oracle 11.2.0.4
系统:Centos 7.9
异常描述:rman异机恢复时,报错RMAN-06026、RMAN-06023,如下所示:
RMAN> run{
2> set newname for datafile '+DATA/orcl/datafile/system.256.1107818145' to '/data/orcl/system.256.1107818145';
3> set newname for datafile '+DATA/orcl/datafile/undotbs2.267.1107818231' to '/data/orcl/undotbs2.267.1107818231';
4> set newname for datafile '+DATA/orcl/datafile/system.319.1110101255' to '/data/orcl/system.319.1110101255';
5> set newname for datafile '+DATA/orcl/datafile/sysaux.257.1107818147' to '/data/orcl/sysaux.257.1107818147';
6> set newname for datafile '+DATA/orcl/datafile/undotbs1.258.1107818147' to '/data/orcl/undotbs1.258.1107818147';
7> set newname for datafile '+DATA/orcl/datafile/users.259.1107818147' to '/data/orcl/users.259.1107818147';
8> restore database;
9> }
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 17-JUL-22
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/17/2022 00:44:01
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore显示找不到无备份文件,检查datafile 2和datafile 3的备份文件.
RMAN> list backup of datafile 3;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13 Full 407.97M DISK 00:00:00 15-JUL-22
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20220715T094249
Piece Name:/home/oracle/backupset/data_0212lk4p_1_1.bak
List of Datafiles in backup set 13
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
3 Full 1209511 15-JUL-22 +DATA/orcl/datafile/undotbs1.258.1107818147
RMAN> list backup of datafile 2;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13 Full 407.97M DISK 00:00:00 15-JUL-22
BP Key: 13 Status: AVAILABLE Compressed: NO Tag: TAG20220715T094249
Piece Name:/home/oracle/backupset/data_0212lk4p_1_1.bak
List of Datafiles in backup set 13
File LV Type Ckp SCN Ckp Time Name
---- -- ---- ---------- --------- ----
2 Full 1209511 15-JUL-22 +DATA/orcl/datafile/sysaux.257.1107818147
结论:显示datafile 2和datafile 3的备份都有效.
目标库查看incarnatioin记录:
RMAN> list incarnation;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1635598952 PARENT 1 24-AUG-13
2 2 ORCL 1635598952 PARENT 925702 19-JUN-22
3 3 ORCL 1635598952 CURRENT 1209510 16-JUL-22
源库查看incarnatioin记录:
RMAN> list incarnation;
using target database control file instead of recovery catalog
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN
Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 ORCL 1635598952 PARENT 1 24-AUG-13
2 2 ORCL 1635598952 CURRENT 925702 19-JUN-22
说明:源库显示只有两个reset scn记录,目标库控制文件从源库还原得来,但却显示存在三次记录.
解决方案:
将目标库重置为incarnation 2.
RMAN>reset database to incarnation 2;
database reset to incarnation 2
RMAN>run{
2> set newname for datafile '+DATA/orcl/datafile/system.256.1107818145' to '/data/orcl/system.256.1107818145';
3> set newname for datafile '+DATA/orcl/datafile/undotbs2.267.1107818231' to '/data/orcl/undotbs2.267.1107818231';
4> set newname for datafile '+DATA/orcl/datafile/system.319.1110101255' to '/data/orcl/system.319.1110101255';
5> set newname for datafile '+DATA/orcl/datafile/sysaux.257.1107818147' to '/data/orcl/sysaux.257.1107818147';
6> set newname for datafile '+DATA/orcl/datafile/undotbs1.258.1107818147' to '/data/orcl/undotbs1.258.1107818147';
7> set newname for datafile '+DATA/orcl/datafile/users.259.1107818147' to '/data/orcl/users.259.1107818147';
8> restore database;
9> }
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 17-JUL-22 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 /data/orcl/system.256.1107818145
channel ORA_DISK_1: restoring datafile 00004 to /data/orcl/users.259.1107818147
channel ORA_DISK_1: restoring datafile 00006 to /data/orcl/system.319.1110101255
channel ORA_DISK_1: reading from backup piece /home/oracle/backupset/data_0112lk4p_1_1.bak
channel ORA_DISK_1: piece handle=/home/oracle/backupset/data_0112lk4p_1_1.bak tag=TAG20220715T094249
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
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 00002 to /data/orcl/sysaux.257.1107818147
channel ORA_DISK_1: restoring datafile 00003 to /data/orcl/undotbs1.258.1107818147
channel ORA_DISK_1: restoring datafile 00005 to /data/orcl/undotbs2.267.1107818231
channel ORA_DISK_1: reading from backup piece /home/oracle/backupset/data_0212lk4p_1_1.bak
channel ORA_DISK_1: piece handle=/home/oracle/backupset/data_0212lk4p_1_1.bak tag=TAG20220715T094249
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 17-JUL-22
结论:再次执行恢复,无异常发生.
参考网址:
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




