Monday, July 13, 2009

Delete the unavailable physical logs in RMAN Catalog


1. Connect to RMAN from a database

2. Connect to the RMAN catalog database using the following syntax,
RMAN> connect catalog username@target (target SID is the name specified in tnsnames.ora);

3. Then issue the following command to connect to the target database, the one from which we connected RMAN prompt
RMAN> connect target / nocatalog;

4. Crosscheck all the archive logs using the following command,
RMAN>change archivelog all crosscheck
Eg:
archive log filename=/TEST/app/oracle/dbs/arch1_321_656634552.dbf recid=1172 stamp=660702066
validation failed for archived log

5. Delete the archive logs which are physically unavailable (Validation failed) in the database in RMAN repository through the following command,
RMAN>change archivelog ‘location’ uncatalog;
Eg: RMAN> change archivelog '/TESTData/archivelogs/TEST_arch_329_2_656634552.arc' uncatalog;
uncataloged archive log
archive log filename=/TESTData/archivelogs/TEST_arch_329_2_656634552.arc recid=456 stamp=659492030
Uncataloged 1 objects

6. Repeat for all the physically unavailable catalogs are deleted from the RMAN catalog repository.

7. Check the same by executing the following command, the output should not contains any validation failed entries
RMAN>check archivelog all crosscheck
Eg:
RMAN> check archivelog all crosscheck
archive log filename=/TESTData/archivelogs/TEST_arch_850_2_656634552.arc recid=1170 stamp=660690042
validation succeeded for archived log
archive log filename=/TESTData/archivelogs/TEST_arch_851_2_656634552.arc recid=1171 stamp=660702066
Crosschecked 4 objects

8. Then change the backup command of the TEST instance from
backup incremental level 0 device type sbt archivelog all not backed up skip inaccessible delete input;
to
backup incremental level 0 device type sbt archivelog all not backed up delete input;

9. Submit the job from OEM and check the same.

10. Backup control file to disk,
DEV - backup device type disk current controlfile format '/Orabkp/oracle/DEV/%U;
TEST - backup device type disk current controlfile format '/Orabkp/oracle/TEST/%U;

1 comment:

tikitodo said...

there are many ways of extract data from an sql mdf file, try this application if you’d like to get better results