I am an Oracle Database Specialist in Singapore.
EU visitors : Please note that this site uses cookies.

30 August, 2015

RMAN -- 8 : Using a Recovery Catalog Schema

Besides retaining information about backups in the controlfile, Oracle allows the use of an (external) Recovery Catalog schema. This schema is queryable via SQL in the same manner as querying any user / application schema.

Let's start with a database that already has backups present but created without a Recovery Catalog Schema.

I now create a Catalog Schema and register this database into that schema. There are 4 steps to this. The first is to create the database that will hold t he Catalog Schema (here, we presume that the database has been created before today's steps). The next is to create the database account for the Catalog Schema (I create the account RCAT_OWNER). The third step is to login to the Catalog Schema with RMAN and run the CREATE CATALOG command. The final step is to create an RMAN connection from the TARGET database to the Catalog and REGISTER the database.

When I disconnect from the Catalog Schema and do a local only (TARGET) connection, I can see 4 backups of the datafile. So, what gives ? Let me try an SQL query on V$BACKUP_DATAFILE.
(As an aside : Note above how there an be discrepancy in the listings showed by LIST BACKUP in the two scenarios (a) without a Recovery Catalog connection and (b) with a Recovery Catalog that was created after the last RESETLOGS). This is something to remember.

Notice that I have added two columns (RESETLOGS_CHANGE# and RESETLOGS_TIME) in the query. Now, I see that the two older backups were from an *older* incarnation of the database. They have a different RESETLOGS_CHANGE# / RESETLOGS_TIME. So, those backups of the older incarnation are not cataloged into the Catalog Schema !

Can I do anything about this ? It seems that the full RESYNC doesn't resync for backups of previous incarnations. Can I reset my RETENTION POLICY and then do a RESYNC ?

Well, apparently, even the CATALOG command refuses to catalog backup pieces from an older incarnation !

So, it seems that :
1. If you've done a RESETLOGS recently and even though the controlfile may show previous backups, if you create a Catalog Schema after the RESETLOGS, previous backups (i.e. of the preceding incarnation) are not visible in the Catalog (disconnecting from the Catalog does allow you to view the previous backups in RMAN !)
2. The CATALOG command also will not include the previous backups, it will only accept backups of the current incarnation.

This testing has been done with 11.2.0.2 Has the behaviour changed in 11.2.0.4 / 12.1.0.1 / 12.1.0.2 ?