Wednesday, March 30, 2016

RMAN: RMAN Command Line Reference Guide

Part NumberCommand #CommandObjective
Part-1Check RMAN configuration, backup and tablespaces
1show all;To check the current RMAN settings
2list backup;To check the available backups
3report schema;To check the tablespace and datafile sizes.
Part-2Backup Management
1delete backup;To delete the backup from RMAN’s repository
2delete force backup;To delete the backups from RMAN’s repository regardless of files physical availability
3delete noprompt force backup;To delete the backups from RMAN’s repository without prompting.
4DELETE BACKUP COMPLETED BEFORE 'SYSDATE-7'To delete backup that are older than 7 days
5DELETE BACKUP COMPLETED After 'SYSDATE-7'To delete backup from past 7 days til now
6DELETE BACKUP COMPLETED BETWEEN 'sysdate-7' and 'sysdate-3';To delete backup between two dates.
Part-3Archivelog Management
LIST1list archivelog all;To check the available archive logs
2list archivelog from time 'sysdate-2';To check the last 1 day of archivelogs
3list archivelog from scn 123;To list all archivelogs from a particular SCN
Note: You may have to check SCN # first from v$archived_log
4
DELETE1delete archivelog all;To delete all the archivelogs
2delete noprompt archivelog all;To delete the archivelogs without prompting
3delete force noprompt archivelog all;To delete the archivelogs withouth prompting and without checking its physical availability.
BACKUP1backup archivelog all;
2backup database plus archivelog all;
3backup archivelog all delete input;Backup all archivelog. Delete Once the backup is completed.
4backup archivelog all not backed up 1 times;Backup all archivelog which are not backed up atleast once.
5backup archivelog all not backed up 1 times delete all input;Backup all archivelog which are not backed up atleast once and then delete them.
6
Part-4Backup database manangement
1backup database;To take a full backup (without the intention of incremental backups).
2backup database plus archivelog;
3
4BACKUP INCREMENTAL LEVEL 0 database;To take a full backup (with the intention of incremental backups).
5backup incremental level 1 database;To take a incremental backup. A type of incremental backup that backs up all blocks that have changed since the most recent backup at level 1 or level 0
6BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;To take CUMALATIVE backup: This backups up all the blocks changed since the most recent backup at level 0. When recovering with cumulative incremental backups, only the most recent cumulative incremental backup needs to be applied.
Part-5Backup archivelog manangement
1delete expired backup;Any backupset which cannot be found on OS file directly (either delete or moved), are marked as expired.
2RESTORE DATABASE VALIDATE;Restore Validation confirms that a restore could be run,
by confirming that all database files exist and are free of
physical and logical corruption,
this does not generate any output
3delete obsolete;To delete any backups which are outside of retention policy.
4delete force obsolete;To delete any backups which are outside of retention policy regardless of its physical availability.
5delete force noprompt obsolete;To delete any backups which are outside of retention policy regardless of its physical availability. RMAN will not prompt user before deleting.
6delete archivelog until time '2007-04-30:09:30:50' backed up 1 times to device type disk;
Part-6Block corruption, datafile corruption,
1LIST FAILURE;This will list the detected failure with the FAILURE ID
2LIST FAILURE 101 DETAIL;Once the FAILURE ID is found out, you can find more details about that failure ID
3LIST RESTORE POINT ALL;You can list restore points known to the RMAN repository.
4LIST INCARNATIONYou can list all incarnations of a database. A new database incarnation is created when you open with the RESETLOGS option.
5
6VALIDAE DATABASE;To validate database.
If there is a datafile missing, it shows.
If there is a block corruption, it records in v$database_block_corruption; use "blockrecover corruption list;" to fix corrupted blocks
7VALIDATE CHECK logical database;

No comments:

Post a Comment