Rman Basic Command List (Easy to Understand)
*SHOW COMMAND**
1) show all;
2) show archivelog deletion policy;
3) show archivelog backup copies;
4) show auxname;
5) show backup optimization;
6) show [auxiliary] channel;
7) show channel for device type [disk
| <media device>;
8) show controlfile autobackup;
9) show controlfile autobackup format;
10) show datafile backup copies;
11)
show default device type;
12)
show retention policy;
13)
show encryption algorithm;
14)
show encryption for [database | tablespace];
15)
show exclude;
16)
show maxsetsize;
17) show retention
policy;
18)
show snapshot controlfile name;
19) show compression
algorithm;
**BACKUP COMMAND**
1) backup current
controlfile;
2)
backup tablespace users include current controlfile;
3) backup
spfile;
4)
backup not backed up since time ‘sysdate-1′ database plus archivelog;
5)
backup database force;
6)
backup database;
7)
backup database plus archivelogs;
8)
backup archivelog all;
9)
backup datafile 5 tag dbfile_5_bkp;
**CATALOG COMMAND**
1)
Add user-managed copies of datafile to RMAN repository
RMAN>
catalog datafilecopy ‘/u01/oracle/users.bkp’;
RMAN>
catalog datafilecopy ‘/u01/oracle/users.bkp’ level 0; (To
catalog as incremental level 0 backup)
2)
Add uncataloged backup piece to RMAN repository
RMAN>
catalog backuppiece ‘ertt2lu4_1_1′;
3)
To catalog multiple files ( say you copied production backup to target database
for database cloning)
RMAN>
catalog start with ‘/backups/source_bkp’ noprompt;
The
start with clause specifies that RMAN catalog all valid backup sets, datafile
copies, and archived redo logs starting with the string pattern you pass.
4)
To catalog all files in the flash recovery area
RMAN>
catalog recovery area;
**REPORT COMMAND**
1)report
need backup;
2)
report schema;
report schema at time ‘sysdate-1′; (from
a past point in time)
3)
report obsolete;
**LIST
COMMAND**
1)
list backup;
2)
list backup by file;
3)
list backupset;
4)
list copy;
5)
list backupset tag ‘full_database_backup’;
6)
list backup of database;
7) list
incarnation;
8)
list restore point;
9)
list script names;
10)
list expired backup;
11)
list expired archivelog all;
12)
list recoverable backup;
13)
list restore point all;
**CROSSCHECK
COMMAND**
1)
crosscheck backupset;
2)
crosscheck copy of database;
3)
crosscheck backupset 10, 12;
4)
crosscheck backuppiece tag = ‘monthly_backup’;
5)
crosscheck controlfilecopy ‘/backups/control01.ctl’;
6)
crosscheck backup of datafile “/u01/oracle//system01.dbf” completed after
‘sysdate-7′;
7) crosscheck
backup of archivelog all spfile;
8)
crosscheck backup;
**DELETE COMMAND**
1)
delete backup;
2)
delete copy;
3)
delete backuppiece 9;
4)
delete copy of controlfile like ‘/backups/%’;
5)
delete backup tag=’double_bkp_prod’;
6)
delete backup of tablespace sysaux device type sbt;
******************
Note -You can also
use force, expired, obsolete keyword with delete commad:
delete force ..: Deletes the
specified files whether they actually exist on media or not and removes
their records from the RMAN repository as well
delete expired ..: Deletes only those
files marked as expired as per crosscheck command.
delete obsolete ..: Deletes datafile
backups and copies and the archived redo logs and log backups that are
recorded as obsolete in the RMAN repository
The delete obsolete command relies only on the backup retention policy
in force.
******************
7)
delete archivelog all;
8)
delete archivelog all backed up 2 times to sbt;
9)
delete archivelog until sequence = 1234;
10)
backup device type sbt archivelog all delete all input;
11)
delete script full_disk_db;
If you have two scripts—one local and one global—in the same name, then
the delete script command drops the local one, not the global one. If you
want to drop the global script, you must use the keyword global in the
command, as shown here:
12)delete
global script full_disk_db;
**CHANGE COMMAND**
1)
change backupset 6 unavailable;
2)
change backupset 6 available;
3)
change backup tag ‘initial_db_bkup’ keep forever;
4)
change backup tag ‘inital_db_backup’ nokeep;
5)
change backupset 12 keep until time ‘sysdate+60′;
**VALIDATE COMMAND**
1)
backup validate database archivelog all;
2)
backup validate check logical database archivelog all;
3)
validate backupset 5;
4)
validate database;
5)
validate recovery area;
6)
validate recovery files;
7)
validate spfile;
8)
validate tablespace <tablespace_name>;
9)
validate controlfilecopy <filename>;
10)
validate backupset <primary_key>;