Author: Sam
Page:
1
2
Oracle Recovery Manager (RMAN) utility is used for backing-up, restoring and recovering Oracle Databases. In this article I will discuss the frequently used RMAN commands that will make your life easy as a database administrator.
RMAN Prompt:
You can get the RMAN prompt by typing RMAN
RMAN>
Connecting to Target Database:
Connection to target database can be made by using a username and password.
RMAN> connect target username/password@string
Connecting to Target Database as Database Owner:
You can connect to target database as database owner by using ‘/'
RMAN> connect target /
Connecting to RMAN Catalog:
You can use connect catalog command to connect to the RMAN catalog.
RMAN> connect catalog username/password@string
Connecting to Auxiliary Database:
You may need to connect to an auxiliary database for duplicating a database for cloning. Use below command for connecting to an auxiliary database.
RMAN> connect AUXILIARY username/password@string
Connecting to Auxiliary Database as Owner:
You can connect to AUXILIARY as the owner by using '/'
RMAN> connect AUXILIARY /
Backup Database:
You can use below command to backup the database with RMAN.
RMAN>BACKUP DATABASE;
Back Up Database Tablespaces:
You can use below command to backup individual tablespaces with RMAN.
RMAN>BACKUP TABLESPACE GLD, GLX;
Archivelogs:
You can backup database along with the archivelogs by using below command.
RMAN>BACKUP DATABASE PLUS ARCHIVELOG;
Backup SPFILE:
You can use below command to backup the SPFILE of the target database.
RMAN>BACKUP SPFILE:
Backup CONTROLFILE:
You can use below command to backup your controlfile.
RMAN>BACKUP CURRENT CONTROLFILE;
The include controlfile option can be used to include the backup of your current control file along with any other backups you may perform. This backups your database, archive logs and also a copy of your current control file.
RMAN>BACKUP DATABASE PLUS ARCHIVELOG INCLUDE CURRENT CONTROLFILE;
Determining files to backup:
You can determine the files that need to backup by using REPORT command. This lists the files that need to be backed up based on the retention policy in place.
RMAN>REPORT NEED BACKUP;
Establishing Channels:
You can establish a channel between database instance and RMAN by using ALLOCATE CHANNEL command specified within the run braces. Single or multiple channels can be specified. The channel is released once RMAN finishes the task with it. The DEVICE TYPE clause can be used to specify either a DISK to the channel or a TAPE. Below command allocates a channel for RAMN with device type as TAPE.
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt;
....................................
}
Using Media Management Library:
You can use the media management library of your media manager by using PRAMS command. Below example shows the prams parameter for a Tivoli Storage Media.
allocate channel ch1 type 'sbt_tape' parms
'ENV=(TDPO_OPTFILE=/opt/tivoli/tsm/client/oracle/bin/tdpo.samdb)';
Continued...
Page:
1
2
More Oracle Articles, Database Articles and DBA Tips
Database Security: Step by step guideline
Effective Tips for Materialized Views!!
DBA Tips for Resizing Online Redo Logs!
The OS debate: Oracle on Linux - Oracle on Windows
The power of Oracle Optimizer Hints!
|