Published by : Obay Salah , November 19, 2024

Before discussing Backup and Recovery through RMAN, it's essential to talk about the Recovery Catalog because it is preferred for the database administrator.

Using the Recovery Catalog when interacting with RMAN is important because the information related to RMAN and the backup information is retained in the Control File only for a limited period. This period is determined by the variable CONTROL_FILE_RECORD_KEEP_TIME. Additionally, this information can be lost if we lose the Control File and do not have the necessary backups.

The Recovery Catalog is a schema created in the database to store the following information:

  1. Data File and Archive Log File Backup Sets and Backup Pieces.
  2. Data File Copies.
  3. Archive Log Files.
  4. The Physical Structure of The Target Database.
  5. Persistent RMAN Configuration Settings.
  6. Stored Job Scripts.

The Recovery Catalog can also be used when we want to manage multiple target databases, and generally, it is preferred to use the Recovery Catalog when using RMAN.

Therefore, I will now create the Recovery Catalog, which we will then use later for backup and recovery tasks. Here are the steps for creation:

1- Create a Tablespace for the Recovery Catalog in the Catalog database

CREATE TABLESPACE RMAN_CATALOG DATAFILE  'C:\oradata\RMAN_CATA LOG.DBF' SIZE ١G;

2- Create a Schema for the Recovery Catalog in the Catalog Database.

CREATE USER TEST IDENTIFIED BY TEST DEFAULT TABLESPACE RMAN_CATALOG QUOTA UNLIMITED ON RMAN_CATALOG;

3- Grant permissions to the user that we created for the Recovery Catalog.

GRANT RECOVERY_CATALOG_OWNER,CONNECT TO TEST;

4- We create the Catalog through RMAN after connecting to the Catalog Database, which means informing RMAN about the Catalog we created in the previous steps.

RMAN> CREATE CATALOG TABLESPACE RMAN_CATALOG;

At this moment, the tables and views that will store the data in the Recovery Catalog schema are being created.

5- We register the target database in the Catalog using RMAN after connecting to both the Target Database and the Recovery Catalog.

It should also be noted that it is necessary to connect to the target database using a user with SYSDBA privileges, and then register the target database in the Catalog.

Now, the structure of the target database will be registered in the tables of the Recovery Catalog.

RMAN> REGISTER DATABASE;

At this moment, the data specific to the target database is being registered in the Recovery Catalog.

You can perform queries about this from the tables available in the Recovery Catalog schema.

Now we have a Target Database and we have a Recovery Catalog.

Of course, if the target database is not registered, we cannot store data about the target database in the Recovery Catalog.

At this moment, the structure of the target database is stored in the Recovery Catalog.

And of course, there is no guarantee that the structure of the target database will not change, so we need to resynchronize the Recovery Catalog with the Control File available in the target database until complete synchronization is achieved between the target database and the Recovery Catalog.

In fact, RMAN performs this synchronization automatically when needed. You may also do this manually using the command RESYNC CATALOG.

RMAN> RESYNC CATALOG;

Generally, we may need this procedure when creating or deleting a Tablespace or Data File, or when changing the location of the Database Files.

Sometimes, a target database is opened in RESETLOGS mode. In such cases, there is no synchronization between the target database and the Recovery Catalog.

Therefore, in this situation, we use the command RESET DATABASE.

This isn't everything about the Recovery Catalog, but it's what you need to know now. We will continue the discussion on this topic later.

However, you should remember that you may not need the Recovery Catalog at all; you can connect to the target database through RMAN and then perform your tasks.

But remember, it’s generally better for you to use the Recovery Catalog.

Tags : Backup and Recovery

You May Also Like

Comments

no comment yet!