RMAN Commands Reference
This table provides an overview of commonly used Oracle Recovery Manager (RMAN) commands for database backup, recovery, and maintenance. It categorizes commands by functionality, such as backup, catalog, list, and validate, with concise descriptions for each. These commands were tested on Oracle 11gR2 (11.2.0.4).
Category | Commands | Description |
---|---|---|
SHOW COMMAND | SHOW ALL; | Shows all parameters. |
SHOW ARCHIVELOG DELETION POLICY; | Shows the archive log deletion policy. | |
SHOW ARCHIVELOG BACKUP COPIES; | Shows the number of archive log backup copies. | |
SHOW AUXNAME; | Shows the auxiliary database information. | |
SHOW BACKUP OPTIMIZATION; | Shows whether optimization is on or off. | |
SHOW CHANNEL; | Shows how the normal and auxiliary channels are configured. | |
SHOW CONTROLFILE AUTOBACKUP; | Shows whether control file autobackup is on or off. | |
SHOW CONTROLFILE AUTOBACKUP FORMAT; | Shows the format of the autobackup control file. | |
SHOW DATAFILE BACKUP COPIES; | Shows the number of datafile backup copies. | |
SHOW DEFAULT DEVICE TYPE; | Shows the default device type (disk or tape). | |
SHOW RETENTION POLICY; | Shows the policy for datafile and control file backups and copies marked as obsolete. | |
SHOW ENCRYPTION ALGORITHM; | Shows the encryption algorithm currently in use. | |
SHOW ENCRYPTION FOR DATABASE/TABLESPACE; | Shows the encryption for the database and every tablespace. | |
SHOW EXCLUDE; | Shows the tablespaces excluded from the backup. | |
SHOW MAXSETSIZE; | Shows the maximum size for backup sets (default is unlimited). | |
SHOW SNAPSHOT CONTROLFILE NAME; | Shows the snapshot control file name. | |
SHOW COMPRESSION ALGORITHM; | Shows the compression algorithm in force (default is ZLIB). | |
BACKUP COMMAND | BACKUP CURRENT CONTROLFILE; | To perform a manual backup of the current control file. |
BACKUP TABLESPACE USERS INCLUDE CURRENT CONTROLFILE; | To back up the control file as part of a tablespace backup operation. | |
BACKUP SPFILE; | To back up the server parameter file. | |
BACKUP NOT BACKED UP SINCE TIME 'SYSDATE-1' DATABASE PLUS ARCHIVELOG; | To restart an RMAN backup that failed midway. | |
BACKUP DATABASE FORCE; | To force RMAN to back up a file regardless of whether it’s identical to a previously backed up file. | |
BACKUP DATABASE; | To back up the complete database. | |
BACKUP DATABASE PLUS ARCHIVELOGS; | To back up the database and all archived logs. | |
BACKUP ARCHIVELOG ALL; | To back up all archive logs. | |
BACKUP DATAFILE 5 TAG dbfile_5_bkp; | To back up a specific datafile and add a tag for easy identification. | |
CATALOG COMMAND | CATALOG DATAFILECOPY '/u01/oracle/users.bkp'; | Add user-managed copies of datafile to RMAN repository. |
CATALOG BACKUPPIECE 'ertt2lu4_1_1'; | Add uncataloged backup piece to RMAN repository. | |
CATALOG START WITH '/backups/source_bkp' NOPROMPT; | Catalog multiple files from a specific backup directory. | |
CATALOG RECOVERY AREA; | To catalog all files in the flash recovery area. | |
REPORT COMMAND | REPORT NEED BACKUP; | To find out which backups need to be made to conform to the retention policy. |
REPORT SCHEMA; | To get a report about all the datafiles in a database. | |
REPORT OBSOLETE; | Reports on any obsolete backups. | |
LIST COMMAND | LIST BACKUP; | To review RMAN backups of datafiles, archived redo logs, and control files. |
LIST BACKUP BY FILE; | To list backups by just the backup files. | |
LIST BACKUPSET; | Lists only backup sets and proxy copies but not image copies. | |
LIST COPY; | Lists only datafile, archived redo log, and control file copies. | |
LIST BACKUPSET TAG 'full_database_backup'; | Lists backups by tag. | |
LIST BACKUP OF DATABASE; | To list all backups of all datafiles and archivelogs of the target database. | |
LIST INCARNATION; | Lists all incarnations of a database. | |
LIST RESTORE POINT; | Lists all restore points in the target database. | |
CROSSCHECK COMMAND | CROSSCHECK BACKUPSET; | Cross-checking backup sets. |
CROSSCHECK COPY OF DATABASE; | Cross-checking a copy of a database. | |
CROSSCHECK BACKUPSET 10, 12; | Cross-checking specific backup sets. | |
CROSSCHECK BACKUPPIECE TAG = 'monthly_backup'; | Cross-checking a backup tag. | |
CROSSCHECK CONTROLFILECOPY '/backups/control01.ctl'; | Cross-checking a control file copy. | |
CROSSCHECK BACKUP OF DATAFILE '/u01/oracle//system01.dbf' COMPLETED AFTER 'SYSDATE-7'; | Cross-checking backups completed after a specific time. | |
CROSSCHECK BACKUP; | Cross-checking all backups on disk and tape. | |
DELETE COMMAND | DELETE BACKUP; | To remove both archived redo logs and RMAN backups. |
DELETE COPY; | To remove all image copies. | |
DELETE BACKUPPIECE 9; | To delete a specific backup piece. | |
DELETE COPY OF CONTROLFILE LIKE '/backups/%'; | To delete copies of the control file from a specific location. | |
DELETE BACKUP TAG='double_bkp_prod'; | To delete backups with a specific tag. | |
DELETE BACKUP OF TABLESPACE SYSAUX DEVICE TYPE SBT; | To delete backups of a specific tablespace. | |
CHANGE COMMAND | CHANGE BACKUPSET 6 UNAVAILABLE; | To change the status of a backup set to unavailable. |
CHANGE BACKUPSET 6 AVAILABLE; | To change the status of a backup set to available again. | |
CHANGE BACKUP TAG 'initial_db_bkup' KEEP FOREVER; | To modify a regular consistent database backup into an archival backup. | |
CHANGE BACKUP TAG 'inital_db_backup' NOKEY; | To change the archival backup to a normal database backup. | |
CHANGE BACKUPSET 12 KEEP UNTIL TIME 'SYSDATE+60'; | To modify the time period for retaining archival backups. | |
VALIDATE COMMAND | VALIDATE BACKUPSET 5; | To validate a specific backup set. |
VALIDATE DATABASE ARCHIVELOG ALL; | To check for physical corruption without actually performing a backup. | |
VALIDATE CHECK LOGICAL DATABASE ARCHIVELOG ALL; | To check for logical corruption. | |
VALIDATE DATABASE; | To validate all datafiles at once. | |
VALIDATE RECOVERY AREA; | To validate the recovery area. | |
VALIDATE SPFILE; | To validate the spfile. |