Monday, December 8, 2014

Db clone Using RMAN

Database clone using RMAN Duplicate command :
======================================
Cretae auxiliary database service using : oradim
-------------------------------------------------------------------
oradim -new -sid aux1 -intpwd sys

Create password file for new auxiliary database :
---------------------------------------------------------------------
orapwd file=orapwdaux1 password=sys force=y

Cretae required folders for udump,bdump,cdump

Configure Listener service and tnsnames.ora for new database :
=============================================
Listener.ora file :
==============
# listener.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\network\admin\listener.ora
# Generated by Oracle configuration tools.

CATALOG =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = home-fe38bc8de0)(PORT = 1522))
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = F:\oracle\product\10.2.0\db_1)
(PROGRAM = extproc)
)
)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = home-fe38bc8de0)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)

AUX1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = home-fe38bc8de0)(PORT = 1523))
)
)


Tnsnames.ora :
===========
# tnsnames.ora Network Configuration File: F:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

CATALOG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = home-fe38bc8de0)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = catalog)
)
)

AUX1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = home-fe38bc8de0)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = aux1)
)
)

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = home-fe38bc8de0)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = orcl)
(PRESENTATION = RO)
)
)


Cretae pfile for new auxialry database.update the correct path for auxiliary database.

Use :
====
db_file_name_convert='F:\oracle\product\10.2.0\oradata\orcl\','F:\oracle\product\10.2.0\oradata\aux1\'
log_file_name_convert='F:\oracle\product\10.2.0\oradata\orcl\','F:\oracle\product\10.2.0\oradata\aux1\'

and start the auxiliary database innomount state using new pfile.

Take the full backup of source database ; and copy them to auxiliary database device if source and clone databases are differenet in this case sorce and clone databases are in same device .
==========================
rman catalog rman/rman@catalog target sys/sys@orcl
configure chaneel 1 device type disk format 'F:\oracle\product\10.2.0\oradata\rmanbackup/%u';
backup database plus archivelog skip inaccessible;
backup as compressed backupset database;


Duplicate auxiliary database :
===============================
set ORACLE_SID=aux1
rman catalog rman/rman@catalog target sys/sys@orcl auxiliary sys/sys
configure auxiliary channel 1 device type disk format 'F:\oracle\product\10.2.0\oradata\aux1\';
connected to target database: ORCL (DBID=1218670140)
connected to recovery catalog database
connected to auxiliary database: AUX1 (not mounted)

duplicate target database to "AUX1";

No comments:

Post a Comment

Followers