Extracting DB files from RMAN using DBMS BACKUP RESTORE - Pt1

There are various articles and blogs available which discuss using DBMS_BACKUP_RESTORE to extract database files from RMAN backuppieces for restores or creating clones or standby databases.

Often they just provide examples on usage, without putting the examples within a given context and they don’t usually compare the commands to those provided by RMAN.  I thought it might be useful to use the commands in a recovery scenario using an 11g R1 database and also show the equivalent RMAN commands for the tasks.

As with many Oracle tools, there are lots of options available with RMAN, so I’ve just tried to pick the options that most closely resemble the work being carried out using DBMS_BACKUP_RESTORE.

Step 1: Log into RMAN  and configure backup options

Before we can attempt a database restore, we need to take a backup.  Amend the details below to fit your own environment and operating system.

The database is in archivelog mode, so I’m able to take a hot backup (i.e. one where the database remains open whilst the backup takes place).
I’m not using an RMAN catalog for this database, just the information in the database controlfile.

set ORACLE_HOME=C:\app\Administrator\product\11.1.0\db_1
rman target / nocatalog

Once logged into RMAN: I then configured the following options. (Make a note of your existing settings before making any changes, by using the SHOW ALL;  command, in case you want to change them back again afterwards).

set the backup to automatically include a backup of the controlfile and spfile


Configure the format for controlfile backuppieces

Set the default device type to be disk


Configure the location for the disk channel to backup the data.


Step 2: Take the RMAN backup

To save on disk space, I’ve asked RMAN to backup the database and archived redo logs to a compressed backupset.


Step 3: Take a copy of the output from the RMAN backup

If you check the logfile from the RMAN backup, you can see which database files went to which RMAN backuppieces.

Starting backup at 31-JAN-09
current log archived

channel ORA_DISK_1: starting compressed archived log backup set

input archived log thread=1 sequence=4 RECID=62 STAMP=677595080

channel ORA_DISK_1: finished piece 1 at 31-JAN-09
piece handle=C:\BACKUP\STRMPRIM\STRMPRIM_0BK66HU9_1_1 tag=TAG20090131T125120 comment=NONE
–The line above shows that the archived redo logs went to the backuppiece C:\BACKUP\STRMPRIM\STRMPRIM_0BK66HU9_1_1

channel ORA_DISK_1: starting compressed full datafile backup set


piece handle=C:\BACKUP\STRMPRIM\STRMPRIM_0CK66HUF_1_1 tag=TAG20090131T125126 comment=NONE
–The line above shows that the datafiles went to the backuppiece C:\BACKUP\STRMPRIM\STRMPRIM_0CK66HUF_1_1
Any tempfiles are not backed up by RMAN, to save on disk space. The tempfiles will be automatically re-created when you open the database.

channel ORA_DISK_1: starting compressed archived log backup set

input archived log thread=1 sequence=5 RECID=64 STAMP=677595104

piece handle=C:\BACKUP\STRMPRIM\STRMPRIM_0DK66HV1_1_1 tag=TAG20090131T125145 comment=NONE
–The line above shows that the archived logs that were backed following the final log switch after the datafiles had been backed up are included within the backuppiece C:\BACKUP\STRMPRIM\STRMPRIM_0DK66HV1_1_1

Starting Control File Autobackup at 31-JAN-09

piece handle=C:\BACKUP\STRMPRIM\CONTROLFILE_C-238154463-20090131-00 comment=NONE
–The line above shows that the controlfile backup is stored within the backuppiece C:\BACKUP\STRMPRIM\CONTROLFILE_C-238154463-20090131-00
(If the database was using an spfile, then it would also have been included in this backuppiece).

The next installment will include Step 4: Check that the backup files have been created successfully & Step 5: Simulate complete loss of the database

2 Responses to “Extracting DB files from RMAN using DBMS BACKUP RESTORE - Pt1”

  1. Extracting DB files from RMAN using DBMS BACKUP RESTORE – Pt1 | Canning IT LTD Says:

    […] Extracting DB files from RMAN using DBMS BACKUP RESTORE – Pt1 […]

  2. Extracting DB files from RMAN using DBMS BACKUP RESTORE – Pt1 | Canning I.T. Limited Says:

    […] Extracting DB files from RMAN using DBMS BACKUP RESTORE – Pt1 […]

Leave a Reply

You must be logged in to post a comment.

Buy Seroquel Butalbital Buy Prozac Buy Meridia Buy Adipex Buy Oxycontin Buy Flexeril Biaxin Buy Flexeril Seroquel Buy Vicodin Online Zithromax Buy Seroquel Buy Phentermine Buy Cialis Lipitor Zithromax Buy Adipex Buy Nexium Acyclovir Vicodin Ultracet Tenuate Buy Viagra Online Buy Effexor Zyrtec Phentermine Online Buy Zyrtec Valium Online Buy Cheap Phentermine Buy Online Xanax Meridia Buy Butalbital Buy Zyprexa Buy Tenuate Buy Lexapro Buy Xanax Buy Lexapro Buy Carisoprodol Buy Phentermine Viagra Buy Xanax Online Levitra Buy Phentermine Buy Tenuate Buy Bontril Buy Line Xanax Buy Ultram Buy Levitra Lortab Buy Generic Viagra Online Xanax Buy Norco Tramadol Online Viagra Online Buy Valium Valium Phentermine Buy Cheap Phentermine Buy Viagra Buy Viagra Online Buy Diazepam Buy Phentermine Online Lorazepam Buy Acyclovir Nexium Norco Adderall Buy Prozac Buy Lorazepam Buy Ultram Paxil Buy Lexapro Buy Oxycontin Buy Acyclovir Cipro Paxil Buy Tramadol Buy Adderall Buy Valium Online Buy Glucophage