facebook twitter youtube facebook facebook facebook

E-Mail : info@askmlabs.com

Phone : +1.215.353.8306

Home » , , , , » RMAN DUPLICATION FROM TAPE BACKUPS

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
Share this article :

Related Articles By Category



+ comments + 30 comments

Amit
August 8, 2011 at 3:26 PM

what editor are u using ? the commands look beautifully formatted, can i have the editor name u are using.

learnwithme11g
August 27, 2011 at 6:10 PM

Please go through the following link. You will be able to use the same format. There are many option instead to use. Its your choice now .. :-)
http://en.support.wordpress.com/code/posting-source-code/

Mayank
September 2, 2011 at 8:30 AM

Please send me contact detail , so i can personally contact you to access above private video

learnwithme11g
September 7, 2011 at 7:24 AM

Hi Singh,
You are given access to these videos. You will have this access for next three days. Thanks for your interest in this.
Thanks
SRI

Kamal Ahmed Mohammed
November 2, 2011 at 11:19 AM

Hi SRI,

Can i please have access to this video as i am trying to do the same thing which you are explaining but failing miserably.

Thanks
Kamal

Kamal Ahmed Mohammed
November 3, 2011 at 7:13 AM

Please provide access to this video since i have the same issue of restoring using TSM and duplicating the database.

learnwithme11g
November 3, 2011 at 4:05 PM

Hi Ahmed,
You are given access to these videos. You will have this access for next three days. Thanks for your interest to this article.
Thanks
SRI

Kamal Ahmed Mohammed
November 21, 2011 at 12:00 PM

Thanks SRI for the access but for some reason i was unable to view the videos on youtube.

Please advise.

Suad Adrovic
November 24, 2011 at 2:31 PM

Can you please give me access to the video.

learnwithme11g
December 6, 2011 at 5:56 AM

you are given access to this video now.

Suad Adrovic
December 6, 2011 at 3:32 PM

Thank you!!!!

Suad Adrovic
December 6, 2011 at 3:36 PM

I still can't see the videos!?

Suad Adrovic
December 8, 2011 at 10:16 AM

Please can you give me access to the video. My mail is suadhm@gmail.com

Thank you.

samz
December 26, 2011 at 4:53 PM

Hi Sri

Could you please give me the access of these videos as well.

Thanks in Advance.
Samz

Kamal Ahmed Mohammed
December 27, 2011 at 5:45 AM

Hi Sri,
Can i have access to the video again as i was unable to check it the last time.

Thanks for the help in advance.
Kamal

Sumer
May 6, 2012 at 3:39 PM

Hi Sri,

The document is really nice and helpful to understand the db clone with DUPLICATE command ...

Can i have access to the video...

Thanks for the help in advance.

Thanks!
sumer

samz
June 19, 2012 at 7:23 AM

Hi Sri

Could you please give me the access of these videos as well.

Thanks in Advance.
Samz

sarat
July 28, 2012 at 3:25 AM

Can you please provide me access for the above videos.

Thanks
Sarat

learnwithme11g
August 15, 2012 at 7:10 AM

Hi Sarat, You are given access to these videos.

Sanjay
August 24, 2012 at 6:40 AM

Can you please provide me access for the above videos.
Sanjay

Sanjay
September 9, 2012 at 7:52 PM

I would like if you add the details for the dsm.sys file which contain the info of all tsm server , if the target and aux database are different TSM server.

Rama
March 9, 2013 at 10:01 PM

Can I have access to the video

sreeraj
April 27, 2013 at 5:30 PM

Hi Sri,

Thanks for the share. Could you please give access to this vedio?

-Sreeraj

Srikrishna Murthy Annam
April 28, 2013 at 5:28 AM

Hi Sree Raj, You are given access to the video. Thanks SRI

May 5, 2013 at 9:58 PM

Hi can i have acces on this vedio i need it please

Srikrishna Murthy Annam
May 11, 2013 at 11:00 AM

Hi Ahmed, Please provide me gmail id to add you to the list.

Rama
May 15, 2013 at 12:54 AM

Can I have access to the video please

yatin
June 23, 2013 at 4:20 PM

hi

Shri

above is the great explanation

can you please share video for the same with me

Kishore
July 8, 2013 at 4:06 AM

Please give me access to these Videos...Thanks in Advance

Carlos
August 27, 2013 at 12:39 AM

THanks a lot . Is it possible to get access to the videio

Post a Comment

Thank you for visiting our site and leaving your valuable comment.

 
Support :
Copyright © 2013. askMLabs - All Rights Reserved
Proudly powered by Blogger