[code]
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;
ORCL - ORCL@dev.oracledbashop.com - orcl - 19.0.0.0.0 READ WRITE - 22-MAY-2020 22:27:59 - PRIMARY
[/code]
[code] [dev:oracle:ORCL]$ rman target / Recovery Manager: Release 19.0.0.0.0 - Production on Fri May 22 22:29:14 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1567687522) RMAN> report schema; using target database control file instead of recovery catalog Report of database schema for database with db_unique_name ORCL List of Permanent Datafiles =========================== File Size(MB) Tablespace RB segs Datafile Name ---- -------- -------------------- ------- ------------------------ 1 910 SYSTEM YES /u01/app/oracle/oradata/ORCL/system01.dbf 3 530 SYSAUX NO /u01/app/oracle/oradata/ORCL/sysaux01.dbf 4 345 UNDOTBS1 YES /u01/app/oracle/oradata/ORCL/undotbs01.dbf 5 270 PDB$SEED:SYSTEM NO /u01/app/oracle/oradata/ORCL/pdbseed/system01.dbf 6 330 PDB$SEED:SYSAUX NO /u01/app/oracle/oradata/ORCL/pdbseed/sysaux01.dbf 7 5 USERS NO /u01/app/oracle/oradata/ORCL/users01.dbf 8 100 PDB$SEED:UNDOTBS1 NO /u01/app/oracle/oradata/ORCL/pdbseed/undotbs01.dbf 9 270 ORCLPDB:SYSTEM NO /u01/app/oracle/oradata/ORCL/orclpdb/system01.dbf 10 330 ORCLPDB:SYSAUX NO /u01/app/oracle/oradata/ORCL/orclpdb/sysaux01.dbf 11 100 ORCLPDB:UNDOTBS1 NO /u01/app/oracle/oradata/ORCL/orclpdb/undotbs01.dbf 12 5 ORCLPDB:USERS NO /u01/app/oracle/oradata/ORCL/orclpdb/users01.dbf 17 270 CLONETEST:SYSTEM NO /u01/app/oracle/oradata/ORCL/CLONETEST/system01.dbf 18 340 CLONETEST:SYSAUX NO /u01/app/oracle/oradata/ORCL/CLONETEST/sysaux01.dbf 19 100 CLONETEST:UNDOTBS1 NO /u01/app/oracle/oradata/ORCL/CLONETEST/undotbs01.dbf 20 5 CLONETEST:USERS NO /u01/app/oracle/oradata/ORCL/CLONETEST/users01.dbf 21 270 CLONETEST_CL:SYSTEM NO /u01/app/oracle/oradata/ORCL/CLONETEST_CL/system01.dbf 22 330 CLONETEST_CL:SYSAUX NO /u01/app/oracle/oradata/ORCL/CLONETEST_CL/sysaux01.dbf 23 100 CLONETEST_CL:UNDOTBS1 NO /u01/app/oracle/oradata/ORCL/CLONETEST_CL/undotbs01.dbf 24 5 CLONETEST_CL:USERS NO /u01/app/oracle/oradata/ORCL/CLONETEST_CL/users01.dbf List of Temporary Files ======================= File Size(MB) Tablespace Maxsize(MB) Tempfile Name ---- -------- -------------------- ----------- -------------------- 1 32 TEMP 32767 /u01/app/oracle/oradata/ORCL/temp01.dbf 2 36 PDB$SEED:TEMP 32767 /u01/app/oracle/oradata/ORCL/pdbseed/temp012020-05-08_23-03-27-674-PM.dbf 3 36 ORCLPDB:TEMP 32767 /u01/app/oracle/oradata/ORCL/orclpdb/temp01.dbf 4 128 CLONETEST:TEMP 32767 /u01/app/oracle/oradata/ORCL/CLONETEST/temp012020-05-08_23-03-27-674-PM.dbf 5 36 CLONETEST_CL:TEMP 32767 /u01/app/oracle/oradata/ORCL/CLONETEST_CL/temp012020-05-08_23-03-27-674-PM.dbf RMAN> exit [/code]
Check ARCHIVELOG mode in SORUCE
[code] SQL> archive log list Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 8 Next log sequence to archive 10 Current log sequence 10 [/code]
SHUTDOWN the database and keep database in MOUNT state (to take consistent backup)
[code] SQL> shutdown immediate; Database closed. Database dismounted. ORACLE instance shut down. SQL> SQL> startup mount ORACLE instance started. Total System Global Area 1593832664 bytes Fixed Size 9135320 bytes Variable Size 1006632960 bytes Database Buffers 570425344 bytes Redo Buffers 7639040 bytes Database mounted. [/code]
Take backup of PRIMARY (SOURCE) using RMAN
[code] [dev:oracle:ORCL]$ rman target / Recovery Manager: Release 19.0.0.0.0 - Production on Fri May 22 23:03:00 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1567687522, not open) RMAN> configure channel device type disk format '/u01/app/oracle/oradata/ORCL/backup/%U' maxpiecesize 2G; using target database control file instead of recovery catalog new RMAN configuration parameters: CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT '/u01/app/oracle/oradata/ORCL/backup/%U' MAXPIECESIZE 2 G; new RMAN configuration parameters are successfully stored RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON; old RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP ON; new RMAN configuration parameters: CONFIGURE CONTROLFILE AUTOBACKUP ON; new RMAN configuration parameters are successfully stored RMAN> BACKUP DATABASE PLUS ARCHIVELOG; Starting backup at 23-MAY-20 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=386 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=8 RECID=1 STAMP=1041114517 input archived log thread=1 sequence=9 RECID=2 STAMP=1041114518 channel ORA_DISK_1: starting piece 1 at 23-MAY-20 channel ORA_DISK_1: finished piece 1 at 23-MAY-20 piece handle=/u01/app/oracle/oradata/ORCL/backup/08v0siva_1_1 tag=TAG20200523T011210 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 23-MAY-20 Starting backup at 23-MAY-20 using channel ORA_DISK_1 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/system01.dbf input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/sysaux01.dbf input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/undotbs01.dbf input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf channel ORA_DISK_1: starting piece 1 at 23-MAY-20 channel ORA_DISK_1: finished piece 1 at 23-MAY-20 piece handle=/u01/app/oracle/oradata/ORCL/backup/09v0sivb_1_1 tag=TAG20200523T011211 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:08 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00018 name=/u01/app/oracle/oradata/ORCL/CLONETEST/sysaux01.dbf input datafile file number=00017 name=/u01/app/oracle/oradata/ORCL/CLONETEST/system01.dbf input datafile file number=00019 name=/u01/app/oracle/oradata/ORCL/CLONETEST/undotbs01.dbf input datafile file number=00020 name=/u01/app/oracle/oradata/ORCL/CLONETEST/users01.dbf channel ORA_DISK_1: starting piece 1 at 23-MAY-20 channel ORA_DISK_1: finished piece 1 at 23-MAY-20 piece handle=/u01/app/oracle/oradata/ORCL/backup/0av0sivj_1_1 tag=TAG20200523T011211 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00010 name=/u01/app/oracle/oradata/ORCL/orclpdb/sysaux01.dbf input datafile file number=00009 name=/u01/app/oracle/oradata/ORCL/orclpdb/system01.dbf input datafile file number=00011 name=/u01/app/oracle/oradata/ORCL/orclpdb/undotbs01.dbf input datafile file number=00012 name=/u01/app/oracle/oradata/ORCL/orclpdb/users01.dbf channel ORA_DISK_1: starting piece 1 at 23-MAY-20 channel ORA_DISK_1: finished piece 1 at 23-MAY-20 piece handle=/u01/app/oracle/oradata/ORCL/backup/0bv0sivm_1_1 tag=TAG20200523T011211 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00022 name=/u01/app/oracle/oradata/ORCL/CLONETEST_CL/sysaux01.dbf input datafile file number=00021 name=/u01/app/oracle/oradata/ORCL/CLONETEST_CL/system01.dbf input datafile file number=00023 name=/u01/app/oracle/oradata/ORCL/CLONETEST_CL/undotbs01.dbf input datafile file number=00024 name=/u01/app/oracle/oradata/ORCL/CLONETEST_CL/users01.dbf channel ORA_DISK_1: starting piece 1 at 23-MAY-20 channel ORA_DISK_1: finished piece 1 at 23-MAY-20 piece handle=/u01/app/oracle/oradata/ORCL/backup/0cv0sivp_1_1 tag=TAG20200523T011211 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00006 name=/u01/app/oracle/oradata/ORCL/pdbseed/sysaux01.dbf input datafile file number=00005 name=/u01/app/oracle/oradata/ORCL/pdbseed/system01.dbf input datafile file number=00008 name=/u01/app/oracle/oradata/ORCL/pdbseed/undotbs01.dbf channel ORA_DISK_1: starting piece 1 at 23-MAY-20 channel ORA_DISK_1: finished piece 1 at 23-MAY-20 piece handle=/u01/app/oracle/oradata/ORCL/backup/0dv0sivs_1_1 tag=TAG20200523T011211 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03 Finished backup at 23-MAY-20 Starting backup at 23-MAY-20 using channel ORA_DISK_1 specification does not match any archived log in the repository backup cancelled because there are no files to backup Finished backup at 23-MAY-20 Starting Control File and SPFILE Autobackup at 23-MAY-20 piece handle=/u01/app/oracle/recovery_area/ORCL/autobackup/2020_05_23/o1_mf_s_1041116344_hdkhphqv_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 23-MAY-20 RMAN> quit Recovery Manager complete. [dev:oracle:ORCL]$ pwd /u01/app/oracle/oradata/ORCL/backup [dev:oracle:ORCL]$ ls -lrt total 3294460 -rw-r----- 1 oracle oinstall 35439104 May 23 01:12 08v0siva_1_1 -rw-r----- 1 oracle oinstall 1250885632 May 23 01:12 09v0sivb_1_1 -rw-r----- 1 oracle oinstall 508755968 May 23 01:12 0av0sivj_1_1 -rw-r----- 1 oracle oinstall 497696768 May 23 01:12 0bv0sivm_1_1 -rw-r----- 1 oracle oinstall 497598464 May 23 01:12 0cv0sivp_1_1 -rw-r----- 1 oracle oinstall 583147520 May 23 01:12 0dv0sivs_1_1 [dev:oracle:ORCL]$ [/code]
In TARGET
export new SID (ORCL_CLN)
[code] [oracle@clone ~]$ [oracle@clone ~]$ export ORACLE_SID=orcl_cln [/code]
Create new directory structure for Control, Redo, Data files and Archive log files
[code] [dev1:oracle:ORCL_CLN]$ pwd /u01/app/oracle/oradata [dev1:oracle:ORCL_CLN]$ mkdir -p /u01/app/oracle/oradata/ORCL_CLN/arch [/code]
Create same directory structure as SOURCE to store RMAN backup files in TARGET (since i have multiple directory structures and multiple files I got to create some additional directories)
[code] [oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/ORCL_CLN [oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/ORCL_CLN/arch [oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/ORCL/backup [oracle@clone ~]$ mkdir -p /u01/app/oracle/recovery_area/ORCL/autobackup/2020_05_23/ [oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/ORCL_CLN [oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/ORCL_CLN/CLONETEST [oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/ORCL_CLN/orclpdb [oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL [oracle@clone ~]$ mkdir -p /u01/app/oracle/oradata/ORCL_CLN/pdbseed [/code]
From SOURCE send all RMAN backup files to TARGET using SCP
[code] [dev:oracle:ORCL]$ scp * oracle@192.168.56.112:/u01/app/oracle/oradata/ORCL/backup/. oracle@192.168.56.111's password: 08v0siva_1_1 100% 34MB 59.7MB/s 00:00 09v0sivb_1_1 100% 1193MB 87.7MB/s 00:13 0av0sivj_1_1 100% 485MB 87.3MB/s 00:05 0bv0sivm_1_1 100% 475MB 83.3MB/s 00:05 0cv0sivp_1_1 100% 475MB 94.6MB/s 00:05 0dv0sivs_1_1 100% 556MB 92.6MB/s 00:06 [dev:oracle:ORCL]$ scp /u01/app/oracle/recovery_area/ORCL/autobackup/2020_05_23/o1_mf_s_1041116344_hdkhphqv_.bkp oracle@192.168.56.112:/u01/app/oracle/recovery_area/ORCL/autobackup/2020_05_23/ oracle@192.168.56.111's password: o1_mf_s_1041116344_hdkhphqv_.bkp 100% 18MB 97.5MB/s 00:00 [/code]
Create pfile and copy both pfile and password file from SOURCE to TARGET
[code] [dev:oracle:ORCL]$ cd $ORACLE_HOME [dev:oracle:ORCL]$ cd dbs [dev:oracle:ORCL]$ ls -lrt orapwORCL -rw-r----- 1 oracle oinstall 2048 May 8 22:59 orapwORCL [dev:oracle:ORCL]$ scp orapwORCL oracle@192.168.56.112:/u01/app/oracle/product/19.0.0/dbhome_1/dbs oracle@192.168.56.111's password: orapwORCL 100% 2048 1.8MB/s 00:00 [dev:oracle:ORCL]$ scp initORCL.ora oracle@192.168.56.112:/u01/app/oracle/product/19.0.0/dbhome_1/dbs oracle@192.168.56.111's password: initORCL.ora 100% 1147 1.2MB/s 00:00 [/code]
In TARGET
Rename pfile and password file
[code] [oracle@clone backup]$ cd /u01/app/oracle/product/19.0.0/dbhome_1/dbs/ [oracle@clone dbs]$ ls -lrt total 12 -rwxrwxr-x. 1 oracle oinstall 3079 May 14 2015 init.ora -rw-r--r-- 1 oracle oinstall 1147 May 23 12:32 initORCL.ora -rw-r----- 1 oracle oinstall 2048 May 23 12:32 orapwORCL [oracle@clone dbs]$ mv initORCL.ora initorcl_cln.ora [oracle@clone dbs]$ mv orapwORCL orapworcl_cln [/code]
Edit pfile and modify locations
[code] [oracle@clone dbs]$ cat initorcl_cln.ora audit_file_dest='/u01/app/oracle/admin/orcl_cln/adump' audit_trail='db' compatible='19.0.0' control_files='/u01/app/oracle/oradata/ORCL/control01.ctl','/u01/app/oracle/recovery_area/ORCL/control02.ctl' db_block_size=8192 db_domain='oracledbashop.com' db_name='orcl' db_unique_name=orcl_cln db_recovery_file_dest='/u01/app/oracle/recovery_area' db_recovery_file_dest_size=12732m diagnostic_dest='/u01/app/oracle' enable_pluggable_database=true local_listener='LISTENER_ORCL_CLN' nls_language='AMERICAN' nls_territory='AMERICA' open_cursors=300 processes=320 remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1' db_file_name_convert=('/u01/app/oracle/oradata/ORCL','/u01/app/oracle/oradata/ORCL_CLN','/u01/app/oracle/oradata/ORCL/CLONETEST/','/u01/app/oracle/oradata/ORCL_CLN','/u01/app/oracle/oradata/ORCL/orclpdb','/u01/app/oracle/oradata/ORCL_CLN','/u01/app/oracle/oradata/ORCL/CLONETEST_CL','/u01/app/oracle/oradata/ORCL_CLN','/u01/app/oracle/oradata/ORCL/pdbseed','/u01/app/oracle/oradata/ORCL_CLN') log_file_name_convert='/u01/app/oracle/oradata/ORCL','/u01/app/oracle/oradata/ORCL_CLN' [/code]
Create LISTENER in my case LISTENER_ORCL_CLN
[code] [dev1:oracle:ORCL_CLN]$ cat listener.ora # listener.ora Network Configuration File: /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora # Generated by Oracle configuration tools. [oracle@clone admin]$ cat listener.ora LISTENER_ORCL_CLN = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = clone.oracledbashop.com)(PORT = 1521)) ) ) ) SID_LIST_LISTENER_ORCL_CLN = (SID_LIST = (SID_DESC = (SID_NAME =orcl_cln) (ORACLE_HOME = /u01/app/oracle/product/19.0.0/dbhome_1) ) ) [/code]
Start the LISTENER (LISTENER_ORCL_CLN)
[code] [oracle@clone admin]$ lsnrctl start LISTENER_ORCL_CLN LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 23-MAY-2020 12:39:03 Copyright (c) 1991, 2019, Oracle. All rights reserved. Starting /u01/app/oracle/product/19.0.0/dbhome_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 19.0.0.0.0 - Production System parameter file is /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/listener.ora Log messages written to /u01/app/oracle/diag/tnslsnr/clone/listener_orcl_cln/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=clone.oracledbashop.com)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=clone.oracledbashop.com)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER_ORCL_CLN Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 23-MAY-2020 12:39:03 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/19.0.0/dbhome_1/network/admin/listener.ora Listener Log File /u01/app/oracle/diag/tnslsnr/clone/listener_orcl_cln/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=clone.oracledbashop.com)(PORT=1521))) Services Summary... Service "orcl_cln" has 1 instance(s). Instance "orcl_cln", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully [/code]
Start the TARGET database in nomount mode
[code] [oracle@clone arch]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Sat May 23 13:47:44 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount ORACLE instance started. Total System Global Area 339734952 bytes Fixed Size 9134504 bytes Variable Size 276824064 bytes Database Buffers 50331648 bytes Redo Buffers 3444736 bytes [/code]
Add TARGET TNS entry in SOURCE, and then check the connectivity
[code] ORCL_CLN = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.112)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl_cln) ) ) [dev:oracle:ORCL]$ tnsping ORCL_CLN TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 23-MAY-2020 14:42:00 Copyright (c) 1997, 2019, Oracle. All rights reserved. Used parameter files: /u01/app/oracle/product/19.0.0/dbhome_1/network/admin/sqlnet.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.112)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl_cln))) OK (0 msec) [/code]
Connect to TARGET using auxiliary instance using RMAN and issue duplicate database command
[code] [dev:oracle:ORCL]$ crman target sys/oracle auxiliary sys/oracle@orcl_cln Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 23 13:48:23 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: ORCL (DBID=1567687522, not open) connected to auxiliary database: ORCL (not mounted) [/code]
Execute the duplicate target command to complete the cloning
[code] RMAN> duplicate target database for clone from active database; Starting Duplicate Db at 23-MAY-20 using target database control file instead of recovery catalog allocated channel: ORA_AUX_DISK_1 channel ORA_AUX_DISK_1: SID=428 device type=DISK contents of Memory Script: { restore clone controlfile; sql clone 'alter database mount clone database'; } executing Memory Script Starting restore at 23-MAY-20 using channel ORA_AUX_DISK_1 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/app/oracle/recovery_area/ORCL/autobackup/2020_05_23/o1_mf_s_1041116344_hdkhphqv_.bkp channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/recovery_area/ORCL/autobackup/2020_05_23/o1_mf_s_1041116344_hdkhphqv_.bkp tag=TAG20200523T011231 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/app/oracle/oradata/ORCL/control01.ctl output file name=/u01/app/oracle/recovery_area/ORCL/control02.ctl Finished restore at 23-MAY-20 sql statement: alter database mount clone database contents of Memory Script: { set newname for tempfile 1 to "/u01/app/oracle/oradata/ORCL_CLN/temp01.dbf"; set newname for tempfile 2 to "/u01/app/oracle/oradata/ORCL_CLN/pdbseed/temp012020-05-08_23-03-27-674-PM.dbf"; set newname for tempfile 3 to "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/temp01.dbf"; set newname for tempfile 4 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/temp012020-05-08_23-03-27-674-PM.dbf"; set newname for tempfile 5 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/temp012020-05-08_23-03-27-674-PM.dbf"; switch clone tempfile all; set newname for datafile 1 to "/u01/app/oracle/oradata/ORCL_CLN/system01.dbf"; set newname for datafile 3 to "/u01/app/oracle/oradata/ORCL_CLN/sysaux01.dbf"; set newname for datafile 4 to "/u01/app/oracle/oradata/ORCL_CLN/undotbs01.dbf"; set newname for datafile 5 to "/u01/app/oracle/oradata/ORCL_CLN/pdbseed/system01.dbf"; set newname for datafile 6 to "/u01/app/oracle/oradata/ORCL_CLN/pdbseed/sysaux01.dbf"; set newname for datafile 7 to "/u01/app/oracle/oradata/ORCL_CLN/users01.dbf"; set newname for datafile 8 to "/u01/app/oracle/oradata/ORCL_CLN/pdbseed/undotbs01.dbf"; set newname for datafile 9 to "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/system01.dbf"; set newname for datafile 10 to "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/sysaux01.dbf"; set newname for datafile 11 to "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/undotbs01.dbf"; set newname for datafile 12 to "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/users01.dbf"; set newname for datafile 17 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/system01.dbf"; set newname for datafile 18 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/sysaux01.dbf"; set newname for datafile 19 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/undotbs01.dbf"; set newname for datafile 20 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/users01.dbf"; set newname for datafile 21 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/system01.dbf"; set newname for datafile 22 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/sysaux01.dbf"; set newname for datafile 23 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/undotbs01.dbf"; set newname for datafile 24 to "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/users01.dbf"; backup as copy reuse datafile 1 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/system01.dbf" datafile 3 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/sysaux01.dbf" datafile 4 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/undotbs01.dbf" datafile 5 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/pdbseed/system01.dbf" datafile 6 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/pdbseed/sysaux01.dbf" datafile 7 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/users01.dbf" datafile 8 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/pdbseed/undotbs01.dbf" datafile 9 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/system01.dbf" datafile 10 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/sysaux01.dbf" datafile 11 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/undotbs01.dbf" datafile 12 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/orclpdb/users01.dbf" datafile 17 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/system01.dbf" datafile 18 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/sysaux01.dbf" datafile 19 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/undotbs01.dbf" datafile 20 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/users01.dbf" datafile 21 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/system01.dbf" datafile 22 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/sysaux01.dbf" datafile 23 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/undotbs01.dbf" datafile 24 auxiliary format "/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/users01.dbf" ; } executing Memory Script executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME renamed tempfile 1 to /u01/app/oracle/oradata/ORCL_CLN/temp01.dbf in control file renamed tempfile 2 to /u01/app/oracle/oradata/ORCL_CLN/pdbseed/temp012020-05-08_23-03-27-674-PM.dbf in control file renamed tempfile 3 to /u01/app/oracle/oradata/ORCL_CLN/orclpdb/temp01.dbf in control file renamed tempfile 4 to /u01/app/oracle/oradata/ORCL_CLN/CLONETEST/temp012020-05-08_23-03-27-674-PM.dbf in control file renamed tempfile 5 to /u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/temp012020-05-08_23-03-27-674-PM.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 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 executing command: SET NEWNAME Starting backup at 23-MAY-20 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=379 device type=DISK channel ORA_DISK_1: starting datafile copy input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/system01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/system01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07 channel ORA_DISK_1: starting datafile copy input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/sysaux01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/sysaux01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/undotbs01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/undotbs01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00018 name=/u01/app/oracle/oradata/ORCL/CLONETEST/sysaux01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/sysaux01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00006 name=/u01/app/oracle/oradata/ORCL/pdbseed/sysaux01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/pdbseed/sysaux01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00010 name=/u01/app/oracle/oradata/ORCL/orclpdb/sysaux01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/orclpdb/sysaux01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00022 name=/u01/app/oracle/oradata/ORCL/CLONETEST_CL/sysaux01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/sysaux01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00005 name=/u01/app/oracle/oradata/ORCL/pdbseed/system01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/pdbseed/system01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00009 name=/u01/app/oracle/oradata/ORCL/orclpdb/system01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/orclpdb/system01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00017 name=/u01/app/oracle/oradata/ORCL/CLONETEST/system01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/system01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00021 name=/u01/app/oracle/oradata/ORCL/CLONETEST_CL/system01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/system01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03 channel ORA_DISK_1: starting datafile copy input datafile file number=00008 name=/u01/app/oracle/oradata/ORCL/pdbseed/undotbs01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/pdbseed/undotbs01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting datafile copy input datafile file number=00011 name=/u01/app/oracle/oradata/ORCL/orclpdb/undotbs01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/orclpdb/undotbs01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting datafile copy input datafile file number=00019 name=/u01/app/oracle/oradata/ORCL/CLONETEST/undotbs01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/undotbs01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting datafile copy input datafile file number=00023 name=/u01/app/oracle/oradata/ORCL/CLONETEST_CL/undotbs01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/undotbs01.dbf tag=TAG20200523T134843 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/app/oracle/oradata/ORCL/users01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/users01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting datafile copy input datafile file number=00012 name=/u01/app/oracle/oradata/ORCL/orclpdb/users01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/orclpdb/users01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:02 channel ORA_DISK_1: starting datafile copy input datafile file number=00020 name=/u01/app/oracle/oradata/ORCL/CLONETEST/users01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/users01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting datafile copy input datafile file number=00024 name=/u01/app/oracle/oradata/ORCL/CLONETEST_CL/users01.dbf output file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/users01.dbf tag=TAG20200523T134843 channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01 Finished backup at 23-MAY-20 contents of Memory Script: { switch clone datafile all; } executing Memory Script datafile 1 switched to datafile copy input datafile copy RECID=4 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/system01.dbf datafile 3 switched to datafile copy input datafile copy RECID=5 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/sysaux01.dbf datafile 4 switched to datafile copy input datafile copy RECID=6 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/undotbs01.dbf datafile 5 switched to datafile copy input datafile copy RECID=7 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/pdbseed/system01.dbf datafile 6 switched to datafile copy input datafile copy RECID=8 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/pdbseed/sysaux01.dbf datafile 7 switched to datafile copy input datafile copy RECID=9 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/users01.dbf datafile 8 switched to datafile copy input datafile copy RECID=10 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/pdbseed/undotbs01.dbf datafile 9 switched to datafile copy input datafile copy RECID=11 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/orclpdb/system01.dbf datafile 10 switched to datafile copy input datafile copy RECID=12 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/orclpdb/sysaux01.dbf datafile 11 switched to datafile copy input datafile copy RECID=13 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/orclpdb/undotbs01.dbf datafile 12 switched to datafile copy input datafile copy RECID=14 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/orclpdb/users01.dbf datafile 17 switched to datafile copy input datafile copy RECID=15 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/system01.dbf datafile 18 switched to datafile copy input datafile copy RECID=16 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/sysaux01.dbf datafile 19 switched to datafile copy input datafile copy RECID=17 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/undotbs01.dbf datafile 20 switched to datafile copy input datafile copy RECID=18 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST/users01.dbf datafile 21 switched to datafile copy input datafile copy RECID=19 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/system01.dbf datafile 22 switched to datafile copy input datafile copy RECID=20 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/sysaux01.dbf datafile 23 switched to datafile copy input datafile copy RECID=21 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/undotbs01.dbf datafile 24 switched to datafile copy input datafile copy RECID=22 STAMP=1041169771 file name=/u01/app/oracle/oradata/ORCL_CLN/CLONETEST_CL/users01.dbf contents of Memory Script: { sql clone "alter database datafile 1 online"; sql clone "alter database datafile 3 online"; sql clone "alter database datafile 4 online"; sql clone 'PDB$SEED' "alter database datafile 5 online"; sql clone 'PDB$SEED' "alter database datafile 6 online"; sql clone "alter database datafile 7 online"; sql clone 'PDB$SEED' "alter database datafile 8 online"; sql clone 'ORCLPDB' "alter database datafile 9 online"; sql clone 'ORCLPDB' "alter database datafile 10 online"; sql clone 'ORCLPDB' "alter database datafile 11 online"; sql clone 'ORCLPDB' "alter database datafile 12 online"; sql clone 'CLONETEST' "alter database datafile 17 online"; sql clone 'CLONETEST' "alter database datafile 18 online"; sql clone 'CLONETEST' "alter database datafile 19 online"; sql clone 'CLONETEST' "alter database datafile 20 online"; sql clone 'CLONETEST_CL' "alter database datafile 21 online"; sql clone 'CLONETEST_CL' "alter database datafile 22 online"; sql clone 'CLONETEST_CL' "alter database datafile 23 online"; sql clone 'CLONETEST_CL' "alter database datafile 24 online"; } executing Memory Script sql statement: alter database datafile 1 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 sql statement: alter database datafile 10 online sql statement: alter database datafile 11 online sql statement: alter database datafile 12 online sql statement: alter database datafile 17 online sql statement: alter database datafile 18 online sql statement: alter database datafile 19 online sql statement: alter database datafile 20 online sql statement: alter database datafile 21 online sql statement: alter database datafile 22 online sql statement: alter database datafile 23 online sql statement: alter database datafile 24 online Finished Duplicate Db at 23-MAY-20 RMAN> exit [/code]
CLONING COMPLETED.......
In TARGET check the instance details
[code] 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; > 2 NAME||'-'||INSTANCE_NAME||'@'||HOST_NAME||'-'||DB_UNIQUE_NAME||'-'||VERSION||''||OPEN_MODE||'-'||TO_CHAR(STARTUP_TIME,'DD-MON-YYYYHH24:MI:SS')||'-'||DATABASE_ROLE ------------------------------------------------------------------------------------------------------------------------------------------------------------------- ORCL - orcl_cln@clone.oracledbashop.com - orcl_cln - 19.0.0.0.0 MOUNTED - 23-MAY-2020 13:47:53 - PRIMARY [/code]
Database still in MOUNT mode, now make clone database read write
[code] SQL> alter database open resetlogs; Database altered. SQL> set linesize 256 SQL> 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; > 2 NAME||'-'||INSTANCE_NAME||'@'||HOST_NAME||'-'||DB_UNIQUE_NAME||'-'||VERSION||''||OPEN_MODE||'-'||TO_CHAR(STARTUP_TIME,'DD-MON-YYYYHH24:MI:SS')||'-'||DATABASE_ROLE ------------------------------------------------------------------------------------------------------------------------------------------------------------------- ORCL - orcl_cln@clone.oracledbashop.com - orcl_cln - 19.0.0.0.0 READ WRITE - 23-MAY-2020 13:47:53 - PRIMARY [/code]




No comments:
Post a Comment