Clone database without backup 11gR2

Here are the majority of the steps for creating a clone 11gR2 database.

1. Either configure your listener under the ORACLE_HOME for the standby (typically using NETCA) or if you are using 11gR2 RAC, you can use the Grid Infrastructure listener.ora to add your entries.  Configure listener.ora with your clone SID and reload listener.
(example)
SID_LIST_LISTENER =
    (SID_DESC =
      (GLOBAL_DBNAME = clone)
      (SID_NAME = clone)
      (ORACLE_HOME = <ORACLE_HOME>)
    )
  )
    lsnrctl reload LISTENER


3. Modify tnsnames.ora in $TNS_ADMIN on both primary and standby locations to include both your standby database TNS entry and the primary database TNS entry. 

 (example)

    clone =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = < standby_hostname>)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = clone)
    )
  )
trgtdb =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <primary_hostname>)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = trgtdb)
    )
  )

4.  Test connectivity both ways between both db instances via tnsping.
(example)
     tnsping clone
     tnsping trgtdb

5.  Pre-create your directory structure for the standby database under the $ORACLE_BASE/admin.
(example)
    mkdir -p $ORACLE_BASE/admin/clone/adump

6.  Copy oracle password file from production to your standby server under $ORACLE_HOME/dbs, also create dummy parameter file for auxiliary instance.

scp <target_host_name>:orapwtrgtdb $ORACLE_HOME/dbs/orapwclone
echo "db_name=clone" > $ORACLE_HOME/dbs/initclone.ora
echo "memory_target=<primary_memory_target>" >> $ORACLE_HOME/dbs/initclone.ora

7.  Create clone.cmd file for RMAN to build out the clone database across the network.
(example)


connect target sys/oracle@trgtdb;
connect auxiliary sys/oracle@clone;
run {
allocate channel prm1 type disk;
allocate channel prm2 type disk;
allocate channel prm3 type disk;
allocate channel prm4 type disk;
allocate auxiliary channel stb1 type disk;
duplicate target database to "clone" from active database
spfile
PARAMETER_VALUE_CONVERT '/trgtdb/','/clone/'
set 'db_unique_name'='clone'
set 'control_files'='+DATA'
set db_create_file_dest='+DATA'
set db_create_online_log_dest_1='+DATA'
set db_recovery_file_dest='+FRA'
set db_recovery_file_dest_size='15G'
set cluster_database='FALSE'
set instance_number='1'
nofilenamecheck;
}


8.  Startup the instance in NOMOUNT state and then start the RMAN duplicate job.
(example)
            SQL>  startup nomount
     SQL>  exit
     nohup rman cmdfile clone.cmd log clone.log &



9. After the clone is completed, the clone instance should be now open read/write.

SQL*Plus: Release 11.2.0.1.0 Production on Wed May 11 13:38:55 2011

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
clone

Comments

Popular posts from this blog

RMAN-10038: database session for channel prm3 terminated unexpectedly

ORA-17630: Mismatch in the remote file protocol version client 2 server 3

ORA-00338: log {n} of thread {n} is more recent than control file