PERFORMING RMAN CLONING ON DIFFERENT SERVERS
In this article we will implement RMAN Cloning on different servers.
1 2 3 4 |
Server 1 : PRIMARY Ip Address : 192.168.0.101 Instance name : Primary Database Name : Primary |
1 2 3 4 |
Server 2 : Clone server Ip Address : 192.168.0.102 Instance name : clone_pr Database Name : clone_pr |
Server 1 :
Check instance information on server 1
1 2 3 4 |
SYS>>select name||' - '||instance_name||'@'||host_name||' - '||DB_UNIQUE_NAME||' - '||version||' - '||open_mode||' - '||to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') || ' - '|| database_role from v$database, v$instance; NAME||'-'||INSTANCE_NAME||'@'||HOST_NAME||'-'||DB_UNIQUE_NAME||'-'||VERSION||'-'||OPEN_MODE||'-'||TO_CHAR(STARTUP_TIME,'DD-MON-YYYYHH24:MI:SS')||'-'||DATABASE_ROLE ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PRIMARY - PRIMARY@primary.orcl.com - prod_stand - 12.1.0.2.0 - READ WRITE - 25-APR-2019 20:49:24 - PRIMARY |
Check schema report by connecting RMAN
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
[oracle@primary ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Mon Apr 29 20:07:30 2019 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: PROD (DBID=1836049007) RMAN> report schema; using target database control file instead of recovery catalog Report of database schema for database with db_unique_name PROD_STAND List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 300 SYSTEM YES /u01/oradata/primary/system.dbf 2 310 SYSAUX NO /u01/oradata/primary/sysaux.dbf 3 100 UNDOTBS1 YES /u01/oradata/primary/undotbs.dbf 4 150 USERDATA NO /u01/oradata/primary/userdata.dbf 5 10 TEST NO /u01/oradata/primary/test.dbf 6 10 DMTS1 NO /u01/oradata/primary/dmts1.dbf 7 10 DMTS2 NO /u01/oradata/primary/dmts2.dbf 8 10 TS_2K NO /u01/oradata/primary/ts_2k.dbf 9 50 TS1 NO /u01/oradata/primary/ts1.dbf List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 100 TEMP1 100 /u01/oradata/primary/temp1.dbf |
Check archive-log
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
[oracle@primary ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Mon Apr 29 20:09:43 2019 Copyrght (c) 1982, 2014, Oracle. All rights reserved. Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options SYS>>archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination /u01/oradata/primary/arch Oldest online log sequence 157 Next log sequence to archive 158 Current log sequence 158 |
Shutdown the database and keep database in mount state (consistent backup)
1 2 3 4 5 6 7 8 9 10 11 12 |
SYS>>shut immediate Database closed. Database dismounted. ORACLE instance shut down. SYS>>startup mount ORACLE instance started. Total System Global Area 1073741824 bytes Fixed Size 2932632 bytes Variable Size 826277992 bytes Database Buffers 239075328 bytes Redo Buffers 5455872 bytes Database mounted. |
Take the backup of primary using RMAN
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
[oracle@primary ~]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Mon Apr 29 20:16:53 2019 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: PROD (DBID=1836049007, not open) RMAN> backup database; Starting backup at 29-APR-19 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=7 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=23 device type=DISK channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=155 RECID=294 STAMP=1006890947 input archived log thread=1 sequence=156 RECID=295 STAMP=1006891191 channel ORA_DISK_1: starting piece 1 at 29-APR-19 channel ORA_DISK_2: starting archived log backup set channel ORA_DISK_2: specifying archived log(s) in backup set input archived log thread=1 sequence=157 RECID=296 STAMP=1006891612 channel ORA_DISK_2: starting piece 1 at 29-APR-19 channel ORA_DISK_1: finished piece 1 at 29-APR-19 piece handle=/u01/oradata/primary/rmanbkp/12u07t73.dbf tag=TAG20190429T201739 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log backup set channel ORA_DISK_1: specifying archived log(s) in backup set input archived log thread=1 sequence=151 RECID=290 STAMP=1006548771 input archived log thread=1 sequence=152 RECID=291 STAMP=1006548774 input archived log thread=1 sequence=153 RECID=292 STAMP=1006548777 input archived log thread=1 sequence=154 RECID=293 STAMP=1006548779 channel ORA_DISK_1: starting piece 1 at 29-APR-19 channel ORA_DISK_2: finished piece 1 at 29-APR-19 piece handle=/u01/oradata/primary/rmanbkp/13u07t73.dbf tag=TAG20190429T201739 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:02 channel ORA_DISK_1: finished piece 1 at 29-APR-19 piece handle=/u01/oradata/primary/rmanbkp/14u07t74.dbf tag=TAG20190429T201739 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02 Finished backup at 29-APR-19 Starting backup at 29-APR-19 using channel ORA_DISK_1 using channel ORA_DISK_2 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00002 name=/u01/oradata/primary/sysaux.dbf input datafile file number=00003 name=/u01/oradata/primary/undotbs.dbf input datafile file number=00009 name=/u01/oradata/primary/ts1.dbf input datafile file number=00006 name=/u01/oradata/primary/dmts1.dbf channel ORA_DISK_1: starting piece 1 at 29-APR-19 channel ORA_DISK_2: starting full datafile backup set channel ORA_DISK_2: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/oradata/primary/system.dbf input datafile file number=00004 name=/u01/oradata/primary/userdata.dbf input datafile file number=00005 name=/u01/oradata/primary/test.dbf input datafile file number=00007 name=/u01/oradata/primary/dmts2.dbf channel ORA_DISK_2: starting piece 1 at 29-APR-19 channel ORA_DISK_1: finished piece 1 at 29-APR-19 piece handle=/u01/oradata/primary/rmanbkp/15u07t76.dbf tag=TAG20190429T201742 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00008 name=/u01/oradata/primary/ts_2k.dbf channel ORA_DISK_1: starting piece 1 at 29-APR-19 channel ORA_DISK_2: finished piece 1 at 29-APR-19 piece handle=/u01/oradata/primary/rmanbkp/16u07t76.dbf tag=TAG20190429T201742 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:07 channel ORA_DISK_1: finished piece 1 at 29-APR-19 piece handle=/u01/oradata/primary/rmanbkp/17u07t7d.dbf tag=TAG20190429T201742 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 29-APR-19 Starting Control File Autobackup at 29-APR-19 piece handle=/u01/oradata/primary/rmanbkp/c-1836049007-20190429-01.ctl comment=NONE Finished Control File Autobackup at 29-APR-19 |
Server 2 :
Export new SID
1 |
[oracle@clone ~]$ export ORACLE_SID=clone_pr |
Create new directory structure for CRD file and ARCHIVE LOG files
1 2 |
[oracle@clone ~]$ mkdir -p /u01/oradata/clone_pr/arch [oracle@clone ~]$ mkdir -p /u01/oradata/clone_pr |
Create same directory as prod to store RMAN backup files
1 |
[oracle@clone ~]$ mkdir -p /u01/oradata/primary/rmanbkp |
Server 1 :
Send all the backup files from primary to clone server using SCP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
[oracle@primary ~]$ cd /u01/oradata/primary/rmanbkp [oracle@primary rmanbkp]$ ls -ltr total 729588 -rw-r-----. 1 oracle dba 8388608 Apr 29 19:55 c-1836049007-20190429-00.ctl -rw-r-----. 1 oracle dba 4194304 Apr 29 20:17 13u07t73.dbf -rw-r-----. 1 oracle dba 8383488 Apr 29 20:17 12u07t73.dbf -rw-r-----. 1 oracle dba 2353152 Apr 29 20:17 14u07t74.dbf -rw-r-----. 1 oracle dba 422232064 Apr 29 20:17 16u07t76.dbf -rw-r-----. 1 oracle dba 283746304 Apr 29 20:17 15u07t76.dbf -rw-r-----. 1 oracle dba 1058816 Apr 29 20:17 17u07t7d.dbf -rw-r-----. 1 oracle dba 8339456 Apr 29 20:17 snapcf_PROD.f -rw-r-----. 1 oracle dba 8388608 Apr 29 20:17 c-1836049007-20190429-01.ctl [oracle@primary rmanbkp]$ scp * oracle@192.168.0.102:/u01/oradata/primary/rmanbkp oracle@192.168.0.102's password: 12u07t73.dbf 100% 8187KB 8.0MB/s 00:00 13u07t73.dbf 100% 4096KB 4.0MB/s 00:00 14u07t74.dbf 100% 2298KB 2.2MB/s 00:00 15u07t76.dbf 100% 271MB 67.7MB/s 00:04 16u07t76.dbf 100% 403MB 50.3MB/s 00:08 17u07t7d.dbf 100% 1034KB 1.0MB/s 00:00 c-1836049007-20190429-00.ctl 100% 8192KB 8.0MB/s 00:00 c-1836049007-20190429-01.ctl 100% 8192KB 8.0MB/s 00:00 snapcf_PROD.f 100% 8144KB 8.0MB/s 00:00 |
Create passwd and send to clone server
1 2 3 4 |
[oracle@primary dbs]$ scp init$ORACLE_SID.ora orapw$ORACLE_SID oracle@192.168.0.102:$ORACLE_HOME/dbs oracle@192.168.0.102's password: initPROD.ora 100% 7963 7.8KB/s 00:00 orapwPROD 100% 7680 7.5KB/s 00:00 |
Server 2 :
Rename pfile and passwd file
1 2 3 4 5 6 7 |
[oracle@clone ~]$ cd $ORACLE_HOME/dbs [oracle@clone dbs]$ ls -ltr -rw-r--r--. 1 oracle oinstall 2992 Feb 3 2012 init.ora -rw-r--r--. 1 oracle dba 7963 Apr 29 20:26 initPROD.ora -rw-r-----. 1 oracle dba 7680 Apr 29 20:26 orapwPROD [oracle@stand dbs]$ mv initPROD.ora init$ORACLE_SID.ora [oracle@stand dbs]$ mv orapwPROD orapw$ORACLE_SID |
Edit pfile and change locations
1 2 3 4 5 6 7 8 |
[oracle@clone dbs]$ vi init$ORACLE_SID.ora control_files=/u01/oradata/clone_pr/control.ctl log_archive_dest=/u01/oradata/clone_pr/arch db_name='PROD' db_unique_name=prod_clone_pr diagnostic_dest='/u01/oradata/clone_pr' db_file_name_convert='/u01/oradata/primary','/u01/oradata/clone_pr' log_file_name_convert='/u01/oradata/primary','/u01/oradata/clone_pr' |
Create the listener
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
[oracle@clone~]$ cd /oraeng/app/oracle/product/12.1.0/network/admin/ [oracle@clone admin]$ vi listener.ora clone= (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.102)(PORT = 1522)) ) ) ) SID_LIST_clone = (SID_LIST = (SID_DESC = (SID_NAME =clone_pr) (ORACLE_HOME = /oraeng/app/oracle/product/12.1.0) ) ) |
Start the listener
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
[oracle@clone admin]$ lsnrctl start clone LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 29-APR-2019 20:39:10 Copyright (c) 1991, 2014, Oracle. All rights reserved. Starting /oraeng/app/oracle/product/12.1.0/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 12.1.0.2.0 - Production System parameter file is /oraeng/app/oracle/product/12.1.0/network/admin/listener.ora Log messages written to /oraeng/app/oracle/diag/tnslsnr/stand/clone/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.102)(PORT=1522))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.0.102)(PORT=1522))) STATUS of the LISTENER ------------------------ Alias clone Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production Start Date 29-APR-2019 20:39:10 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /oraeng/app/oracle/product/12.1.0/network/admin/listener.ora Listener Log File /oraeng/app/oracle/diag/tnslsnr/stand/clone/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.0.102)(PORT=1522))) Services Summary... Service "clone_pr" has 1 instance(s). Instance "clone_pr", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully |
Startup the database in mount state
1 2 3 4 5 6 7 8 9 10 11 |
[oracle@clone dbs]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Mon Apr 29 20:34:49 2019 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount ORACLE instance started. Total System Global Area 1073741824 bytes Fixed Size 2932632 bytes Variable Size 826277992 bytes Database Buffers 239075328 bytes Redo Buffers 5455872 bytes |
Server 1 :
Create TNS entry in primary server
1 2 3 4 5 6 7 8 9 10 11 |
[oracle@primary ~]$ cd /oraeng/app/oracle/product/12.1.0/network/admin/ [oracle@primary admin]$ vi tnsnames.ora to_clone = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.102)(PORT = 1522)) ) (CONNECT_DATA = (SID =clone_pr) ) ) |
Check connectivity
1 2 3 4 5 6 7 |
[oracle@primary admin]$ tnsping to_clone TNS Ping Utility for Linux: Version 12.1.0.2.0 - Production on 29-APR-2019 20:41:45 Copyright (c) 1997, 2014, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.102)(PORT = 1522))) (CONNECT_DATA = (SID =clone_pr))) OK (10 msec) |
Connect to target using auxiliary instance using RMAN and issue duplicate command
1 2 3 4 5 6 |
[oracle@primary ~]$ rman target sys/sys auxiliary sys/sys@to_clone Recovery Manager: Release 12.1.0.2.0 - Production on Mon Apr 29 20:42:34 2019 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: PROD (DBID=1836049007, not open) connected to auxiliary database: PROD (not mounted) |
Execute the following duplicate target command to complete cloning
1 2 3 4 5 |
[oracle@primary ~]$ rman target sys/sys auxiliary sys/sys@to_clone Recovery Manager: Release 12.1.0.2.0 - Production on Mon Apr 29 20:42:34 2019 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: PROD (DBID=1836049007, not open) connected to auxiliary database: PROD (not mounted) |
Issue DUPLICATE COMMAND
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
RMAN> duplicate target database for clone from active database; Starting Duplicate Db at 29-APR-19 using target database control file instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=22 device type=DISK allocated channel: ORA_AUX_DISK_2 channel ORA_AUX_DISK_2: SID=23 device type=DISK contents of Memory Script: { restore clone controlfile; sql clone 'alter database mount clone database'; } executing Memory Script Starting restore at 29-APR-19 using channel ORA_AUX_DISK_1 using channel ORA_AUX_DISK_2 channel ORA_AUX_DISK_1: starting datafile backup set restore channel ORA_AUX_DISK_1: restoring control file channel ORA_AUX_DISK_1: reading from backup piece /u01/oradata/primary/rmanbkp/c-1836049007-20190429-01.ctl channel ORA_AUX_DISK_1: piece handle=/u01/oradata/primary/rmanbkp/c-1836049007-20190429-01.ctl tag=TAG20190429T201750 channel ORA_AUX_DISK_1: restored backup piece 1 channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01 output file name=/u01/oradata/clone_pr/control.ctl Finished restore at 29-APR-19 sql statement: alter database mount clone database contents of Memory Script: { set newname for tempfile 1 to "/u01/oradata/clone_pr/temp1.dbf"; switch clone tempfile all; set newname for datafile 1 to "/u01/oradata/clone_pr/system.dbf"; set newname for datafile 2 to "/u01/oradata/clone_pr/sysaux.dbf"; set newname for datafile 3 to "/u01/oradata/clone_pr/undotbs.dbf"; set newname for datafile 4 to "/u01/oradata/clone_pr/userdata.dbf"; set newname for datafile 5 to "/u01/oradata/clone_pr/test.dbf"; set newname for datafile 6 to "/u01/oradata/clone_pr/dmts1.dbf"; set newname for datafile 7 to "/u01/oradata/clone_pr/dmts2.dbf"; set newname for datafile 8 to "/u01/oradata/clone_pr/ts_2k.dbf"; set newname for datafile 9 to "/u01/oradata/clone_pr/ts1.dbf"; backup as copy reuse datafile 1 auxiliary format "/u01/oradata/clone_pr/system.dbf" datafile 2 auxiliary format "/u01/oradata/clone_pr/sysaux.dbf" datafile 3 auxiliary format "/u01/oradata/clone_pr/undotbs.dbf" datafile 4 auxiliary format "/u01/oradata/clone_pr/userdata.dbf" datafile 5 auxiliary format "/u01/oradata/clone_pr/test.dbf" datafile 6 auxiliary format "/u01/oradata/clone_pr/dmts1.dbf" datafile 7 auxiliary format "/u01/oradata/clone_pr/dmts2.dbf" datafile 8 auxiliary format "/u01/oradata/clone_pr/ts_2k.dbf" datafile 9 auxiliary format "/u01/oradata/clone_pr/ts1.dbf" ; } executing Memory Script executing command: SET NEWNAME renamed tempfile 1 to /u01/oradata/clone_pr/temp1.dbf in control file executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting backup at 29-APR-19 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=21 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=1 device type=DISK channel ORA_DISK_1: starting datafile copy input datafile file number=00002 name=/u01/oradata/primary/sysaux.dbf channel ORA_DISK_2: starting datafile copy input datafile file number=00001 name=/u01/oradata/primary/system.dbf output file name=/u01/oradata/clone_pr/sysaux.dbf tag=TAG20190429T204346 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15 channel ORA_DISK_1: starting datafile copy input datafile file number=00004 name=/u01/oradata/primary/userdata.dbf output file name=/u01/oradata/clone_pr/system.dbf tag=TAG20190429T204346 channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:15 channel ORA_DISK_2: starting datafile copy input datafile file number=00003 name=/u01/oradata/primary/undotbs.dbf output file name=/u01/oradata/clone_pr/undotbs.dbf tag=TAG20190429T204346 channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_2: starting datafile copy input datafile file number=00009 name=/u01/oradata/primary/ts1.dbf output file name=/u01/oradata/clone_pr/userdata.dbf tag=TAG20190429T204346 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:04 channel ORA_DISK_1: starting datafile copy input datafile file number=00008 name=/u01/oradata/primary/ts_2k.dbf output file name=/u01/oradata/clone_pr/ts_2k.dbf tag=TAG20190429T204346 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting datafile copy input datafile file number=00005 name=/u01/oradata/primary/test.dbf output file name=/u01/oradata/clone_pr/ts1.dbf tag=TAG20190429T204346 channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:02 channel ORA_DISK_2: starting datafile copy input datafile file number=00006 name=/u01/oradata/primary/dmts1.dbf output file name=/u01/oradata/clone_pr/test.dbf tag=TAG20190429T204346 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting datafile copy input datafile file number=00007 name=/u01/oradata/primary/dmts2.dbf output file name=/u01/oradata/clone_pr/dmts1.dbf tag=TAG20190429T204346 channel ORA_DISK_2: datafile copy complete, elapsed time: 00:00:01 output file name=/u01/oradata/clone_pr/dmts2.dbf tag=TAG20190429T204346 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 Finished backup at 29-APR-19 contents of Memory Script: { switch clone datafile all; } executing Memory Script datafile 1 switched to datafile copy input datafile copy RECID=2 STAMP=1006893848 file name=/u01/oradata/clone_pr/system.dbf datafile 2 switched to datafile copy input datafile copy RECID=3 STAMP=1006893848 file name=/u01/oradata/clone_pr/sysaux.dbf datafile 3 switched to datafile copy input datafile copy RECID=4 STAMP=1006893848 file name=/u01/oradata/clone_pr/undotbs.dbf datafile 4 switched to datafile copy input datafile copy RECID=5 STAMP=1006893848 file name=/u01/oradata/clone_pr/userdata.dbf datafile 5 switched to datafile copy input datafile copy RECID=6 STAMP=1006893848 file name=/u01/oradata/clone_pr/test.dbf datafile 6 switched to datafile copy input datafile copy RECID=7 STAMP=1006893848 file name=/u01/oradata/clone_pr/dmts1.dbf datafile 7 switched to datafile copy input datafile copy RECID=8 STAMP=1006893848 file name=/u01/oradata/clone_pr/dmts2.dbf datafile 8 switched to datafile copy input datafile copy RECID=9 STAMP=1006893848 file name=/u01/oradata/clone_pr/ts_2k.dbf datafile 9 switched to datafile copy input datafile copy RECID=10 STAMP=1006893848 file name=/u01/oradata/clone_pr/ts1.dbf contents of Memory Script: { sql clone "alter database datafile 1 online"; sql clone "alter database datafile 2 online"; sql clone "alter database datafile 3 online"; sql clone "alter database datafile 4 online"; sql clone "alter database datafile 5 online"; sql clone "alter database datafile 6 online"; sql clone "alter database datafile 7 online"; sql clone "alter database datafile 8 online"; sql clone "alter database datafile 9 online"; } executing Memory Script sql statement: alter database datafile 1 online sql statement: alter database datafile 2 online sql statement: alter database datafile 3 online sql statement: alter database datafile 4 online sql statement: alter database datafile 5 online sql statement: alter database datafile 6 online sql statement: alter database datafile 7 online sql statement: alter database datafile 8 online sql statement: alter database datafile 9 online Finished Duplicate Db at 29-APR-19 |
Cloning completed…….
Server 2:
Now in Server -2 check the instance information
1 2 3 4 |
SQL> select name||' - '||instance_name||'@'||host_name||' - '||DB_UNIQUE_NAME||' - '||version||' - '||open_mode||' - '||to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') || ' - '|| database_role from v$database, v$instance; NAME||'-'||INSTANCE_NAME||'@'||HOST_NAME||'-'||DB_UNIQUE_NAME||'-'||VERSION||'-'||OPEN_MODE||'-'||TO_CHAR(STARTUP_TIME,'DD-MON-YYYYHH24:MI:SS')||'-'||DATABASE_ROLE ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PROD - clone_pr@stand.ord.com - prod_clone_pr - 12.1.0.2.0 - MOUNTED - 29-APR-2019 20:34:55 - PRIMARY |
Here in above result the database is still mount state
Make clone database as read write
1 2 3 4 5 6 7 8 |
SQL> alter database open resetlogs; Database altered. SQL> set linesize 300 SQL> select name||' - '||instance_name||'@'||host_name||' - '||DB_UNIQUE_NAME||' - '||version||' - '||open_mode||' - '||to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') || ' - '|| database_role from v$database, v$instance; NAME||'-'||INSTANCE_NAME||'@'||HOST_NAME||'-'||DB_UNIQUE_NAME||'-'||VERSION||'-'||OPEN_MODE||'-'||TO_CHAR(STARTUP_TIME,'DD-MON-YYYYHH24:MI:SS')||'-'||DATABASE_ROLE ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- PROD - clone_pr@stand.ord.com - prod_clone_pr - 12.1.0.2.0 - READ WRITE - 29-APR-2019 20:34:55 - PRIMARY |
For clear understanding check below screenshot
Check controlfile_type in clone database
1 2 3 4 5 |
SQL> select controlfile_type from v$database; CONTROL ------- CLONE |
Here it is clone controlfile ….. if we want to make it as current we need to recreate the controlfile.
Thanks for browsing ktexperts.com ….