RMAN还原遇到RMAN-06026,ORA-01180报错

最近在两套不同平台的测试环境中使用rman还原数据都遇到了问题。
linux报如下错误:

  1. RMAN-00571: ===========================================================
  2. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  3. RMAN-00571: ===========================================================
  4. RMAN-03002: failure of restore command at 08/04/2017 13:01:05
  5. RMAN-06026: some targets not found - aborting restore
  6. RMAN-06023: no backup or copy of datafile 13 found to restore
  7. RMAN-06023: no backup or copy of datafile 12 found to restore
  8. RMAN-06023: no backup or copy of datafile 10 found to restore
  9. RMAN-06023: no backup or copy of datafile 9 found to restore
  10. RMAN-06023: no backup or copy of datafile 6 found to restore
  11. RMAN-06023: no backup or copy of datafile 3 found to restore
  12. RMAN-06023: no backup or copy of datafile 1 found to restore
aix报如下错误:

  1. creating datafile fno=1 name=/oracle/oradata/cdb/system01.dbf
  2. RMAN-00571: ===========================================================
  3. RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  4. RMAN-00571: ===========================================================
  5. RMAN-03002: failure of restore command at 08/08/2017 18:47:01
  6. ORA-01180: can not create datafile 1
  7. ORA-01110: data file 1: '/oracle/oradata/cdb/system01.dbf'
==>已经反复确认文件系统空间和目录权限都无误。根据mos (文档 ID 965122.1) 找到了解决方法。

报错原因
要还原的实例之前以open resetlogs方式打开过,导致闪回区存在不同的incarnation的文件。
当我们执行restore database或catalog start with命令时会将闪回区的文件信息写入控制文件。

下面来看示例:
RMAN>  restore controlfile from '/oradata/tmp/controlfile_db_qdsbi3te_1_1.bak';
Starting restore at 10-AUG-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 device type=DISK
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/ora12c/oradata/cdb/control01.ctl
output file name=/ora12c/oradata/cdb/control02.ctl
Finished restore at 10-AUG-17

RMAN> alter database mount;
Statement processed
released channel: ORA_DISK_1

RMAN>  list incarnation;
List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       CDB   2480302092       PARENT  1          07-JUL-14
2       2       CDB   2480302092       CURRENT 1594143    14-APR-17

RMAN> catalog start with '/oradata/tmp/';
Starting implicit crosscheck backup at 10-AUG-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 device type=DISK
Crosschecked 5 objects
Finished implicit crosscheck backup at 10-AUG-17

Starting implicit crosscheck copy at 10-AUG-17
using channel ORA_DISK_1
Finished implicit crosscheck copy at 10-AUG-17

searching for all files in the recovery area
cataloging files...
cataloging done
省略部分。。。。

==》上述中的关键字'searching for all files in the recovery area'

RMAN> list incarnation;
List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       CDB   2480302092       PARENT  1          07-JUL-14
2       2       CDB   2480302092       PARENT  1594143    14-APR-17
3       3       CDB   2480302092       CURRENT 40190123   09-AUG-17

==>catalog start with命令执行后,Inc Key的值由2变成了3.

RMAN> LIST BACKUP RECOVERABLE;
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
695     Full    156.88M    DISK        00:00:32     10-AUG-17      
        BP Key: 701   Status: AVAILABLE  Compressed: YES  Tag: FULL_CDB2_2017-08-10-114649
        Piece Name: /oradata/tmp/full_db_q9sbi3r0_1_1.bak
  List of Datafiles in backup set 695
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  5       Full 33378185   19-JUL-17 +DATA/CDB/FD9AC20F64D244D7E043B6A9E80A2F2F/DATAFILE/system.292.941326749
  7       Full 33378185   19-JUL-17 +DATA/CDB/FD9AC20F64D244D7E043B6A9E80A2F2F/DATAFILE/sysaux.289.941326749
省略部分。。。。
==》这里也没有出显示出还原要使用的备份集。

解决方法:
1、从闪回区中移除不在同一incarnation的文件
2、临时禁用闪回区,重新还原控制文件,catalog备份集,以下给出临时禁用闪回区命令:
SQL> alter system set db_recovery_file_dest='';
3、通过reset database to incarnation 命令重置当前incarnation值(即还原控制文件后list incarnation显示status为current的Inc Key)。

以下针对第三种方法做示例:
RMAN> reset database to incarnation 2;
database reset to incarnation 2

RMAN>  list incarnation;
List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1       1       CDB   2480302092       PARENT  1          07-JUL-14
2       2       CDB   2480302092       CURRENT 1594143    14-APR-17
3       3       CDB   2480302092       ORPHAN  40190123   09-AUG-17

RMAN>  LIST BACKUP RECOVERABLE;
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
693     Full    524.44M    DISK        00:02:08     10-AUG-17      
        BP Key: 703   Status: AVAILABLE  Compressed: YES  Tag: FULL_CDB2_2017-08-10-114649
        Piece Name: /oradata/tmp/full_db_q7sbi3lb_1_1.bak
  List of Datafiles in backup set 693
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 41396279   10-AUG-17 +DATA/CDB/system01.dbf
  3       Full 41396279   10-AUG-17 +DATA/CDB/sysaux01.dbf
  6       Full 41396279   10-AUG-17 +DATA/CDB/users01.dbf
  8       Full 41396279   10-AUG-17 +DATA/CDB/undotbs02.dbf
  9       Full 41396279   10-AUG-17 +DATA/CDB/undotbs03.dbf
省略部分。。。。
==》到这里就能看到还原所用到的备份集信息了。

end!





来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25923810/viewspace-2143366/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25923810/viewspace-2143366/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值