oracle rman restore database的时候报错RMAN-06023: 没有找到数据文件1的副本来还原

本文讲述了在Oracle异地备份恢复过程中遇到RMAN-06023错误的解决方案,包括清理db_recovery_file_dest、重置数据库incarnation、恢复控制文件和数据文件,以及管理备份和删除过期备份以成功恢复数据库。
摘要由CSDN通过智能技术生成

一 问题描述

在oracle异地备份恢复测试数据库上执行restore database的时候报错:

RMAN-06023: 没有找到数据文件1的副本来还原

可是我看备份明明都是存在的,而且已经执行了catalog start with命令。

有点奇怪的是catalog start with的时候,数据库自动去db_recovery_file_dest路径下加载文件了:

二 解决办法

2.1 在异地备份恢复环境清空db_recovery_file_dest目录

cd /data/app/oracle/fast_recovery_area

rm -rf ORCL

2.2 reset database to incarnation N

list incarnation;

示例:

reset database to incarnation N

N为上一个incarnation,这里是7。

2.3 重新恢复

#重新恢复控制文件,数据文件等

SQL> shutdown immediate;

SQL> startup nomount;

#查询源端dbid

SQL> select dbid from v$database;

#在目标端恢复控制文件

#指定dbid为上面查询到的源端dbid

RMAN> set dbid 1567664827;     

#恢复控制文件

RMAN>restore controlfile from '/backup/202404240100/orcl_ctl0_20240424_ORCL_15972_1';

RMAN> alter database mount;

再次catalog start with备份目录,不再去加载那些db_recovery_file_dest下的文件了:

#删除expired备份

crosscheck backup;

delete expired backup;

#恢复数据库

run {

allocate channel t1 type disk;
allocate channel t2 type disk;
allocate channel t3 type disk;
allocate channel t4 type disk;
allocate channel t5 type disk;
allocate channel t6 type disk;
allocate channel t7 type disk;
allocate channel t8 type disk;

allocate channel t9 type disk;
allocate channel t10 type disk;

set newname for database to '/data/app/oracle/oradata/orcl/%U';

restore database;

switch datafile all;

switch tempfile all;

}

没再报错了。

--本篇文章转自RMAN-06026: 有些目标没有找到 - 终止还原 RMAN-06023: 没有找到数据文件4的副本来还原_51CTO博客_rman-06172 恢复控制文件

  • 19
    点赞
  • 16
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值