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

一 问题描述

在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 恢复控制文件

最近更新

  1. TCP协议是安全的吗?

    2024-04-27 19:16:02       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-27 19:16:02       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-27 19:16:02       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-27 19:16:02       18 阅读

热门阅读

  1. ubuntu Qt打包

    2024-04-27 19:16:02       9 阅读
  2. 前端工程化详解

    2024-04-27 19:16:02       11 阅读
  3. js获取日期年初及年末

    2024-04-27 19:16:02       11 阅读
  4. 银行家算法

    2024-04-27 19:16:02       9 阅读
  5. ZC3201 耐压40V输出12V 300mA LDO

    2024-04-27 19:16:02       11 阅读
  6. docker简介

    2024-04-27 19:16:02       9 阅读
  7. 解密数据治理:构建安全堡垒,守护信息王国

    2024-04-27 19:16:02       10 阅读
  8. Optimistic乐观挑战游戏Sharelock审计大赛

    2024-04-27 19:16:02       11 阅读