RMAN-20201: datafile not found in the recovery catalog报错分析

背景描述:
某客户某数据库需要迁移,需要搭建从rac-rac的dg,进行数据库切换/强制打开
由于该数据库数据量达到30T,但nfs挂载盘仅有1T,所以需要分多次进行copy
在主库将数据文件从asm拷贝至nfs磁盘中,然后再将数据文件从nfs磁盘拷贝至目标库asm磁盘中
但是在将数据文件从nfs磁盘拷贝至目标库asm磁盘中却发生了报错:
RMAN-20201: datafile not found in the recovery catalog
RMAN-06010: error while looking up datafile: /tmp/aaa.dbf

测试环境模拟该问题产生:
create tablespace aa datafile ‘/tmp/tmp/aaa.dbf’ size 10M autoextend on;

Rman copy数据文件从/tmp/tmp/至/tmp/目录中
RMAN> copy datafile ‘/tmp/tmp/aaa.dbf’ to ‘/tmp/aaa.dbf’;

Starting backup at 24-APR-20
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=307 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00005 name=/tmp/tmp/aaa.dbf
output filename=/tmp/aaa.dbf tag=TAG20200424T140413 recid=3 stamp=1038578653
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 24-APR-20

再次拷贝,尝试将数据文件由/tmp/拷贝至/app/oracle/oradata/orcl/目录,果然报错了:
RMAN> copy datafile ‘/tmp/aaa.dbf’ to ‘/app/oracle/oradata/orcl/aaa.dbf’;

Starting backup at 24-APR-20
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 04/24/2020 14:04:40
RMAN-20201: datafile not found in the recovery catalog
RMAN-06010: error while looking up datafile: /tmp/aaa.dbf

这是什么原因呢?这是由于控制文件中记录的数据文件信息为/tmp/tmp/aaa.dbf,所以数据库只对/tmp/tmp/aaa.dbf文件
有读写控制权限,无法将/tmp/aaa.dbf拷贝至别的目录

验证如下:
对aaa.dbf数据文件进行rename,使得控制文件中记录的位置为/tmp/aaa.dbf
SQL> select file_id,file_name from dba_data_files;

FILE_ID FILE_NAME


     4 /app/oracle/oradata/orcl/users01.dbf
     3 /app/oracle/oradata/orcl/sysaux01.dbf
     2 /app/oracle/oradata/orcl/undotbs01.dbf
     1 /app/oracle/oradata/orcl/system01.dbf
     5 /tmp/tmp/aaa.dbf

SQL> alter database datafile 5 offline;
Database altered.

SQL> alter database rename file ‘/tmp/tmp/aaa.dbf’ to ‘/tmp/aaa.dbf’;
Database altered.

再次拷贝/tmp/aaa.dbf至/app/oracle/oradata/orcl/目录,正常
RMAN> copy datafile ‘/tmp/aaa.dbf’ to ‘/app/oracle/oradata/orcl/aaa.dbf’;

Starting backup at 24-APR-20
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile fno=00005 name=/tmp/aaa.dbf
output filename=/app/oracle/oradata/orcl/aaa.dbf tag=TAG20200424T140618 recid=4 stamp=1038578779
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 24-APR-20

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值