0% found this document useful (0 votes)
328 views

Cloning A Oracle Database Using RMAN

RMAN cloning oracle
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
328 views

Cloning A Oracle Database Using RMAN

RMAN cloning oracle
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Cloning a Oracle database using RMAN

Assumptions:

The source database is PROD

The target database (duplicate DB to be created) is DUP

The catalog database is CATDB

The source DB is in ARCHIVELOG mode

The latest RMAN backup for the source DB is available.

The following steps will clone the source database PROD to duplicate database DUP using the RMAN
through catalog database CATDB

1.0 Prepare the password file for the DUP database.

Under the $ORALE_HOME/dbs directory, create the password file as:

$ orapwd file=$ORACLE_HOME/dbs/orapw<duplicateDB_SID>.ora

password=<Password_for_sys> entries=<number>

Example:

$ orapwd file=/app/oracle/product/10.2.0/db/dbs/orapwDUP.ora password=oracle entries=10

2.0 Make the entries for the database DUP in listener.ora and tnsnames.ora file

# added to the listener.ora SID_LIST


(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/9.2.0.1.0)
(SID_NAME = DUP)
)
# added to the tnsnames.ora
DUP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = server1.tshcomputing.com)(PORT = 1521))
)
(CONNECT_DATA =
(ORACLE_SID = DUP)
)
)

3.0 Prepare a parameter file (init<duplicateDB_SID>.ora)for the DUP database:

3.0.1 Copy the source DB parameter file as init<duplicateDB_SID>.ora

$ cd $ORACLE_HOME/dbs

$ cp init<sourceDB_SID> init<duplicateDB_SID>
Example:
$ cp initPROD.ora initDUP.ora

3.0.2 Make the following changes in init<duplicateDB_SID>.ora file

DB_NAME=<duplicateDB_SID>

Example:

DB_NAME=DUP

CONTROL_FILES=<location1>, <location2>, ……..

Example:

CONTROL_FILES=’/oradata/DUP/cotrol01.ctl’, ‘/oradata/DUP/control02.ctl’

DB_FILE_NAME_CONVERT=’old1’,’new1’,’old2’,’new2’…….

Example:

DB_FILE_NAME_CONVERT=’/oradata/PROD/’,’/oradata/DUP/’
LOG_FILE_NAME_CONVERT=’old1’,’new1’, old2’,’new2’……

Example:

LOG_FILE_NAME_CONVERT=’/oradata/log/PROD/’, ’/oradata/log/DUP/’

core_dump_dest=<new location>

Example:

core_dump_dest=/app/oracle/admin/cdump

user_dump_dest=<new location>

Example:

user_dump_dest=/app/oracle/admin/udump

background_dump_dest=<new location>

Example:

background_dump_dest=/app/oracle/admin/bdump

4.0 Create the file structure (directories) as per the new locations specified in the init.ora file

Example:
$ mkdir /app/oracle/admin/cdump
$ mkdir /app/oracle/admin/udump
$ mkdir /app/oracle/admin/udump

5.0 Set the new SID as the environment variable

export ORACLE_SID=<duplicateDB_SID>
Example:
$ export ORACLE_SID=DUP

6.0 Create the spfile from the pfile for the new duplicate database (DUP)

$ sqlplus “/as sysdba”


SQL> create spfile from pfile=’location for init<duplicated_SID>.ora’

Example:
$ sqlplus “/as sysdba”
SQL> create spfile from pfile=’/app/oracle/product/10.2.0/db/dbs/initDUP.ora’;

7.0 Startup the duplicate database (DUP) in NOMOUNT state

SQL> startup force nomount;

8.0 Connect to RMAN using target, catalog and auxiliary command

$ rman target username/pwd@<sourceDB_SID>


RMAN> connect catalog username/pwd@<catalogDB_SID>
RMAN>connect auxiliary username/password@<duplicateDB_SID>

Example:
$ rman target sys/oracle@PROD
RMAN> connect catalog catalog_owner/oracle@CATDB
RMAN>connect auxiliary sys/oracle@DUP

Note: The password for <duplicateDB_SID> is the one that was specified in the password file in step 1.

9.0 Issue the DUPLICATE command to create the clone DB

RMAN> DUPLICATE TARGET DATABASE TO <duplicateDB_SID>

Example:
RMAN> DUPLICATE TARGET DATABASE TO DUP

The new duplicate database will be created and opened in READ_WRITE mode.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy