Tuesday, August 9, 2011

"CROSSCHECK" and "DROP DATABASE" command


CROSSCHECK

Purpose:
To verify the status of backups and copies recorded in the RMAN repository against media such as disk or tape. 

Backup states:

EXPIRED: An Object is not found on disk or tape.
AVAILABLE: An Object is available for use by RMAN.
UNAVAILABLE: An object is not available for use by RMAN.

Examples:

Crosschecking All Backups and Copies: 

CROSSCHECK BACKUP; 

Crosschecking Within a Range of Dates: 

CROSSCHECK BACKUP COMPLETED BETWEEN '01-JAN-01' AND '01-SEP-01';


DROP DATABASE:

Purpose:
Deletes the target database and, if RMAN is connected to a recovery catalog, unregisters it. RMAN removes all datafiles,online logs, and control files belonging to the target database and their corresponding backups.

Example:

RMAN> sql 'alter system enable restricted session';

RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;

Enjoy:-)