Wednesday, 10 July 2013

Active cloning in 11gr2 (Using RMAN DUPLICATE command)

Active Database cloning

Oracle 11g introduced the ability to create duplicate databases directly without the need for a backup. This is known as active database duplication. The process is similar to the backup-based duplication, with a few exceptions.
First, and most obviously, you don't need a backup of the source system, but it does have to be in ARCHIVELOG mode.

->The passwords in the password files must match for both servers, so remember to set the correct password when creating the password file on the destination server. or copy the source password file to destination 

$scp orapwdorcl oracle@192.168.152.131:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwclone

Both the source and destination database servers require a "tnsnames.ora" entry in the destination server.

-configure the tnsnames.ora on destination server for both the clone and server.

$vi tnsnames.ora

clone =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.131)(PORT = 1521))
    )
    (CONNECT_DATA =
      (ORACLE_SID = clone)
    (UR=A)
    )
  )

orcl =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.132)(PORT = 1521))
    )
    (CONNECT_DATA =
      (ORACLE_SID = orcl)
    (UR=A)
    )
  )


In the destination server requires static listener configuration in a "listener.ora" file.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = clone)
      (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
      (SID_NAME = clone)
    )
  )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.152.132)(PORT = 1521))
    )
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )

ADR_BASE_LISTENER = /u01/app/oracle

In clone server when connecting to RMAN, you must use a connect string for both the target and auxiliary connections.

$vi /etc/oratab

clone:/u01/app/oracle/product/11.2.0/dbhome_1:N

:wq 

$export ORACLE_SID=clone
$export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
$export PATH=$PATH:$ORACLE_HOME/bin

$rman TARGET sys/password@orcl AUXILIARY sys/password@clone

Include the FROM ACTIVE DATABASE clause in the DUPLICATE command


RMAN>DUPLICATE DATABASE TO DB11G FROM ACTIVE DATABASE



No comments:

Post a Comment