904 Bedford St, New York NY 10014

(+1) 5184-453-1514

Put It Together in a Script – RMAN Backups and Reporting

An RMAN script can pull of these configurations together and automate the backup job. The following is an instructional script that shows how these components work together.

This gives a basic script for a starting point to understanding the RMAN recommendations and be able to implement them. There is also a good chance that a script has already been configured for your environment, and this will help in understanding it.

Check for Corruption

A backup file is only good if you can restore it. You can use RMAN to check for corruption in data files, archivelogs, and control files.

You can also verify whether a backup set is restorable. The RMAN VALIDATE command is used to perform these types of integrity checks.

There are three ways you can run the VALIDATE command:

•     VALIDATE

•     BACKUP … VALIDATE

•      RESTORE … VALIDATE

The VALIDATE command can be used on its own to check for missing files or physical corruption in database data files, archivelog files, control files, spfiles, and backup set pieces. For example, this command will validate all data files and the control files:

RMAN> validate database;

You can also validate just the control file, as follows:

RMAN> validate current controlfile;

You can validate the archivelog files, like so:

RMAN> validate archivelog all;

You may want to combine all the prior integrity checks into one command, as shown here:

RMAN> validate database include current controlfile plus archivelog;

Under normal conditions, the VALIDATE command checks only for physical corruption. You can specify that you also want to check for logical corruption by using the CHECK LOGICAL clause:

RMAN> validate check logical database include current controlfile plus archivelog;

VALIDATE has a variety of uses. Here are a few more examples:

RMAN> validate database skip offline; RMAN> validate copy of database; RMAN> validate tablespace system; RMAN> validate datafile 3 block 20 to 30; RMAN> validate spfile; RMAN> validate backupset <primary_key_value>; RMAN> validate recovery area;RMAN> validate pluggable database pdbname;

If RMAN detects any corrupt blocks, the V$DATABASE_BLOCK_CORRUPTION is populated. This view contains information on the file number, block number, and number of blocks affected. You can use this information to perform a block-level recovery.

Physical corruption is a change to a block, such that its contents do not match the physical format that Oracle expects. By default, RMAN checks for physical corruption when backing up, restoring, and validating data files. With logical corruption, a block is in the correct format, but the contents are not consistent with what Oracle expects, such as in a row piece or an index entry.

Search

Popular Posts

  • Recovery Catalog Versions – RMAN Backups and Reporting
    Recovery Catalog Versions – RMAN Backups and Reporting

    I recommend that you create a recovery catalog for each version of the target databases that you are backing up. Doing so will save you some headaches with compatibility issues and upgrades. I have found it easier to use a recovery catalog when the database version of the rman client is the same version used…

  • Registering a Target Database – RMAN Backups and Reporting
    Registering a Target Database – RMAN Backups and Reporting

    Now, you can register a target database with the recovery catalog. Log in to the target database server. Ensure that you can establish connectivity to the recovery catalog database. For instance, one approach is to populate the TNS_ADMIN/tnsnames.ora file with an entry that points to the remote database. On the target database server, register the…

  • Creating a Recovery Catalog – RMAN Backups and Reporting
    Creating a Recovery Catalog – RMAN Backups and Reporting

    When I use a recovery catalog, I prefer to have a dedicated database that is used only for the recovery catalog. This ensures that the recovery catalog is not affected by any maintenance or downtime required by another application (and vice versa). Listed next are the steps for creating a recovery catalog: 1. Create a…

Tags