Wednesday, 27 February 2008

RMAN monitoring commands

Some Quick RMAN monitoring commands I find useful and their explanations

1. LIST commands

To show the incarnation of the database after the OPEN RESETLOGS operation for a database. As the Oracle Docs say "When performing incremental backups, RMAN can use a backup from a previous incarnation or the current incarnation as a basis for subsequent incremental backups. When performing restore and recovery, RMAN can use backups from a previous incarnation in restore and recovery operations just as it would use backups from the current incarnation, as long as all archived logs are available."

RMAN> list incarnation;

Backup commands to see summaries of available backups.

RMAN> list backup of database summary;
RMAN> list expired backup of archivelog all summary;
RMAN> list backup of tablespace users summary;

To see backups eligible for recovery which have status AVAILABLE use:

RMAN> list recoverable backup of database;

To see expired backups which will probably be deleted in the next backup run - if you have set up, delete expired, in your scripts.

RMAN> list expired backup;

To see each backup by database file

RMAN> list backup by file;

To see a particular tablespace backup

RMAN> list backup of tablespace users;

To see a particular datafile backup

RMAN> list backup of datafile 4;

To see all archivelogs currently on disk even the ones that have not been backed up by RMAN use:

RMAN> list archivelog all; -- does not mean that they have been backed up;

Lists the archivelogs available for recovery by RMAN

RMAN> list backup of archivelog all;

To see the controlfiles backed up and available for recovery

RMAN> list backup of controlfile;

To see the SPFILE backup, which is done automatically with the controlfile if you have set CONTROLFILE AUTOBACKUP ON.

RMAN> list backup of spfile;

2. REPORT commands

To see what datafiles/tablespaces haven't been backed up in the last 3 days use:

RMAN> report need backup days=3;

To see for which datafiles/tablespaces you haven't got at least 2 copies of backups (Retention policy to REDUNDANCY 2).

RMAN> report need backup redundancy 2;

To see objects which have been created with options like UNRECOVERABLE (for reasons of speed) and have not been backed up yet use:

RMAN> report unrecoverable;

This is the best ever RMAN command, shows you your database. If you have read these so far and you haven't used this command you will like it.

RMAN> report schema;

No comments: