Duplicate PDB / Database 12c


Target CDB = ANAR_CDB12C1
Auxiliary CDB = ANAR_CDB12C3
PDB to duplicate = Only ANAR_PDB1
[bash-3.2$ ]$ rman target sys/<password>@ANAR_CDB12C1 auxiliary sys/<password>@ANAR_CDB12C3
Recovery Manager: Release 12.1.0.1.0 - Production on Sat Jul 20 13:15:57 2016
Copyright (c) 1982, 2016, Oracle and/or its affiliates. All rights reserved.
connected to target database: ANAR_CDB12C1 (DBID=2076797181)
connected to auxiliary database: ANAR_CDB12C3 (not mounted)
RMAN> duplicate target database to ANAR_CDB12C3 pluggable database ANAR_PDB1 from active database;
Starting Duplicate Db at 20-JUL-15
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=5 device type=DISK
current log archived
contents of Memory Script:
{
 sql clone "alter system set db_name = 
 ''ANAR_CDB12C1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
 sql clone "alter system set db_unique_name = 
 ''ANAR_CDB12C3'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
 shutdown clone immediate;
 startup clone force nomount
 restore clone from service 'ANAR_CDB12C1' primary controlfile;
 alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''ANAR_CDB12C1'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''ANAR_CDB12C3'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 417546240 bytes
Fixed Size 2289064 bytes
Variable Size 293601880 bytes
Database Buffers 113246208 bytes
Redo Buffers 8409088 bytes
Starting restore at 20-JUL-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=5 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/opt/oracle/app/oradata/ANAR_CDB12C3/control01.ctl
Finished restore at 20-JUL-15
database mounted
Skipping pluggable database PDB2
Automatically adding tablespace SYSTEM
Automatically adding tablespace SYSAUX
Automatically adding tablespace PDB$SEED:SYSTEM
Automatically adding tablespace PDB$SEED:SYSAUX
Automatically adding tablespace UNDOTBS1
Skipping tablespace USERS
contents of Memory Script:
{
 set newname for clone datafile 1 to new;
 set newname for clone datafile 3 to new;
 set newname for clone datafile 4 to new;
 set newname for clone datafile 5 to new;
 set newname for clone datafile 7 to new;
 set newname for clone datafile 21 to new;
 set newname for clone datafile 22 to new;
 restore
 from service 'ANAR_CDB12C1' clone database
 skip forever tablespace "USERS",
 "PDB2":"SYSTEM",
 "PDB2":"SYSAUX" ;
 sql 'alter system archive log current';
}
executing Memory Script
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 restore at 20-JUL-15
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_undotbs1_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00005 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00007 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00021 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00022 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_%u_.dbf
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
Finished restore at 20-JUL-15
sql statement: alter system archive log current
current log archived
contents of Memory Script:
{
 restore clone force from service 'ANAR_CDB12C1' 
 archivelog from scn 2534976;
 switch clone datafile all;
}
executing Memory Script
Starting restore at 20-JUL-15
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=97
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: using network backup set from service ANAR_CDB12C1
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=98
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 20-JUL-15
datafile 1 switched to datafile copy
input datafile copy RECID=10 STAMP=821279836 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_8ynwdjk0_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=11 STAMP=821279836 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwdqkh_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=12 STAMP=821279836 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_undotbs1_8ynwdynw_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=13 STAMP=821279836 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_8ynwf5kv_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=14 STAMP=821279836 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwf8lz_.dbf
datafile 21 switched to datafile copy
input datafile copy RECID=15 STAMP=821279836 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_8ynwfhny_.dbf
datafile 22 switched to datafile copy
input datafile copy RECID=16 STAMP=821279836 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwflo0_.dbf
contents of Memory Script:
{
 set until scn 2535061;
 recover
 clone database
 skip forever tablespace "USERS",
 "PDB2":"SYSTEM",
 "PDB2":"SYSAUX" delete archivelog
 ;
}
executing Memory Script
executing command: SET until clause
Starting recover at 20-JUL-15
using channel ORA_AUX_DISK_1
Executing: alter database datafile 6 offline drop
Executing: alter database datafile 23 offline drop
Executing: alter database datafile 24 offline drop
starting media recovery
archived log for thread 1 with sequence 97 is already on disk as file /opt/oracle/app/fast_recovery_area/ANAR_CDB12C3/archivelog/2016_07_20/o1_mf_1_97_8ynwft7h_.arc
archived log for thread 1 with sequence 98 is already on disk as file /opt/oracle/app/fast_recovery_area/ANAR_CDB12C3/archivelog/2016_07_20/o1_mf_1_98_8ynwfv8y_.arc
archived log file name=/opt/oracle/app/fast_recovery_area/ANAR_CDB12C3/archivelog/2016_07_20/o1_mf_1_97_8ynwft7h_.arc thread=1 sequence=97
archived log file name=/opt/oracle/app/fast_recovery_area/ANAR_CDB12C3/archivelog/2016_07_20/o1_mf_1_98_8ynwfv8y_.arc thread=1 sequence=98
media recovery complete, elapsed time: 00:00:00
Finished recover at 20-JUL-15
Oracle instance started
Total System Global Area 417546240 bytes
Fixed Size 2289064 bytes
Variable Size 293601880 bytes
Database Buffers 113246208 bytes
Redo Buffers 8409088 bytes
contents of Memory Script:
{
 sql clone "alter system set db_name = 
 ''ANAR_CDB12C3'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
 sql clone "alter system reset db_unique_name scope=spfile";
}
executing Memory Script
sql statement: alter system set db_name = ''ANAR_CDB12C3'' comment= ''Reset to original value by RMAN'' scope=spfile
sql statement: alter system reset db_unique_name scope=spfile
Oracle instance started
Total System Global Area 417546240 bytes
Fixed Size 2289064 bytes
Variable Size 293601880 bytes
Database Buffers 113246208 bytes
Redo Buffers 8409088 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ANAR_CDB12C3" RESETLOGS ARCHIVELOG 
 MAXLOGFILES 16
 MAXLOGMEMBERS 3
 MAXDATAFILES 1024
 MAXINSTANCES 8
 MAXLOGHISTORY 292
 LOGFILE
 GROUP 1 SIZE 50 M ,
 GROUP 2 SIZE 50 M ,
 GROUP 3 SIZE 50 M 
 DATAFILE
 '/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_8ynwdjk0_.dbf',
 '/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_8ynwf5kv_.dbf',
 '/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_system_8ynwfhny_.dbf'
 CHARACTER SET AL32UTF8
contents of Memory Script:
{
 set newname for clone tempfile 1 to new;
 set newname for clone tempfile 2 to new;
 set newname for clone tempfile 3 to new;
 switch clone tempfile all;
 catalog clone datafilecopy "/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwdqkh_.dbf", 
 "/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_undotbs1_8ynwdynw_.dbf", 
 "/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwf8lz_.dbf", 
 "/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwflo0_.dbf";
 switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
renamed tempfile 1 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 2 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_temp_%u_.tmp in control file
renamed tempfile 3 to /opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_temp_%u_.tmp in control file
cataloged datafile copy
datafile copy file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwdqkh_.dbf RECID=1 STAMP=821279854
cataloged datafile copy
datafile copy file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_undotbs1_8ynwdynw_.dbf RECID=2 STAMP=821279854
cataloged datafile copy
datafile copy file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwf8lz_.dbf RECID=3 STAMP=821279854
cataloged datafile copy
datafile copy file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwflo0_.dbf RECID=4 STAMP=821279854
datafile 3 switched to datafile copy
input datafile copy RECID=1 STAMP=821279854 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwdqkh_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=2 STAMP=821279854 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_undotbs1_8ynwdynw_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=3 STAMP=821279854 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwf8lz_.dbf
datafile 22 switched to datafile copy
input datafile copy RECID=4 STAMP=821279854 file name=/opt/oracle/app/oradata/ANAR_CDB12C3/datafile/o1_mf_sysaux_8ynwflo0_.dbf
contents of Memory Script:
{
 Alter clone database open resetlogs;
}
executing Memory Script
database opened
Executing: drop pluggable database "PDB2"
contents of Memory Script:
{
 sql clone "alter pluggable database all open";
}
executing Memory Script
sql statement: alter pluggable database all open
Dropping offline and skipped tablespaces
Executing: alter database default tablespace system
Executing: drop tablespace "USERS" including contents cascade constraints
Finished Duplicate Db at 20-JUL-15
RMAN>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: