Wednesday, 1 February 2012

RMAN-06136: ORACLE error from auxiliary database: ORA-19563: header validation failed for file

I have an script to refresh databases every night. This morning, it failed with error


RMAN-06136: ORACLE error from auxiliary database: ORA-19563: header validation failed for file .

No scripts modification recently. By a little research, it's been found out that another DBA added a data file with the same name on the production database. The file been added didn't cause any problem in the production database since it's added to a different mounting point. But the when refreshing, it maps to the same mounting point. As a result, the file got overwritten.

The solution is obviously to change the name at the source database. But since it's production, we can not do it without asking down time. So the work around is to add the following line to the init file of the database to be refreshed.

'/u09/oradata/HCMPROD/hrapp2.dbf','/u15/oradata/hcmstg/hrapp100.dbf',


#################  Try another approach to find the Files #######



save the RMAN logs in a file say rmanLogFile. 


To check if there is really a duplicate file-name compare below 2 outputs: 


cat rmanLogFile | grep "restoring datafile" | awk {'print $5'} | sort | wc -l 
cat rmanLogFile | grep "restoring datafile" | awk {'print $5'} | sort -u | wc -l 


If the second result is lesser, it means there are duplicates. To list out just the sorted file-name components use: 


cat rmanLogFile | grep "restoring datafile" | awk {'print $5'} | sort 

###############################################################
Cheers !

Hemesh.

No comments: