Oracle - Restoring RAW tablespaces using Netbackup


DB - Oracle 9
OS - AIX
Tools - Netbackup

We have a 9i database which acts as a BCV and kept in read only mode.
As per our client agreements we need to do restoration testing for each of the database in every 3 months time.
Below is the process we used when restoring raw device based read only database (With Stand by Control file) using netbackup.

Step 1- Restore oracle home to target database and do the needed changes in parameter file accordingly
Restore the oracle home to target server (If you have same oracle_home as the source in target already this is not required).
Then edit the parameter file accordingly. Follow (http://dbtechno.blogspot.com/2012/11/restore-rman-full-backup-on-different.html - step3)
Then mount the database.
 SQL>alter database mount standby database  
Standby since we are using a standby control file.

Step 2 – Create required raw devices in target host
Here you need to identify the required tablespaces/logs you are going to restore and the corresponding devices for them and sizes.
In this case we will only restore system and undo table spaces.
So from primary find the raw devices corresponding to  these table spaces.
Img - 1

This show the links that are pointing to the devices. Then login to Netbackup console and find the backup files and there sizes.
As an example below screen shot shows required raw devices for above datafiles and logfiles.
According to size of the device we can create the new devices in target server.
Note – In netbackup console you need to select Restore type- “Raw Partition Backups” in order to see the raw devices.
Img - 2

Below are the commands for creating these raw devices. You will need enough space in the corresponding volume group
 mklv -t raw -u 2 -L adm_system01 -y adm_system01 datavg 1200M   
 mklv -t raw -u 2 -L adm_rbs01 -y adm_rbs01 datavg 5300M   
 mklv -t raw -u 2 -L adm_rbs01 -y adm_rbs01 datavg 5300M   
 mklv -t raw -u 2 -L adm_rbs01 -y adm_rbs01 datavg 2300M   
 mklv -t raw -u 2 -L admredolog1 -y admredolog1 datavg 700M   
 mklv -t raw -u 2 -L admredolog2 -y admredolog2 datavg 700M   
 mklv -t raw -u 2 -L admredolog3 -y admredolog3 datavg 700M   
 mklv -t raw -u 2 -L admredolog4 -y admredolog4 datavg 700M   
 mklv -t raw -u 2 -L admredolog5 -y admredolog5 datavg 700M  

Img - 3


Step 3 – Restore link files to target server
When you use raw devices there are links which are pointing to these devices. In this step we will restore these links to target.
From Img-1 we can see that the links for required files are there in /adm/datalink folder in source host.
It is easy to  create the same location in target host as well, and do the restoration to same location.
Img - 4


Note – To restore the links it is required to select Restore type- “Normal Backups”
Since we are restoring all the links before opening the database it is required to offline drop the datafiles that are we are not restoring. In this case all other than system and undo. Follow (http://dbtechno.blogspot.com/2012/11/restore-rman-full-backup-on-different.html - step 9)

Step 4 – Restore RAW devices

If all the above steps are completed the just the restoration of raw devices required.
As in Img-2 select the required raw device backups and just hit restore in Netbackup console.

Step 5 – Open the database

After restoration is completed open the database as read only.
 SQL>alter database open read only;  

Comments

Popular posts from this blog

ORA-16433: The database or pluggable database must be opened in read/write

Oracle Multitenant - Create new service for PDB using DBMS_SERVICE

Wait for unread message on broadcast channel - Blocking Sessions