0% found this document useful (0 votes)
71 views

RMAN: Basic RMAN Commands: Show Command

RMAN provides a common interface for backup tasks across different operating systems. It contains commands for showing configuration details, backing up databases and files, cataloging backups, generating reports on backups, and listing existing backups. Some key commands are SHOW to view configuration, BACKUP to back up databases and files, CATALOG to add backups to the repository, REPORT for backup reports, and LIST to view existing backups.

Uploaded by

Bhojpuri Power
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

RMAN: Basic RMAN Commands: Show Command

RMAN provides a common interface for backup tasks across different operating systems. It contains commands for showing configuration details, backing up databases and files, cataloging backups, generating reports on backups, and listing existing backups. Some key commands are SHOW to view configuration, BACKUP to back up databases and files, CATALOG to add backups to the repository, REPORT for backup reports, and LIST to view existing backups.

Uploaded by

Bhojpuri Power
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

RMAN: Basic RMAN Commands

Posted on February 19, 2014 by Brijesh Gogia — No Comments ↓


Oracle Recovery Manager (RMAN) satisfies the most pressing demands of performant, manageable
backup and recovery, for all Oracle data formats.
RMAN provides a common interface, via command line and Enterprise Manager, for backup tasks
across different host operating systems.
Below are some of the commonly used RMAN commands which you can run through RMAN
command line.
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

RMAN> backup current controlfile;


2) To back up the control file as part of a tablespace backup operation
RMAN> backup tablespace users include current controlfile;
3) To back up the server parameter file
RMAN> backup spfile;
4) To restart an RMAN backup that failed midway through a nightly backup.
RMAN> backup not backed up since time ‘sysdate-1′ database plus archivelog;
5) To force RMAN to back up a file regardless of whether it’s identical to a previously backed up file
by specifying the force option
RMAN> backup database force;
By using the force option, you make RMAN back up all the specified files, even if the backup
optimization feature is turned on.
6) To backup complete database
RMAN> backup database;
7) To backup database plus archivelogs
RMAN> backup database plus archivelogs;
8) To backup all archive logs
RMAN> backup archivelog all;
9) To backup specific data file
RMAN> backup datafile 5 tag dbfile_5_bkp;
A tag was also added to easily locate this datafile’s backup.
**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) 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

You might also like