facebook twitter youtube facebook facebook facebook

E-Mail : info@askmlabs.com

Phone : +1.215.353.8306

Latest Post

RMAN DUPLICATION FROM TAPE BACKUPS

Written By askMLabs on Monday, July 4, 2011 | 8:53 AM

In the present article i am going to explain how to use RMAN to duplicate database from server A to server B.
I am following the reference note : 388431.1 to perform this activity. The only difference from the reference note id 388431.1 in the present article is that the backups are available on TAPE. The procedure defined in the reference note id is slightly deviated to explain the RMAN duplication precedure if the database backups are on TAPE.

Assumptions Made:
Source Database  : SOURCEDB
Target Database  : TARGETDB
RMAN Catalog SID : RMANCAT
TAPE Configuration : TIVOLI TAPE

STEPS:
  1. Backup the source database SOURCEDB
  2. Calculate the source and target SPACE requirements
  3. Making the TAPE backups of SOURCEDB available to TARGETDB
  4. Creating init.ora and administration directories
  5. Verifying the connections from TARGETDB node
  6. Executing the RMAN duplication scripts.
1. Backup the source database SOURCEDB
Please follow the article how to perform the database tape backups.

2. Calculate the source and target SPACE requirements
Execute the script on SOURCEDB and calculate the SIZE of database.
SQL> select DF.TOTAL/1048576 "DataFile Size Mb",
LOG.TOTAL/1048576 "Redo Log Size Mb",
CONTROL.TOTAL/1048576 "Control File Size Mb",
(DF.TOTAL + LOG.TOTAL + CONTROL.TOTAL)/1048576 "Total Size Mb"
from dual,
(select sum(a.bytes) TOTAL from dba_data_files a) DF,
(select sum(b.bytes) TOTAL from v$log b) LOG,
(select sum((cffsz+1)*cfbsz) TOTAL from x$kcccf c) CONTROL;

If you need the database size with all tablespace sizes, please check the script here.

On the target database node(HOST B), verify the disk space using linux command "df -h"

Compare the results of SOURCEDB size and disk space on target node ( HOST B) and ensure you have enough diskspace for your duplicate database.

3. Making the TAPE backups of SOURCEDB available to TARGETDB
Copy the tdpo.opt file from HOST A to HOST B. Place this in any temporary location say  "/tmp/askm".

Copy the TSM password file from HOST A to HOST B and place it in the same location as "/tmp/askm". Make sure the file has proper read write permissions.

Modify this tdpo.opt file and change the password location on HOST B as in:

TDPO_PSWDPATH      /tmp/askm

NOTE : Execute "tdpoconf showenvironment" on HOST A to know the tdpo.opt and password file locations

4. Creating init.ora and administration directories
Copy the SOURCEDB pfile from HOST A to HOST B and modify the DB_NAME , control_file and Dump file locations as per the directory structure on HOST B. Make sure to create DUMP directories on target host HOST B.
Add following two parameter to init.ora on HOST B to reflect the directory structure modification from SOURCEDB to TARGETDB.
db_file_name_convert =("/u01/app/oradata/SOURCEDB/", "/u01/app/oradata/TARGETDB/")
log_file_name_convert =("/u01/app/oradata/SOURCEDB/", "/u01/app/oradata/TARGETDB/")
Modify the undo_tablespace value to be same as the SOURCEDB undo_tablespace value.

( Please refer to note ID : 388431.1, for more details how to prepare init.ora file on target host B)

5. Verifying the connections from TARGETDB node
Verify the sql*net connection to SOURCEDB from HOST B.
$ sqlplus 'sys/oracle@SOURCEDB as sysdba'
If it is not working , please perform the following tasks ..
Modify the tnsnames.ora file on HOST B and add tns entries for SOURCEDB. And execute "tnsping SOURCEDB" on HOST B. It should successfully resolve the connection.
Create  password file for remote database connections on HOST A using following command...
orapwd file=orapwSOURCEDB password=oracle entries=5
Now check the sqlplus connection to SOURCEDB again from HOST B.

Verify the rman connections using
sqlplus rman/rman@rmancat

6.  Executing the RMAN duplication script.
Connect to rman and execute the RMAN duplicate script on HOST B.

NOTE : Make sure the TARGETDB is in nomount stage and SOURCEDB is up and running.
$ export ORACLE_SID=TARGETDB
$ rman target sys/oracle@SOURCEDB catalog rman/rman@rmancat auxiliary /
RMAN> run {
# Recovery Time
#set until time 'MON DD YYYY HH:MI:SS';
# Allocate Channels to Tape
configure auxiliary channel 1 device type sbt parms="ENV=(TDPO_OPTFILE=/tmp/askm/tdpo.opt)";
# Issue the duplicate command
DUPLICATE TARGET DATABASE TO TARGETDB
# Create online redo log groups
LOGFILE
GROUP 1 (
'/u01/app/oradata/TARGETDB/redolog1a.log',
'/u01/app/oradata/TARGETDB/redolog1b.log'
) SIZE 50M,
GROUP 2 (
'/u01/app/oradata/TARGETDB/redolog2a.log',
'/u01/app/oradata/TARGETDB/redolog2b.log'
) SIZE 50M,
GROUP 3 (
'/u01/app/oradata/TARGETDB/redolog3a.log',
'/u01/app/oradata/TARGETDB/redolog3b.log'
) SIZE 50M,
GROUP 4 (
'/u01/app/oradata/TARGETDB/redolog4a.log',
'/u01/app/oradata/TARGETDB/redolog4b.log'
) SIZE 50M;
}

Follow the video demo for the visual presenation of the above procedure. This is a private video so, send me a personal request if you need access to this video.





HOPE IT HELPS
SRI
 
Support :
Copyright © 2013. askMLabs - All Rights Reserved
Proudly powered by Blogger