Example With Video & Steps By Step
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
##Active Database Duplication##
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
*************************************
Host : source.localdomain (192.168.56.101)
DB_NAME : prod
File-System : /disk01, /FRA
Clone Database Information
***********************************
Host : target.localdomain (192.168.56.102)
DB_NAME : test
File-System : /disk02, /FRA
=====================================================
Basic pre-check before deploying Active Clone database server.
---------------------------------------------------------------------------------------------
(i) Primary Server, Instance, Databases details.
**********************************************************
NAME INSTANCE_NAME HOST_NAME DATABASE_ROLE LOG_MODE LOGINS OPEN_MODE STARTUP_TIME VERSION
--------- ---------------- -------------------- -------------------- --------------- ---------- --------------- -------------------- -----------
PROD prod source.localdomain PRIMARY ARCHIVELOG ALLOWED READ WRITE 2017:07:26 13:20:46 11.2.0.4.0
(ii) File-System Details of Primary Side.
************************************************
[oracle@source /]$ df -h /disk01
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_source-lv_root
86G 13G 69G 16% /
[oracle@source ~]$ df -h /FRA
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_source-lv_root
86G 13G 69G 16% /
(iii) Archive log Should be enable & Flash Recovery Area Details.
*******************************************************************************
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 6
Next log sequence to archive 8
Current log sequence 8
SQL> show parameter recovery
NAME TYPE VALUE
------------------------------------ ----------- -----------
db_recovery_file_dest string /FRA/prod
db_recovery_file_dest_size big integer 4182M
recovery_parallelism integer 0
(iv) check whether Source server pinging to Target Server.
**********************************************************************
[oracle@source ~]$ ping 192.168.56.102
PING 192.168.56.102 (192.168.56.102) 56(84) bytes of data.
64 bytes from 192.168.56.102: icmp_seq=1 ttl=64 time=0.294 ms
64 bytes from 192.168.56.102: icmp_seq=2 ttl=64 time=0.502 ms
64 bytes from 192.168.56.102: icmp_seq=3 ttl=64 time=0.502 ms
64 bytes from 192.168.56.102: icmp_seq=4 ttl=64 time=0.577 ms
^C
--- 192.168.56.102 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3089ms
rtt min/avg/max/mdev = 0.294/0.468/0.577/0.108 ms
(v) Check whether Target server pinging to Source Server.
**********************************************************************
[oracle@target ~]$ ping 192.168.56.101
PING 192.168.56.101 (192.168.56.101) 56(84) bytes of data.
64 bytes from 192.168.56.101: icmp_seq=1 ttl=64 time=0.148 ms
64 bytes from 192.168.56.101: icmp_seq=2 ttl=64 time=0.298 ms
64 bytes from 192.168.56.101: icmp_seq=3 ttl=64 time=0.719 ms
64 bytes from 192.168.56.101: icmp_seq=4 ttl=64 time=0.294 ms
^C
--- 192.168.56.101 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3349ms
rtt min/avg/max/mdev = 0.148/0.364/0.719/0.214 ms
(vi) File-System Details of Target Side.
**********************************************
[oracle@target ~]$ df -h /disk02
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_target-lv_root
86G 14G 68G 17% /
[oracle@target ~]$ df -h /FRA
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_target-lv_root
86G 14G 68G 17% /
$$$$$$$$$$$$$$$$$$$$$$$$$$$
##Activity On Source Site##
$$$$$$$$$$$$$$$$$$$$$$$$$$$
Step: 1
===============================================================
Go to the dbs location & tranfer password file to target site ( @Source Site).
--------------------------------------------------------------------------------------------------------------
[oracle@source ~]$ cd $ORACLE_HOME/dbs
[oracle@source dbs]$ ls -lrth
total 20K
-rw-r--r--. 1 oracle oinstall 2.8K May 15 2009 init.ora
-rw-r-----. 1 oracle oinstall 24 Jul 26 12:46 lkPROD
-rw-r-----. 1 oracle oinstall 1.5K Jul 26 12:48 orapwprod
-rw-rw----. 1 oracle oinstall 1.6K Jul 26 13:21 hc_prod.dat
-rw-r-----. 1 oracle oinstall 2.5K Jul 26 13:22 spfileprod.ora
[oracle@source dbs]$ scp orapwprod oracle@192.168.56.102:/u01/app/oracle/product/11.2.0/db_1/dbs/
The authenticity of host '192.168.56.102 (192.168.56.102)' can't be established.
RSA key fingerprint is 8b:e1:39:d2:4b:e8:84:16:90:d9:75:02:c2:07:0b:84.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.56.102' (RSA) to the list of known hosts.
oracle@192.168.56.102's password:
orapwprod 100% 1536 1.5KB/s 00:00
Step: 2
============================================================================
Go to the oracle network location & modifiy listener to make static listener ( @Source Site).
-------------------------------------------------------------------------------------------------------------------------------------
[oracle@source dbs]$ cd $ORACLE_HOME/network/admin
[oracle@source admin]$ ls -lrth
total 20K
-rw-r--r--. 1 oracle oinstall 381 Dec 17 2012 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4.0K Jul 26 12:37 samples
-rw-r--r--. 1 oracle oinstall 219 Jul 26 12:44 sqlnet.ora
-rw-r--r--. 1 oracle oinstall 379 Jul 26 12:44 listener.ora
-rw-r-----. 1 oracle oinstall 345 Jul 26 12:47 tnsnames.ora
[oracle@source admin]$ Vi listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = prod)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
:wq
Step: 3
=======================================================
Check listener current status, stop & start it again ( @Source Site).
-----------------------------------------------------------------------------------------------
[oracle@source admin]$ lsnrctl status
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-JUL-2017 13:44:02
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 26-JUL-2017 12:44:08
Uptime 0 days 0 hr. 59 min. 53 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/source/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=source.localdomain)(PORT=1521)))
Services Summary...
Service "prod.localdomain" has 1 instance(s).
Instance "prod", status READY, has 1 handler(s) for this service...
Service "prodXDB.localdomain" has 1 instance(s).
Instance "prod", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@source admin]$ lsnrctl stop
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-JUL-2017 13:44:18
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
The command completed successfully
[oracle@source admin]$ lsnrctl start
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-JUL-2017 13:44:33
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/source/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 26-JUL-2017 13:44:33
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/source/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.101)(PORT=1521)))
Services Summary...
Service "prod.localdomain" has 1 instance(s).
Instance "prod", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@source admin]$
Step: 4
====================================================================================
Go to the oracle network location & modifiy tnsname file entries to ping static listener ( @Source Site).
---------------------------------------------------------------------------------------------------------------------------------------------------
[oracle@source admin]$ ls -lrth
total 20K
-rw-r--r--. 1 oracle oinstall 381 Dec 17 2012 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4.0K Jul 26 12:37 samples
-rw-r--r--. 1 oracle oinstall 219 Jul 26 12:44 sqlnet.ora
-rw-r-----. 1 oracle oinstall 345 Jul 26 12:47 tnsnames.ora
-rw-r--r--. 1 oracle oinstall 557 Jul 26 13:43 listener.ora
[oracle@source admin]$ vi tnsname.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
PROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = prod)
)
)
TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.102)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
)
)
$$$$$$$$$$$$$$$$$$$$$$$$$$$
##Activity On Target Site##
$$$$$$$$$$$$$$$$$$$$$$$$$$$
Step: 5
============================================
Make some directory on target server ( @Target Site).
---------------------------------------------------------------------------
[oracle@target ~]$ mkdir -p /disk02/test
[oracle@target ~]$ mkdir -p /FRA/test
[oracle@target ~]$ mkdir -p /u01/app/oracle/admin/test/adump
Step: 6
==========================================================================================
Rename tranfered password file for clone database's name & create init file for clone startup in nomount. ( @Target Site).
------------------------------------------------------------------------------------------------------------------------------------------------------------
[oracle@target test]$ cd $ORACLE_HOME/dbs
[oracle@target dbs]$ ls -lrth
total 24K
-rw-r--r--. 1 oracle oinstall 2.8K May 15 2009 init.ora
-rw-r-----. 1 oracle oinstall 24 Jul 26 12:44 lkDELL
-rw-rw----. 1 oracle oinstall 1.6K Jul 26 12:47 hc_dell.dat
-rw-r-----. 1 oracle oinstall 1.5K Jul 26 12:47 orapwdell
-rw-r-----. 1 oracle oinstall 2.5K Jul 26 12:54 spfiledell.ora
-rw-r-----. 1 oracle oinstall 1.5K Jul 26 13:38 orapwprod
[oracle@target dbs]$ mv orapwprod orapwtest
[oracle@target dbs]$ ls -lrth
total 24K
-rw-r--r--. 1 oracle oinstall 2.8K May 15 2009 init.ora
-rw-r-----. 1 oracle oinstall 24 Jul 26 12:44 lkDELL
-rw-rw----. 1 oracle oinstall 1.6K Jul 26 12:47 hc_dell.dat
-rw-r-----. 1 oracle oinstall 1.5K Jul 26 12:47 orapwdell
-rw-r-----. 1 oracle oinstall 2.5K Jul 26 12:54 spfiledell.ora
-rw-r-----. 1 oracle oinstall 1.5K Jul 26 13:38 orapwtest
[oracle@target dbs]$ vi inittest.ora
DB_NAME='test'
:wq
Step: 7
===========================================================================
Go to the oracle network location & modifiy listener to make static listener ( @Target Site).
------------------------------------------------------------------------------------------------------------------------------------
[oracle@target dbs]$ cd /u01/app/oracle/product/11.2.0/db_1/network/admin/
[oracle@target admin]$ ls -lrth
total 20K
-rw-r--r--. 1 oracle oinstall 381 Dec 17 2012 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4.0K Jul 26 12:34 samples
-rw-r--r--. 1 oracle oinstall 219 Jul 26 12:42 sqlnet.ora
-rw-r--r--. 1 oracle oinstall 379 Jul 26 12:42 listener.ora
-rw-r-----. 1 oracle oinstall 345 Jul 26 12:46 tnsnames.ora
[oracle@target admin]$ vi listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER_TEST =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.201)(PORT = 1522))
)
)
SID_LIST_LISTENER_TEST =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
(SID_NAME = test)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
:wq
Step: 8
=====================================
Just Start created listener ( @Tareget Site).
---------------------------------------------------------------
[oracle@target admin]$ lsnrctl start LISTENER_TEST
LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 26-JUL-2017 13:59:05
Copyright (c) 1991, 2013, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.4.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/target/listener_test/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.102)(PORT=1522)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.102)(PORT=1522)))
STATUS of the LISTENER
------------------------
Alias LISTENER_TEST
Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production
Start Date 26-JUL-2017 13:59:05
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/diag/tnslsnr/target/listener_test/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.56.102)(PORT=1522)))
Services Summary...
Service "test.localdomain" has 1 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
[oracle@target admin]$
Step: 9
=====================================================================================
Go to the oracle network location & modifiy tnsname file entery to ping both static listeners of Source & Tareget( @Tarege Site).
---------------------------------------------------------------------------------------------------------------------------------------------------
[oracle@target admin]$ ls -lrth
total 20K
-rw-r--r--. 1 oracle oinstall 381 Dec 17 2012 shrept.lst
drwxr-xr-x. 2 oracle oinstall 4.0K Jul 26 12:34 samples
-rw-r--r--. 1 oracle oinstall 219 Jul 26 12:42 sqlnet.ora
-rw-r-----. 1 oracle oinstall 706 Jul 26 13:54 tnsnames.ora
-rw-r--r--. 1 oracle oinstall 711 Jul 26 13:59 listener.ora
[oracle@target admin]$ vi tnsname.ora
PROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = prod)
)
)
TEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.102)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test)
)
)
Step: 10
============================================================================
Try and check whether both tns enteries are pinging to their static listeners ( @Tarege Site).
----------------------------------------------------------------------------------------------------------------------------------
[oracle@target admin]$ tnsping test
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 26-JUL-2017 14:00:10
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.102)(PORT = 1522)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = test)))
OK (0 msec)
[oracle@target admin]$
[oracle@target admin]$ tnsping prod
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 27-JUL-2017 00:45:50
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
/u01/app/oracle/product/11.2.0/db_1/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.101)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod)))
OK (0 msec)
Step: 11
=================================================================================
Set the environment on target server for clone database like SID & ORACLE_HOME ( @Target Site).
----------------------------------------------------------------------------------------------------------------------------------------------
[oracle@target admin]$ . oraenv
ORACLE_SID = [test] ? test
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/11.2.0/db_1
The Oracle base remains unchanged with value /u01/app/oracle
Step: 12
===================================================================================
Connect with sqlplus with sysdba & startup instance in "NOMOUNT" state with inittest.ora pfile. ( @Target Site).
--------------------------------------------------------------------------------------------------------------------------------------------------
[oracle@target dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jul 26 14:15:18 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> STARTUP NOMOUNT PFILE='/u01/app/oracle/product/11.2.0/db_1/dbs/inittest.ora'
ORACLE instance started.
Total System Global Area 217157632 bytes
Fixed Size 2251816 bytes
Variable Size 159384536 bytes
Database Buffers 50331648 bytes
Redo Buffers 5189632 bytes
SQL>
Step: 13
======================================================
Open duplicate session and connect with rman ( @Target Site).
---------------------------------------------------------------------------------------------
[oracle@target test]$ rman TARGET sys/sys@prod AUXILIARY sys/sys@test
Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jul 26 23:45:10 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (DBID=362197903)
connected to auxiliary database: TEST (not mounted)
Step: 14
=================================================
Run the following script at rman prompt ( @Standby Site).
-----------------------------------------------------------------------------------
run {
allocate channel prod1 type disk;
allocate channel prod2 type disk;
allocate channel prod3 type disk;
allocate channel prod4 type disk;
allocate auxiliary channel clony type disk;
DUPLICATE DATABASE TO 'test'
FROM ACTIVE DATABASE
SPFILE
parameter_value_convert 'prod','test'
set db_file_name_convert='/disk01/prod/prod','/disk02/test'
set log_file_name_convert='/FRA/prod/PROD','/FRA/test','/disk01/prod/prod','/disk02/test'
set control_files='/disk02/test/control_file_01.dbf'
NOFILENAMECHECK;
}
Example :
**********
RMAN> run {
2> allocate channel prod1 type disk;
3> allocate channel prod2 type disk;
4> allocate channel prod3 type disk;
allocate channel prod4 type disk;
5> 6> allocate auxiliary channel clony type disk;
7> DUPLICATE DATABASE TO 'test'
FROM ACTIVE DATABASE
SPFILE
8> 9> 10> parameter_value_convert 'prod','test'
11> set db_file_name_convert='/disk01/prod/prod','/disk02/test'
12> set log_file_name_convert='/FRA/prod/PROD','/FRA/test','/disk01/prod/prod','/disk02/test'
13> set control_files='/disk02/test/control_file_01.dbf'
NOFILENAMECHECK;
}14> 15>
using target database control file instead of recovery catalog
allocated channel: prod1
channel prod1: SID=64 device type=DISK
allocated channel: prod2
channel prod2: SID=18 device type=DISK
allocated channel: prod3
channel prod3: SID=38 device type=DISK
allocated channel: prod4
channel prod4: SID=40 device type=DISK
allocated channel: clony
channel clony: SID=20 device type=DISK
Starting Duplicate Db at 26-JUL-17
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/11.2.0/db_1/dbs/spfileprod.ora' auxiliary format
'/u01/app/oracle/product/11.2.0/db_1/dbs/spfiletest.ora' ;
sql clone "alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfiletest.ora''";
}
executing Memory Script
Starting backup at 26-JUL-17
Finished backup at 26-JUL-17
sql statement: alter system set spfile= ''/u01/app/oracle/product/11.2.0/db_1/dbs/spfiletest.ora''
contents of Memory Script:
{
sql clone "alter system set db_name =
''TEST'' comment=
''duplicate'' scope=spfile";
sql clone "alter system set audit_file_dest =
''/u01/app/oracle/admin/test/adump'' comment=
'''' scope=spfile";
sql clone "alter system set db_recovery_file_dest =
''/FRA/test'' comment=
'''' scope=spfile";
sql clone "alter system set dispatchers =
''(PROTOCOL=TCP) (SERVICE=testXDB)'' comment=
'''' scope=spfile";
sql clone "alter system set db_file_name_convert =
''/disk01/prod/prod'', ''/disk02/test'' comment=
'''' scope=spfile";
sql clone "alter system set log_file_name_convert =
''/FRA/prod/PROD'', ''/FRA/test'', ''/disk01/prod/prod'', ''/disk02/test'' comment=
'''' scope=spfile";
sql clone "alter system set control_files =
''/disk02/test/control_file_01.dbf'' comment=
'''' scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_name = ''TEST'' comment= ''duplicate'' scope=spfile
sql statement: alter system set audit_file_dest = ''/u01/app/oracle/admin/test/adump'' comment= '''' scope=spfile
sql statement: alter system set db_recovery_file_dest = ''/FRA/test'' comment= '''' scope=spfile
sql statement: alter system set dispatchers = ''(PROTOCOL=TCP) (SERVICE=testXDB)'' comment= '''' scope=spfile
sql statement: alter system set db_file_name_convert = ''/disk01/prod/prod'', ''/disk02/test'' comment= '''' scope=spfile
sql statement: alter system set log_file_name_convert = ''/FRA/prod/PROD'', ''/FRA/test'', ''/disk01/prod/prod'', ''/disk02/test'' comment= '''' scope=spfile
sql statement: alter system set control_files = ''/disk02/test/control_file_01.dbf'' comment= '''' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1653518336 bytes
Fixed Size 2253784 bytes
Variable Size 1006636072 bytes
Database Buffers 637534208 bytes
Redo Buffers 7094272 bytes
allocated channel: clony
channel clony: SID=18 device type=DISK
contents of Memory Script:
{
sql clone "alter system set db_name =
''PROD'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''TEST'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/disk02/test/control_file_01.dbf';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''PROD'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''TEST'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 1653518336 bytes
Fixed Size 2253784 bytes
Variable Size 1006636072 bytes
Database Buffers 637534208 bytes
Redo Buffers 7094272 bytes
allocated channel: clony
channel clony: SID=18 device type=DISK
Starting backup at 26-JUL-17
channel prod1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_prod.f tag=TAG20170726T234533 RECID=2 STAMP=950399134
channel prod1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 26-JUL-17
database mounted
contents of Memory Script:
{
sql clone 'alter database flashback off';
set newname for datafile 1 to
"/disk02/test/system01.dbf";
set newname for datafile 2 to
"/disk02/test/sysaux01.dbf";
set newname for datafile 3 to
"/disk02/test/undotbs01.dbf";
set newname for datafile 4 to
"/disk02/test/users01.dbf";
set newname for datafile 5 to
"/disk02/test/example01.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/disk02/test/system01.dbf" datafile
2 auxiliary format
"/disk02/test/sysaux01.dbf" datafile
3 auxiliary format
"/disk02/test/undotbs01.dbf" datafile
4 auxiliary format
"/disk02/test/users01.dbf" datafile
5 auxiliary format
"/disk02/test/example01.dbf" ;
sql 'alter system archive log current';
}
executing Memory Script
sql statement: alter database flashback off
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 26-JUL-17
channel prod1: starting datafile copy
input datafile file number=00001 name=/disk01/prod/prod/system01.dbf
channel prod2: starting datafile copy
input datafile file number=00002 name=/disk01/prod/prod/sysaux01.dbf
channel prod3: starting datafile copy
input datafile file number=00005 name=/disk01/prod/prod/example01.dbf
channel prod4: starting datafile copy
input datafile file number=00003 name=/disk01/prod/prod/undotbs01.dbf
output file name=/disk02/test/undotbs01.dbf tag=TAG20170726T234544
channel prod4: datafile copy complete, elapsed time: 00:00:07
channel prod4: starting datafile copy
input datafile file number=00004 name=/disk01/prod/prod/users01.dbf
output file name=/disk02/test/users01.dbf tag=TAG20170726T234544
channel prod4: datafile copy complete, elapsed time: 00:00:03
output file name=/disk02/test/example01.dbf tag=TAG20170726T234544
channel prod3: datafile copy complete, elapsed time: 00:01:42
output file name=/disk02/test/system01.dbf tag=TAG20170726T234544
channel prod1: datafile copy complete, elapsed time: 00:02:02
output file name=/disk02/test/sysaux01.dbf tag=TAG20170726T234544
channel prod2: datafile copy complete, elapsed time: 00:02:02
Finished backup at 26-JUL-17
sql statement: alter system archive log current
contents of Memory Script:
{
backup as copy reuse
archivelog like "/FRA/prod/PROD/archivelog/2017_07_26/o1_mf_1_7_dqkq6d46_.arc" auxiliary format
"/FRA/test/TEST/archivelog/2017_07_26/o1_mf_1_7_%u_.arc" ;
catalog clone recovery area;
switch clone datafile all;
}
executing Memory Script
Starting backup at 26-JUL-17
channel prod1: starting archived log copy
input archived log thread=1 sequence=7 RECID=4 STAMP=950399268
output file name=/FRA/test/TEST/archivelog/2017_07_26/o1_mf_1_7_07sabs95_.arc RECID=0 STAMP=0
channel prod1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 26-JUL-17
searching for all files in the recovery area
List of Files Unknown to the Database
=====================================
File Name: /FRA/test/TEST/archivelog/2017_07_26/o1_mf_1_7_07sabs95_.arc
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /FRA/test/TEST/archivelog/2017_07_26/o1_mf_1_7_07sabs95_.arc
datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=950399270 file name=/disk02/test/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=950399270 file name=/disk02/test/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=950399270 file name=/disk02/test/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=950399270 file name=/disk02/test/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=950399270 file name=/disk02/test/example01.dbf
contents of Memory Script:
{
set until scn 996027;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 26-JUL-17
starting media recovery
archived log for thread 1 with sequence 7 is already on disk as file /FRA/test/TEST/archivelog/2017_07_26/o1_mf_1_7_07sabs95_.arc
archived log file name=/FRA/test/TEST/archivelog/2017_07_26/o1_mf_1_7_07sabs95_.arc thread=1 sequence=7
media recovery complete, elapsed time: 00:00:01
Finished recover at 26-JUL-17
Oracle instance started
Total System Global Area 1653518336 bytes
Fixed Size 2253784 bytes
Variable Size 1006636072 bytes
Database Buffers 637534208 bytes
Redo Buffers 7094272 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''TEST'' comment=
''Reset to original value by RMAN'' scope=spfile";
sql clone "alter system reset db_unique_name scope=spfile";
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_name = ''TEST'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1653518336 bytes
Fixed Size 2253784 bytes
Variable Size 1006636072 bytes
Database Buffers 637534208 bytes
Redo Buffers 7094272 bytes
allocated channel: clony
channel clony: SID=18 device type=DISK
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TEST" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/disk02/test/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/disk02/test/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/disk02/test/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/disk02/test/system01.dbf'
CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
set newname for tempfile 1 to
"/disk02/test/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/disk02/test/sysaux01.dbf",
"/disk02/test/undotbs01.dbf",
"/disk02/test/users01.dbf",
"/disk02/test/example01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /disk02/test/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/disk02/test/sysaux01.dbf RECID=1 STAMP=950399281
cataloged datafile copy
datafile copy file name=/disk02/test/undotbs01.dbf RECID=2 STAMP=950399281
cataloged datafile copy
datafile copy file name=/disk02/test/users01.dbf RECID=3 STAMP=950399281
cataloged datafile copy
datafile copy file name=/disk02/test/example01.dbf RECID=4 STAMP=950399281
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=950399281 file name=/disk02/test/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=950399281 file name=/disk02/test/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=950399281 file name=/disk02/test/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=950399281 file name=/disk02/test/example01.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Reenabling controlfile options for auxiliary database
Executing: alter database flashback on
Finished Duplicate Db at 26-JUL-17
released channel: prod1
released channel: prod2
released channel: prod3
released channel: prod4
released channel: clony
RMAN>
**********************************************************************************************************************************************************************************
##Remark## : No need to open clone database in resetlogs while configuring via rman active duplicate, it will do automaticaly via running script. for eg. see above last 15 lines.
***********************************************************************************************************************************************************************************
Step: 14
=======================================================================================================================
Now login to your clone database & check your database health & configuration, whatever you want. ( @Target Site).
------------------------------------------------------------------------------------------------------------------------
NAME INSTANCE_NAME HOST_NAME DATABASE_ROLE LOG_MODE LOGINS OPEN_MODE STARTUP_TIME VERSION
--------- ---------------- -------------------- -------------------- --------------- ---------- --------------- -------------------- -----------------
TEST test target.localdomain PRIMARY ARCHIVELOG ALLOWED READ WRITE 2017:07:26 23:47:57 11.2.0.4.0
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 1
Next log sequence to archive 1
Current log sequence 1
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /FRA/test
db_recovery_file_dest_size big integer 4182M
recovery_parallelism integer 0
SQL> select NAME,STATUS,IS_RECOVERY_DEST_FILE from v$controlfile;
NAME STATUS IS_
---------------------------------------- ------- ---
/disk02/test/control_file_01.dbf NO
SQL> select FILE#,TS#,STATUS from v$datafile;
FILE# TS# STATUS
---------- ---------- -------
1 0 SYSTEM
2 1 ONLINE
3 2 ONLINE
4 4 ONLINE
5 6 ONLINE
SQL> select FILE_NAME,FILE_ID,TABLESPACE_NAME,STATUS,AUTOEXTENSIBLE from dba_data_files;
FILE_NAME FILE_ID TABLESPACE_NAME STATUS AUT
---------------------------------------- ---------- ------------------------------ --------- ---
/disk02/test/system01.dbf 1 SYSTEM AVAILABLE YES
/disk02/test/sysaux01.dbf 2 SYSAUX AVAILABLE YES
/disk02/test/undotbs01.dbf 3 UNDOTBS1 AVAILABLE YES
/disk02/test/users01.dbf 4 USERS AVAILABLE YES
/disk02/test/example01.dbf 5 EXAMPLE AVAILABLE YES
SQL> select GROUP#,STATUS,MEMBER,IS_RECOVERY_DEST_FILE from v$logfile;
GROUP# STATUS MEMBER IS_
---------- ------- ---------------------------------------- ---
3 /disk02/test/redo03.log NO
2 /disk02/test/redo02.log NO
1 /disk02/test/redo01.log NO
TABLESPACE FILENAME FL_ID SIZE_GB USED_GB PCT_USED MAXBYTES AUT
------------------------------ -------------------------------------------------- ---------- ---------- ---------- ---------- ---------- ---
TEMP /disk02/test/temp01.dbf 1 .01953125 .001953125 10 32767.9844 YES
No comments:
Post a Comment