Professional Documents
Culture Documents
Oracle RMAN PDF
Oracle RMAN PDF
ORACLE RMAN QUICK GUIDE TAKING A DATABASE BACKUP WITH RMAN RMAN> backup as compressed backupset database; RMAN> LIST backup;
Starting backup at 02-NOV-09
FOR THE BEGINNING USER Backing up the database can be done with just a few commands or can be allocated channel: ORA_DISK_1 OPTIONS
made with numerous options. You can set many parameters by configuring channel ORA_DISK_1: SID=155 device type=DISK
LANGUAGE FUNDAMENTALS them first and making them persistent or you can override them by specify- channel ORA_DISK_1: starting compressed full SUMMARY Returns just a summary of your backups
ing them explicitly in your RMAN backup command. datafile backup set
Oracle Recovery Manager (RMAN) is Oracles preferred method by which we ARCHIVELOG ALL You can see your archivelog backups
channel ORA_DISK_1: specifying datafile(s) in backup
are able to take backups and restore and recover our database. The follow- set COMPLETED <after, Used to filter your backup selection
ing list gives an overview of the commands and their uses in RMAN. RMAN> backup database; input datafile file number=00001 name=C:\APP\MPYLE\ between, before>
Starting backup at 28-AUG-09 ORADATA\ORADB\SYSTEM01.DBF
input datafile file number=00002 name=C:\APP\MPYLE\ TAG Allows you to search for a tagged backup
BASIC SYNTAX AND EXAMPLES using target database control file instead of
recovery catalog ORADATA\ORADB\SYSAUX01.DBF
Commands that are used to backup our Oracle databases. The database allocated channel: ORA_DISK_1 input datafile file number=00003 name=C:\APP\MPYLE\ RMAN> list backup SUMMARY;
must be in archivelog mode for RMAN to take open database backups. You channel ORA_DISK_1: SID=121 device type=DISK ORADATA\ORADB\UNDOTBS01.DBF
input datafile file number=00004 name=C:\APP\MPYLE\ RMAN> list ARCHIVELOG ALL;
can however use RMAN to take a cold backup if needed. channel ORA_DISK_1: starting full datafile backup
set ORADATA\ORADB\USERS01.DBF RMAN> list backup COMPLETED before 28-AUG-09;
channel ORA_DISK_1: specifying datafile(s) in backup channel ORA_DISK_1: starting piece 1 at 02-NOV-09 RMAN> list backup of database TAG db01;
LOGGING INTO RMAN set channel ORA_DISK_1: finished piece 1 at 02-NOV-09
input datafile file number=00001 name=C:\APP\MPYLE\ piece handle=C:\TEMP\1GKTBGGA_1_1
export ORACLE_SID=<database sid> ORADATA\ORADB\SYSTEM01.DBF tag=TAG20091102T131138 comment=NONE RESTORING YOUR BACKUPS
input datafile file number=00002 name=C:\APP\MPYLE\ channel ORA_DISK_1: backup set complete, elapsed
ORADATA\ORADB\SYSAUX01.DBF time: 00:01:15
c:\>rman target / Finished backup at 02-NOV-09 Performing a restore of your database can be done very easily with RMAN.
input datafile file number=00003 name=C:\APP\MPYLE\
Recovery Manager: Release 11.1.0.7.0 - Production You can also duplicate and validate your backups of your database. In the
ORADATA\ORADB\UNDOTBS01.DBF Starting Control File and SPFILE Autobackup at
on Fri Aug 28 13:59:11 2009 following examples we have our channel format and type set in our configu-
input datafile file number=00004 name=C:\APP\MPYLE\ 02-NOV-09 ration parameters
Copyright (c) 1982, 2007, Oracle. All rights ORADATA\ORADB\USERS01.DBF piece handle=C:\APP\MPYLE\FLASH_RECOVERY_AREA\
reserved. channel ORA_DISK_1: starting piece 1 at 28-AUG-09 ORADB\AUTOBACKUP\2009_11_02\O1_MF_S_701874632_
channel ORA_DISK_1: finished piece 1 at 28-AUG-09 5GY898N5_.BKP comment=NONE First we restore the datafiles. Database must be started and not mounted.
connected to target database: ORADB piece handle=C:\TEMP\0IKNQQGK_1_1 Finished Control File and SPFILE Autobackup at
(DBID=2448644975) tag=TAG20090828T125652 comment=NONE 02-NOV-09 RMAN> RESTORE database;
RMAN> channel ORA_DISK_1: backup set complete, elapsed
RMAN> Starting restore at 01-SEP-09
time: 00:02:05
Finished backup at 28-AUG-09 using target database control file instead of
RMAN PARAMETERS OPTIONS recovery catalog
Starting Control File and SPFILE Autobackup at
allocated channel: ORA_DISK_1
28-AUG-09 COMPRESSED Compresses the backup as it is taken channel ORA_DISK_1: SID=154 device type=DISK
RMAN parameters can be set to a specified value and remain persistent. piece handle=C:\APP\MPYLE\FLASH_RECOVERY_AREA\
This information is stored in the target databases controlfile. By default, if ORADB\AUTOBACKUP\2009_08_28\O1_MF_S_696085138_ INCREMENTAL Selecting incremental allows to backup only changes channel ORA_DISK_1: starting datafile backup set
you have a flash recovery area set up then RMAN will use this location for 59J36MDF_.BKP comment=NONE since last full backup restore
backups to be stored. Finished Control File and SPFILE Autobackup at channel ORA_DISK_1: specifying datafile(s) to
FORMAT Allows you to specify an alternate location restore from backup set
28-AUG-09
TAG You can name your backup channel ORA_DISK_1: specifying datafile(s) to re-
SHOW Show current values for set parameters RMAN>
store from backup set
MAXSETSIZE Limits backup piece size channel ORA_DISK_1: restoring datafile 00001 to C:\
CONFIGURE Command to set new value for parameter APP\MPYLE\ORADATA\ORADB\SYSTEM01.DBF
Alternatively you can take a cold backup with RMAN as well. First close and
then mount your database. TABLESPACE Allows you to backup only a tablespace channel ORA_DISK_1: restoring datafile 00002 to C:\
RMAN> show all; APP\MPYLE\ORADATA\ORADB\SYSAUX01.DBF
using target database control file instead of RMAN> shutdown immediate; RMAN> backup as compressed backupset database; channel ORA_DISK_1: restoring datafile 00003 to C:\
recovery catalog APP\MPYLE\ORADATA\ORADB\UNDOTBS01.DBF
using target database control file instead of RMAN> Backup INCREMENTAL level=0 database;
RMAN configuration parameters for database with channel ORA_DISK_1: reading from backup piece
recovery catalog RMAN> Backup database TAG=db01;
db_unique_name ORADB are: C:\TEMP\16KNR3I3_1_1.BAK
database closed
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # RMAN> Backup database MAXSETSIZE=2g; channel ORA_DISK_1: piece handle=C:\TEMP\16KNR3I3_
database dismounted
default 1_1.BAK tag=TAG20090828T153115
Oracle instance shut down RMAN> backup TABLESPACE users;
CONFIGURE BACKUP OPTIMIZATION OFF; # default channel ORA_DISK_1: restored backup piece 1
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default channel ORA_DISK_1: restore complete, elapsed time:
CONFIGURE CONTROLFILE AUTOBACKUP ON; RMAN> startup mount; You may also combine options together in a single backup. 00:04:55
connected to target database (not started) channel ORA_DISK_1: starting datafile backup set
Oracle instance started restore
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; RMAN> Backup INCREMENTAL level=1 as COMPRESSED channel ORA_DISK_1: specifying datafile(s) to
database mounted backupset database FORMAT C:\TEMP\%U.BAK
old RMAN configuration parameters: restore from backup set
CONFIGURE CONTROLFILE AUTOBACKUP OFF; Total System Global Area 313860096 bytes maxsetsize 2G; channel ORA_DISK_1: restoring datafile 00004 to C:\
new RMAN configuration parameters: Fixed Size 1347020 bytes APP\MPYLE\ORADATA\ORADB\USERS01.DBF
CONFIGURE CONTROLFILE AUTOBACKUP ON; Variable Size 243270196 bytes channel ORA_DISK_1: reading from backup piece C:\
Database Buffers 62914560 bytes VIEWING YOUR RMAN BACKUPS
new RMAN configuration parameters are successfully TEMP\18KNR3NH_1_1
stored Redo Buffers 6328320 bytes channel ORA_DISK_1: piece handle=C:\TEMP\18KNR3NH_
RMAN> You can review your RMAN backups using the LIST command. You can use
LIST with options to customize what you want RMAN to return to you.