Rman
Rman
All the commands were tested on Oracle database version 11gR2 (11.2.0.4)
**SHOW COMMAND**
1) Shows all parameters.
RMAN> show all;
2) Shows the archivelog deletion policy.
RMAN> show archivelog deletion policy;
3) Shows the number of archivelog backup copies
RMAN> show archivelog backup copies;
4) Shows the auxiliary database information.
RMAN> show auxname;
5) Shows whether optimization is on or off.
RMAN> show backup optimization;
6) Shows how the normal channel and auxiliary channel are configured.
RMAN> show [auxiliary] channel;
7) Shows the characteristics of the channel
RMAN> show channel for device type [disk | <media device>;
8) Shows whether control file autobackup is on or off.
RMAN> show controlfile autobackup;
9) Shows the format of the autobackup control file
RMAN> show controlfile autobackup format;
10) Shows the number of datafile backup copies being kept.
RMAN> show datafile backup copies;
11) Shows the default type (disk or tape)
RMAN> show default device type;
12) Shows policy for datafile and control file backups and copies that RMAN marks
as obsolete.
RMAN> show retention policy;
13) Shows the encryption algorithm currently in use.
RMAN> show encryption algorithm;
14) Shows the encryption for the database and every tablespace.
RMAN> show encryption for [database | tablespace];
15) Shows the tablespaces excluded from the backup.
RMAN> show exclude;
16) Shows the maximum size for backup sets. The default is unlimited.
RMAN> show maxsetsize;
17) Shows the policy for datafile and control file backups and copies that RMAN
marks as obsolete.
RMAN> show retention policy;
18) Shows the snapshot control filename.
RMAN> show snapshot controlfile name;
19) Shows the compression algorithm in force. The default is the ZLIB algorithm.
RMAN> show compression algorithm;
**BACKUP COMMAND**
1) To perform a manual backup of the current control file
**REPORT COMMAND**
1) To find out which backups you need to make in order to conform to the retention
policy you put in place
RMAN> report need backup;
The output of the report need backup command tells you that you must back up which
all database files to comply with your retention policy.
2) To get a report about all the datafiles in a database
RMAN> report schema;
RMAN> report schema at time ‘sysdate-1′; (from a past point in time)
3) To reports on any obsolete backups
RMAN> crosscheck backup;
RMAN> report obsolete;
Always run the crosscheck command first in order to update the status of the
backups in the RMAN repository to that on disk and tape.
**LIST COMMAND**
1) To review RMAN backups of datafiles, archived redo logs, and control files.
RMAN> list backup;
2) List the backups by just the backup files
RMAN> list backup by file;
3) Lists only backup sets and proxy copies but not image copies
RMAN> list backupset;
4) Lists only datafile, archived redo log, and control file copies
RMAN> list copy;
5) Lists backups by tag:
RMAN> list backupset tag ‘full_database_backup’;
6) To list the backups of all datafiles and archivelogs of the target database:
RMAN> list backup of database;
7) Lists all incarnations of a database
RMAN> list incarnation;
When you perform an open resetlogs operation, it results in the creation of a new
incarnation of the database. When performing recovery operations on such a
database, you might want to check the database incarnation
8) Lists all restore points in the target database
RMAN> list restore point;
9) Lists the names of all recovery catalog scripts
RMAN> list script names;
10) Which of the backups of the target database have an expired status in the
repository.
RMAN> list expired backup;
11) Which of the archived redo log backups have the expired status
RMAN> list expired archivelog all;
12) To restrict the list of backups and copies whose status is listed as available
RMAN> list recoverable backup;
13) To view all the restore points in the database
RMAN> list restore point all;
**CROSSCHECK COMMAND**
**DELETE COMMAND**
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) To delete all archived redo logs
RMAN> delete archivelog all;
8) To delete already backed up archived redo logs
RMAN> delete archivelog all backed up 2 times to sbt;
9) To delete specific archived redo logs
RMAN> delete archivelog until sequence = 1234;
10) Delete archive logs after taking backup
RMAN> backup device type sbt archivelog all delete all input;
11) Delete stored script
RMAN> 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:
RMAN> delete global script full_disk_db;
**CHANGE COMMAND**
**VALIDATE COMMAND**
1) To check all the datafiles and the archived redo logs for physical corruption
without actually performing the backup
RMAN> backup validate database archivelog all;
2) To check for logical corruption without actually performing the backup
RMAN> backup validate check logical database archivelog all;
The check logical clause means that RMAN will check for logical corruption only.
3) To validate a single backup set
RMAN> validate backupset 5;
4) To validate all datafiles at once
RMAN> validate database;
Note that the validate command can check at a much more granular level than the
backup … validate command. You can use the validate command with individual
datafiles, backup sets, and even data blocks.
The validate command always skips all the data blocks that were never used, in each
of the datafile it validates.
5) To validate recovery area
RMAN> validate recovery area;
6) To validate all the recovery related files
RMAN> validate recovery files;
7) To validate the spfile
RMAN> validate spfile;
8) To validate specific tablespace
RMAN> validate tablespace <tablespace_name>;
9) To validate specific control file copy
RMAN> validate controlfilecopy <filename>;
10) To validate specific backupset
RMAN> validate backupset <primary_key>;
Share
Brijesh Gogia
Brijesh Gogia
I’m an experienced Cloud/Oracle Applications/DBA Architect with more than 15 years
of full-time DBA/Architect experience. I have gained wide knowledge on Oracle and
Non-Oracle software stack running on-prem and on Cloud and have worked on several
big projects for multi-national companies. I enjoy working with leading-edge
technology and have a passion for Cloud architecture, automation, database
performance, and stability. Thankfully my work allows me time for researching new
technologies (and to write about them).
expertoracle.com
Related Posts:
Physical and Logical Block Corruption in Oracle Database
Useful UNIX/LINUX commands for DBAs
RMAN : CONFIGURE YOUR RMAN ENVIRONMENT
RMAN: RECOVERY SCENARIOS RELATED TO DATABASE
RMAN: CONTROL FILE RECOVERY SCENARIOS
RMAN: CREATE THE RECOVERY CATALOG
RMAN: GRANTING RESTRICTED ACCESS USING VIRTUAL PRIVATE CATALOG
RMAN-08137: WARNING: archived log not deleted, needed for standby or upstream
capture process
Frequently Used GoldenGate Commands
Oracle Database RMAN Interview Questions
CATEGORIES:RMAN RMAN Scripts SCRIPTS
PREVIOUS POST
RMAN: GRANTING RESTRICTED ACCESS USING VIRTUAL PRIVATE CATALOG
NEXT POST