Restoring an Oracle RMAN Backup to Different Server

No GoodNeed ImprovementOKGoodExcellent (9 votes, average: 3.56 out of 5)
Loading ... Loading ...

Example
——–
Restore RMAN backup from CRM production server on us01ap17 to test server on test_us01ap17

The example assumes:

- the target database is on us01ap17
- the database is to be restored onto test_us01ap17
- the RMAN catalog is installed on us01ap19.
- the directory structure of test_us01ap17 is the same as us01ap17
- the ORACLE_SID will not change for the restored database
- a recovery catalog is being used
- the backups were carried out to disk (for illustrative purposes, and to disassociate from any media manager specific issues)

The following steps are required:

- backup the target on us01ap17
- list the datafile locations on us01ap17
- make the backup available to test_us01ap17
- make a copy of the init.ora available to test_us01ap17
- if directory structure is different, edit the init.ora to reflect directory structure changes
- configure SQL*Net connectivity from host to the recovery catalog and duplicated database
- set up a password file for the duplicated database
- startup nomount the duplicated database
- RMAN restore the controlfile(s)
- mount the database
- restore and rename the datafiles
- recover and open the database

These steps are expanded further below.

1.0 Create Database on test_us01ap17
1.1 Install Oracle database using CD or downloaded files from Oracle
1.2 Ceate Oracle service

oradim -new -sid CRM -intpwd change_on_install -maxusers 20 -startmode auto

1.3 Check to see if password file was created, if not, create using the following command

orapwd file=C:\oracle\ora92\database\PWDCRM.ora password=change_on_install entries=30

1.4 Create spfile

sqlplus /nolog
connect sys/change_on_install@CRM as sysdba
shutdown immediate;
create spfile from pfile=’C:\oracle\admin92\CRM\pfile\initCRM.ora’;
exit;

2.0 Backup the Production database on us01ap17
———————————————-

The target database needs to be backed up using RMAN.
The following is one example of RMAN doing an online database backup. In this example, the backup sets (full hot backup) are written to disk.

First, create a windows batch file, fullbackup.bat

rman catalog rmanager/rmanager@rman target sys/change_on_install@CRM cmdfile=C:\Oracle\job\rman_scripts\rman_full_backup.txt log=C:\Oracle\job\rman_logs\%date:~10,4%_%date:~4,2%_%date:~7,2%_log.txt

Then, create a RMAN script file rman_full_backup.txt

run
{
resync catalog;
allocate channel ch1 device type disk format ‘H:\Rman_backup\%d_%u_%s_%p’;
allocate channel ch2 device type disk format ‘H:\Rman_backup\%d_%u_%s_%p’;
allocate channel ch3 device type disk format ‘H:\Rman_backup\%d_%u_%s_%p’;
#BACKUP INCREMENTAL LEVEL 0 tag = ‘weekly full backup’ database filesperset 1 include current controlfile;
backup incremental level 0 tag = ‘full_hot_backup’ ( database setsize 8192000 filesperset 1 include current controlfile );
sql ‘alter system switch logfile’;
sql ‘alter system archive log current’;
BACKUP filesperset 1 archivelog all delete input;
release channel ch1;
release channel ch2;
release channel ch3;
}

Run the batch script and you will find backup files in H:\Rman_backup

Popularity: 21%

Pages: 1 2 3 4 5

2 Comments »

  1. Ravi said,

    January 22, 2008 @ 2:34 am

    How to restore?

  2. pepe said,

    March 7, 2008 @ 5:30 am

    no comment

RSS feed for comments on this post · TrackBack URI

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word