[go: up one dir, main page]

0% found this document useful (0 votes)
400 views4 pages

Duplicate A Database Using RMAN 10g

This document describes how to duplicate an Oracle database using RMAN. It involves: 1) Creating a password file and listener for the duplicate database instance with a different SID; 2) Modifying the TNSNAMES.ORA and listener files to point to the new instance; 3) Creating an init.ora file for the duplicate database that converts file names to avoid conflicts; 4) Connecting to the duplicate instance and creating an SPFILE from the init.ora file; 5) Connecting RMAN to the source database, recovery catalog, and duplicate database; and 6) Using RMAN to duplicate the source database to the state of the duplicate database.
Copyright
© © All Rights Reserved
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)
400 views4 pages

Duplicate A Database Using RMAN 10g

This document describes how to duplicate an Oracle database using RMAN. It involves: 1) Creating a password file and listener for the duplicate database instance with a different SID; 2) Modifying the TNSNAMES.ORA and listener files to point to the new instance; 3) Creating an init.ora file for the duplicate database that converts file names to avoid conflicts; 4) Connecting to the duplicate instance and creating an SPFILE from the init.ora file; 5) Connecting RMAN to the source database, recovery catalog, and duplicate database; and 6) Using RMAN to duplicate the source database to the state of the duplicate database.
Copyright
© © All Rights Reserved
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

Duplicate a Database Using RMAN

Related articles.

Duplicate a Database Using RMAN 10g

A nice feature of RMAN is the ability to duplicate, or clone, a database from a previous
backup. It is possible to create a duplicate database on a remote server with the same file
structure, a remote server will a different file structure or the local server with a different file
structure. In this article I'll demonstrate the last method, how to duplicate a database on the
local server with a different file structure. This can prove useful when you want to recover
selected objects from a backup, rather than roll back a whole database or tablespace.
Create a password file for the duplicate instance.
orapwd file=orapworcl password=manager entries=10
Same password file on both the servers.

Production:
listener :
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(ORACLE_HOME = /data1/oracle10g/oracle/product/10.2.0/db_1)
(SID_NAME = orcl)
)
(SID_DESC =
(GLOBAL_DBNAME = dup)
(ORACLE_HOME = /data1/oracle10g/oracle/product/10.2.0/db_1)
(SID_NAME = dup)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.100.1)(PORT = 1521))
)
)
# Reload listener
lsnrctl reload
TNSNAMES:

ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.100.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
DUP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.100.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = dup)
)
)

CLONE DATABASE:
LISTENER:
LISTENER_DUP =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = node3.domain.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
SID_LIST_LISTENER_DUP =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /data1/oracle10g/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
TNSNAME:

DUP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.100.3)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = dup)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.100.1)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

Create an "init.ora" file for the duplicate database. Since we are duplicating the database
onto the same server as the original we must convert the file names so there is no conflict.
# Minimum Requirement.
DB_NAME=DUP
CONTROL_FILES=(/u02/oradata/DUP/control01.ctl,
/u02/oradata/DUP/control02.ctl,
/u02/oradata/DUP/control03.ctl)
# Convert file names to allow for different directory structure.
DB_FILE_NAME_CONVERT=('/data1/oracle10g/oracle/product/10.2.0/oradata/orcl/','
/data1/oracle10g/oracle/product/10.2.0/oradata/orcl/')
LOG_FILE_NAME_CONVERT=('/data1/oracle10g/oracle/product/10.2.0/oradata/orcl/',
'/data1/oracle10g/oracle/product/10.2.0/oradata/orcl/')
# make sure block_size and compatible parameters
# match if you are not using the default.
DB_BLOCK_SIZE=8192
*.compatible='10.2.0.1.0'

Connect to the duplicate instance.

ORACLE_SID=DUP; export ORACLE_SID


sqlplus /nolog
conn / as sysdba

Create an SPFILE based on the "init.ora" file.


CREATE SPFILE FROM PFILE='/u01/app/oracle/admin/DUP/pfile/init.ora';

TAke RMAN BACK and copy the same on clone server


Start the database in NOMOUNT mode.
STARTUP FORCE NOMOUNT;

With the duplicate database started we can now connect to it from RMAN. For the
duplication to work we must connect to the original database (TARGET), the recovery
catalog (CATALOG) and our duplicate database (AUXILIARY).
ORACLE_SID=DUP; export ORACLE_SID
rman TARGET sys/password@tsh1 CATALOG rman/rman@tshadm AUXILIARY /

We can then dupicate the database using one of the following commands.
# Duplicate database to TARGET's current state.
DUPLICATE TARGET DATABASE TO DUP;
# Duplicate database to TARGET's state 4 days ago.
DUPLICATE TARGET DATABASE TO DUP UNTIL TIME 'SYSDATE-4';

You might also like