Configure RMAN Recovery Catalog
RMAN recovery catalog Is another database which is out of your normal databases or which is on a separate server and which will save only the details of your backups in terms of metadata of the backup.
Whenever you trigger the backup, RMAN will Update the information in the control file. Your control files can store the backup details for the last 30 days only which is the default 30 days retention period. Suppose you want to have the details of the backups which are taken before 30 days. The recovery catalog will help to you in this case to store the history backup details.
Importance of Recovery Catalog:
RMAN stores the backup information into the control file
If we lose control file, we lose all the backup information
Even though the backups are available, they are not usable. If you lose the control file, the backups are of no use as Oracle or RMAN doesn’t know which backup belongs to which database. The reason behind this is the information is stored in the control file which you lost
To resolve all the above three issues, we use recovery catalog.
Recovery catalog is a separate database that stores backup information
One recovery catalog can store multiple target database backup information
You don’t have to create multiple recovery catalog for multiple target databases. You can create one recovery catalog database for all the databases or servers
Benefits of Recovery catalog
It helps in database recovery when you lose the control file
You can use recovery catalog for backups reporting also
You can write RMAN scripts in recovery catalog and save them
You can store RMAN scripts in recovery catalog
Store long term backup history
Cloning with PITR (Point in time recovery) becomes easier as the recovery catalog knows which Control file is required
Note: These RMAN scripts are your backup scripts or your recovery scripts. You don’t have to use OS level scripts to take the database backup. The primary requirement to have the RMAN scripts is to have the recovery catalog
Recovery catalog configuration
Below are the steps to configure RMAN recovery catalog.
On a seperate machine, install Oracle database. Then Create a small database with SID as rcat.
Remember recovery catalog resides on a separate server and that is why you need to configure a separate machine
Create a default tablespace under rcat database which will be used for backup information storage
SQL> create tablespace rmantbs datafile '/u01/app/oracle/oradata/rcat/rmantbs01.dbf' size 50mb;
You can create a small tablespace and keep on adding the space when You get some alerts or when the database throws some errors. We are going with the very small size of 50 MB.
Next, Create a user which will be used to connect recovery catalog and store backup information. We will create the user rman_rc to connect to the recovery catalog. This user rman_rc will store the information into rmantbs tablespace
SQL> create user rman_rc identified by rman_rc default tablespace rmantbs temporary tablespace temp;
Grant permissions to rman_rc user
SQL> grant connect,resource,recovery_catalog_owner to rman_rc;
In this command, recovery_catalog_owner should be granted a permission to the user rman_rc otherwise we cannot use the user for the recovery catalog.
Next, Configure networking between target server and catalog server. Make sure to add tns entry details of catalog server on target server. In my case, below is the tns entry of catalog server:
rcat = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.102)(PORT = 1521) ) (CONNECT_DATA = (SERVICE_NAME = rcat) ) )
On target server, start RMAN utility and connect only the catalog database. We will not create catalog on the catalog database:
rman catalog rman_rc/rman_rc@rcat RMAN> create catalog;
This will create all the necessary tables and views which are required to store the backup information in the user rman_rc and into the database rman_rc@rcat
Exit RMAN and now connect both target and catalog database:
rman target / catalog rman_rc/rman_rc@rcat
We need to register our target database to the recovery catalog database. Use below command to register target database into catalog database:
RMAN> register database;
You can see the statement in the above screenshot: starting full resync of recovery catalog. It means that whatever backup information available in the proddb file is now updated also in the recovery catalog.
‘Full resync complete’ means that your control files backup information and the recovery file backup information are updated.