











1、案例概述
客户有一套数据库需要迁移,驻场的同事计划利用DataGuard技术进行迁移,在搭建 Data Guard 物理备库(PSTEST → PSTESTDG)过程中,遭遇ORA-19563: header validation failed for file 错误。
2、案例分析
2.1 查看Duplicate命令详细的报错信息。
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 08/22/2026 04:49:37
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: ORA-19563: header validation failed for file
可以看出,在duplicate的过程中,验证数据文件的文件头信息时失败。
2.2检查DataGuard文件转换相关的配置参数,如下所示:
db_file_name_convert = "/db/app/oracle/oradata/HR92PRD/","/db/app/oracle/oradata/HR92PRD/","/u01/data","/db/app/oracle/oradata/HR92PRD/"
log_file_name_convert = "/db/app/oracle/oradata/HR92PRD/","/db/app/oracle/oradata/HR92PRD/","/u01/data","/db/app/oracle/oradata/HR92PRD/"
可以看出,源端数据库的数据文件和日志文件存放在"/db/app/oracle/oradata/HR92PRD/"和"/u01/data"这两个路径下。
2.3 分析数据库的alert日志。
Fri Aug 21 23:12:12 2026
Managed Standby Recovery not using Real Time Apply
Read of datafile '/db/app/oracle/oradata/HR92PRD/psimage208.dbf' (fno 187) header failed with ORA-01210
Hex dump of (file 187, block 1) in trace file /db/app/oracle/diag/rdbms/pstestdg/PSTEST/trace/PSTEST_pr00_25405.trc
Corrupt block relative dba: 0x2ec00001 (file 187, block 1)
Bad header found during datafile header read
Data in bad block:
type: 11 format: 2 rdba: 0x39800001
last change scn: 0x0000.00000000 seq: 0x1 flg: 0x04
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x00000b01
check value in block header: 0xaa1b
computed block checksum: 0x0
Rereading datafile 187 header failed with ORA-01210
MRP0: Background Media Recovery terminated with error 1110
Errors in file /db/app/oracle/diag/rdbms/pstestdg/PSTEST/trace/PSTEST_pr00_25405.trc:
ORA-01110: data file 187: '/db/app/oracle/oradata/HR92PRD/psimage208.dbf'
ORA-01122: database file 187 failed verification check
ORA-01110: data file 187: '/db/app/oracle/oradata/HR92PRD/psimage208.dbf'
ORA-01210: data file header is media corrupt
Recovery Slave PR00 previously exited with exception 1110
可以看出, psimage208.dbf这个数据文件异常。
2.4 搜索rman中report schema命令输出,发现如下:

不同的目录下,有相同的数据文件名,这就是问题所在了。
源端的数据文件psimage208.dbf在经过db_file_name_convert 转换后,不可能在一个目录下生成两个同名的文件。
2.5 解决办法:在duplicate之前,先把所有重名的数据文件进行set newname操作。示例:
run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate auxiliary channel stby1 type disk;
allocate auxiliary channel stby2 type disk;
set newname for datafile 187 to "/db/app/oracle/oradata/HR92PRD/psimage208_01.dbf";
set newname for datafile 230 to "/db/app/oracle/oradata/HR92PRD/psimage208_02.dbf";
duplicate target database for standby from active database nofilenamecheck;
}
最终,问题解决。
3、案例总结
更新DataGuard 的部署文档,把“不同路径下的相同文件名”的数据文件检查,作为一个前置的检查项。检查SQL如下所示:
select file_name_only, count(*)
from (select regexp_substr(file_name, '[^\\/]+$') as file_name_only
from dba_data_files)
group by file_name_only
having count(*) > 1;
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。