暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

NBU恢复数据库出现ORA-45900告警

Leo 2025-03-04
49

问题描述:NBU恢复数据库出现ORA-45900告警,如下所示:
数据库:oracle 12.2.0.1(多租户架构)
系统:rhel 7.6 64位
1、问题重现
以下为恢复数据文件时出现的告警.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of switch command on default channel at 02/26/2025 21:26:08
ORA-45900: data file number 1 already included as +DATA/MODG/DATAFILE/system.899.1072648261

如继续恢复归档文件,会出现如下告警.
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 02/27/2025 11:12:06
RMAN-06094: datafile 1 must be restored

2、异常原因
Recovery Manager(RMAN is attempting to use the specified data file number, but this data fle number is alreadyin use by a diferent container database.

说明:此为多租户架构,在恢复数据文件的时候pfile文件未添加 enable_pluggable_database=TRUE 导致.
原始pfile文件如下:
[oracle@hisdb2 ~]$ cat meddoc.ora
*.db_name=meddoc
*.compatible=12.2.0
*.audit_file_dest=/home/oracle/app/oracle/adump
*.db_recovery_file_dest='+DATA'
*.db_create_file_dest='+DATA'
*.control_files=+DATA/meddoc/CONTROLFILE/current.257.1188223359
*.db_block_size=8192
*.sga_target=40960M
*.pga_aggregate_target=20480M
*.db_recovery_file_dest_size=100G
*.job_queue_processes=0
*.diagnostic_dest=/home/oracle/app/oracle/diag
*.db_files=8000

3、解决方案
在将enable_pluggable_database=TRUE添加进参数文件后重新恢复数据库,异常不在发生.

4、相关资料
-- 恢复数据文件脚本
$ cat rman_recovery.sh
#!/bin/sh
source /home/oracle/.bash_profile
$ORACLE_HOME/bin/rman log /home/oracle/rman_arch`date +%Y%m%d_%H%M%S`.log <<EOF
connect target /;
run{
allocate channel ch00 type 'sbt_tape';
allocate channel ch01 type 'sbt_tape';
allocate channel ch02 type 'sbt_tape';
allocate channel ch03 type 'sbt_tape';
allocate channel ch04 type 'sbt_tape';
allocate channel ch05 type 'sbt_tape';
allocate channel ch06 type 'sbt_tape';
allocate channel ch07 type 'sbt_tape';
SEND 'NB_ORA_SERV=hisdb1.cqcmcc.com , NB_ORA_CLIENT=cq2bk';
set newname for database to '+DATA';
restore database;
switch datafile all;
release channel ch00;
release channel ch01;
release channel ch02;
release channel ch03;
release channel ch04;
release channel ch05;
release channel ch06;
release channel ch07;
}
exit
EOF

-- 恢复归档文件脚本
$ vi rman_recovery_arch.sh
#!/bin/bash
source /home/oracle/.bash_profile
$ORACLE_HOME/bin/rman log /home/oracle/rman_arch`date +%Y%m%d_%H%M%S`.log <<EOF
connect target /;
run{
allocate channel ch00 type 'sbt_tape';
allocate channel ch01 type 'sbt_tape';
allocate channel ch02 type 'sbt_tape';
allocate channel ch03 type 'sbt_tape';
allocate channel ch04 type 'sbt_tape';
allocate channel ch05 type 'sbt_tape';
allocate channel ch06 type 'sbt_tape';
allocate channel ch07 type 'sbt_tape';
SEND 'NB_ORA_SERV=hisdb1.cqcmcc.com , NB_ORA_CLIENT=cq2bk';
set until sequence 40657 thread 2;
recover database;
release channel ch00;
release channel ch01;
release channel ch02;
release channel ch03;
release channel ch04;
release channel ch05;
release channel ch06;
release channel ch07;
}
exit
EOF

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论