Posts

Showing posts from June, 2015

Recover from datafile block corruption leveraging physical standby

Here are the steps I used to recover my primary database by leveraging a Dataguard environment. ## on standby 1. stop managed recovery on standby. SQL> alter database recover managed standby database cancel; 2. Backup as a copy of the datafile from standby. RMAN> backup as copy datafile 2 format '/app/oracle/temp/sysaux_01.dbf'; 3. SCP the backup copy of the datafile to the primary database server. scp /app/oracle/temp/sysaux_01.dbf <target_server>:/app/oracle/temp ## on primary 4. Take corrupt datafile offline. SQL> alter database datafile 2 offline; 5. Catalog datafile to the primary database so the controlfile knows about it. RMAN> catalog datafilecopy '/app/oracle/temp/sysaux_01.dbf'; 6. Restore and recover the datafile in question. RMAN> restore datafile 2; RMAN> recover datafile 2; 7. Bring the datafile back online. SQL> alter database datafile 2 online; 8. Validate that the corruption is no longer pr...

RMAN-05001: auxiliary file name conflicts with a file used by the target database

RMAN-05001: auxiliary file name <file_name> conflicts with a file used by the target database I ran into an issue where I was trying to clone a new copy of non-production database (using production database as the source) by leveraging the RMAN clone via active database to save me some time and work.   I ran into the error where I couldn't successfully clone the database.  I made sure that my environment, pfile, RMAN script were configured correctly.  After much time of troubleshooting, I figured out the issue. After remembering that the source database had a DG environment, it occurred to me that was what was  causing  the error.  Reason being, the source had log_file_name_convert and db_file_name_convert configured which was being "carried over" onto my auxiliary instance hence causing the error mentioned above.  So all I needed to do was simply reset those two parameters within my RMAN script (as seen below) and I was able to suc...