Oracle Technologies Blog

By ASKM

RMAN DUPLICATION FROM TAPE BACKUPS

Posted by Srikrishna Murthy Annam on July 4, 2011

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

Advertisements

32 Responses to “RMAN DUPLICATION FROM TAPE BACKUPS”

  1. Amit said

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

  2. learnwithme11g said

    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/

  3. Mayank said

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

  4. learnwithme11g said

    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

  5. Kamal Ahmed Mohammed said

    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

  6. Kamal Ahmed Mohammed said

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

  7. learnwithme11g said

    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

  8. Kamal Ahmed Mohammed said

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

    Please advise.

  9. Suad Adrovic said

    Can you please give me access to the video.

  10. learnwithme11g said

    you are given access to this video now.

  11. Suad Adrovic said

    Thank you!!!!

  12. Suad Adrovic said

    I still can’t see the videos!?

  13. Suad Adrovic said

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

    Thank you.

  14. samz said

    Hi Sri

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

    Thanks in Advance.
    Samz

  15. Kamal Ahmed Mohammed said

    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

  16. Sumer said

    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

  17. samz said

    Hi Sri

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

    Thanks in Advance.
    Samz

  18. sarat said

    Can you please provide me access for the above videos.

    Thanks
    Sarat

  19. learnwithme11g said

    Hi Sarat, You are given access to these videos.

  20. Sanjay said

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

  21. Sanjay said

    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.

  22. Rama said

    Can I have access to the video

  23. sreeraj said

    Hi Sri,

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

    -Sreeraj

  24. Srikrishna Murthy Annam said

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

  25. Ahmed Adel said

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

  26. Srikrishna Murthy Annam said

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

  27. Rama said

    Can I have access to the video please

  28. yatin said

    hi

    Shri

    above is the great explanation

    can you please share video for the same with me

  29. Kishore said

    Please give me access to these Videos…Thanks in Advance

  30. Carlos said

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

  31. Priya said

    Thanks for the Steps!
    Wonder if i can have access to the Videos!

    Regards

  32. kamesh said

    hi Sri,,

    please give me the access to the above videos,,i have similiar requirement

    kameshpirate@gmail.com

    thanks

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: