Sunday, October 13, 2013

transporatable tablespace

#We have 2 database i will show how to do a tablespace transport from one database to another

# in source database
#1.create a tablespace and a user using that tablespace and create a table in the user

SQL> create tablespace test_tbs;

SQL> create user test identified by test123 default tablespace test_tbs;

SQL> grant connect,resource to test;

SQL> create table test.test_tbl as select * from dba_tables;

# take the tablespace read only mode
#1.take a metadata export of the tablespace
#2.move the datafile to desired location
#3.make tablespace again read write

SQL> alter tablespace TEST_TBS read only;

SQL> exec dbms_file_transfer.COPY_FILE('ASM_SOURCE','test_tbs.548.828809123','ASM_DEST','test_tbs.test');

PL/SQL procedure successfully completed.

[oracle@subhen_db EXPDP]$ expdp directory=EXPDP_DIR transport_tablespaces=TEST_TBS dumpfile=TEST_TBS.dmp logfile=TEST_TBS_exp.log REUSE_DUMPFILES=Y

#in target database
#try to import the dumpfile

[oracle@subhen_db EXPDP]$ cat import.par
directory=EXPDP_DIR
dumpfile=TEST_TBS.dmp
logfile=TEST_TBS_impdp.log
transport_datafiles='+DATA/TARGET_DB/DATAFILE/test_tbs.test'

#import failed as user doesnot exist

[oracle@subhen_db EXPDP]$ impdp parfile=import.par
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
ORA-39123: Data Pump transportable tablespace job aborted
ORA-29342: user TEST does not exist in the database

#create the user in the target database

SQL> create user test identified by test123;

# IMPORT it again

[oracle@subhen_db EXPDP]$ impdp parfile=import.par

Import: Release 11.2.0.3.0 - Production on Mon Oct 14 17:00:49 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Username: / as sysdba

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options
Master table "SYS"."SYS_IMPORT_TRANSPORTABLE_05" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_05":  /******** AS SYSDBA parfile=import.par
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_05" successfully completed at 17:01:18









Sunday, October 6, 2013

duplicate database creation in the same host from tape backup

Here original database name is ORCL which is running on the same host and we are creating a duplicate database (DUPDB) on that same host by utilizing the older tape backups available for that database.(auxiliary database should be the DUPDB)


[oracle@subhen-db01 dbs]$ cat initDUPDB.ora
db_name=DUPDB
sga_target=4G

[oracle@subhen-db01 dbs]$
[oracle@subhen-db01 dbs]$ echo $ORACLE_SID
DUPDB
[oracle@subhen-db01 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Oct 4 12:05:02 2013

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

Connected to an idle instance.

SQL> startup nomount pfile='initDUPDB.ora'
ORACLE instance started.

Total System Global Area 4275781632 bytes
Fixed Size                  2235208 bytes
Variable Size             822084792 bytes
Database Buffers         3439329280 bytes
Redo Buffers               12132352 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


[oracle@subhen-db01 admin]$ echo $ORACLE_SID
DUPDB


[oracle@subhen-db01 dbs]$ rman auxiliary / catalog CATALOG_SCHEMA/<password>@<catalog_DB>

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Oct 4 13:07:07 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database
connected to auxiliary database: DUPDB (not mounted)

RMAN> run
{
2> 3> allocate auxiliary channel c1 type 'SBT_TAPE' parms 'ENV=(NB_ORA_CLASS=XXXXXXXX, NB_ORA_SERV=XXXXXXXX, NB_ORA_SCHED=oracle,NB_ORA_CLIENT=<db host from where backup was taken>)';
4> DUPLICATE DATABASE ORCL DBID 1343XXXX to DUPDB UNTIL TIME "TO_DATE('04/10/2013 11:48:00','DD/MM/YYYY HH24:MI:SS')" SPFILE PARAMETER_VALUE_CONVERT="ORCL","DUPDB"
5> set cluster_database="FALSE"
set DB_UNIQUE_NAME="DUPDB"
6> 7> set db_create_file_dest="+DATA"
8> set instance_number="1"
9> set local_listener="LISTENER_DUPDB"
10> set REMOTE_LISTENER=''
11> set db_file_name_convert='+DATA/ORCL','+DATA/DUPDB'
set log_file_name_convert='+DATA/ORCL','+DATA/DUPDB'
12> 13> set control_files='+DATA'
14> set db_recovery_file_dest='+DATA'
15> NOFILENAMECHECK;
16> }

allocated channel: c1
channel c1: SID=429 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)

Starting Duplicate Db at 04-OCT-13

contents of Memory Script:
{
   set until scn  86339128;
   restore clone spfile to  '/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileDUPDB.ora';
   sql clone "alter system set spfile= ''/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileDUPDB.ora''";
}
executing Memory Script

executing command: SET until clause

Starting restore at 04-OCT-13

WARNING: A restore time was estimated based on the supplied UNTIL SCN
channel c1: starting datafile backup set restore
channel c1: restoring SPFILE
output file name=/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileDUPDB.ora
channel c1: reading from backup piece 0coktav9_1_2
channel c1: piece handle=0coktav9_1_2 tag=TAG20130927T124246
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:35
Finished restore at 04-OCT-13

sql statement: alter system set spfile= ''/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileDUPDB.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  audit_file_dest =
 ''/oracle/app/admin/DUPDB/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers =
 ''(PROTOCOL=TCP) (SERVICE=DUPDBXDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  cluster_database =
 FALSE comment=
 '''' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DUPDB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''+DATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  instance_number =
 1 comment=
 '''' scope=spfile";
   sql clone "alter system set  local_listener =
 ''LISTENER_DUPDB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  REMOTE_LISTENER =
 '''' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''+DATA/ORCL'', ''+DATA/DUPDB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''+DATA/ORCL'', ''+DATA/DUPDB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''+DATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''+DATA'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DUPDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  audit_file_dest =  ''/oracle/app/admin/DUPDB/adump'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=DUPDBXDB)'' comment= '''' scope=spfile

sql statement: alter system set  cluster_database =  FALSE comment= '''' scope=spfile

sql statement: alter system set  db_unique_name =  ''DUPDB'' comment= '''' scope=spfile

sql statement: alter system set  db_create_file_dest =  ''+DATA'' comment= '''' scope=spfile

sql statement: alter system set  instance_number =  1 comment= '''' scope=spfile

sql statement: alter system set  local_listener =  ''LISTENER_DUPDB'' comment= '''' scope=spfile

sql statement: alter system set  REMOTE_LISTENER =  '''' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''+DATA/ORCL'', ''+DATA/DUPDB'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''+DATA/ORCL'', ''+DATA/DUPDB'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''+DATA'' comment= '''' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''+DATA'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    4175568896 bytes

Fixed Size                     2234960 bytes
Variable Size               2231371184 bytes
Database Buffers            1929379840 bytes
Redo Buffers                  12582912 bytes
allocated channel: c1
channel c1: SID=386 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)

contents of Memory Script:
{
   set until scn  86339128;
   sql clone "alter system set  control_files =
  ''+DATA/dupdb/controlfile/current.613.827932157'' comment=
 ''Set by RMAN'' scope=spfile";
   sql clone "alter system set  db_name =
 ''ORCL'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DUPDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile;
   alter clone database mount;
}
executing Memory Script

executing command: SET until clause

sql statement: alter system set  control_files =   ''+DATA/dupdb/controlfile/XXXXXXXXXX'' comment= ''Set by RMAN'' scope=spfile

sql statement: alter system set  db_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''DUPDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    4175568896 bytes

Fixed Size                     2234960 bytes
Variable Size               2231371184 bytes
Database Buffers            1929379840 bytes
Redo Buffers                  12582912 bytes
allocated channel: c1
channel c1: SID=386 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)

Starting restore at 04-OCT-13

channel c1: starting datafile backup set restore
channel c1: restoring control file
channel c1: reading from backup piece 0coktav9_1_2
channel c1: piece handle=0coktav9_1_2 tag=TAG20130927T124246
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:35
output file name=+DATA/dupdb/controlfile/current.613.827932157
Finished restore at 04-OCT-13

database mounted
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
   set until scn  86339128;
   set newname for datafile  1 to
 "+DATA";
   set newname for datafile  2 to
 "+DATA";
   set newname for datafile  3 to
 "+DATA";
   set newname for datafile  4 to
 "+DATA";
   set newname for datafile  5 to
 "+DATA";
   set newname for datafile  6 to
 "+DATA";
   set newname for datafile  7 to
 "+DATA";
   set newname for datafile  8 to
 "+DATA";
   set newname for datafile  9 to
 "+DATA";
   set newname for datafile  10 to
 "+DATA";
   set newname for datafile  11 to
 "+DATA";
   set newname for datafile  12 to
 "+DATA";
   set newname for datafile  13 to
 "+DATA";
   set newname for datafile  14 to
 "+DATA";
   set newname for datafile  15 to
 "+DATA";
   set newname for datafile  16 to
 "+DATA";
   set newname for datafile  17 to
 "+DATA";
   set newname for datafile  18 to
 "+DATA";
   set newname for datafile  19 to
 "+DATA";
   set newname for datafile  20 to
 "+DATA";
   set newname for datafile  21 to
 "+DATA";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

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

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 04-OCT-13

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00005 to +DATA
channel c1: restoring datafile 00009 to +DATA
channel c1: restoring datafile 00014 to +DATA
channel c1: restoring datafile 00021 to +DATA
channel c1: reading from backup piece 0aoktapa_1_2
channel c1: piece handle=0aoktapa_1_2 tag=TAG20130927T124010
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:03:15
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00004 to +DATA
channel c1: restoring datafile 00013 to +DATA
channel c1: restoring datafile 00015 to +DATA
channel c1: restoring datafile 00016 to +DATA
channel c1: reading from backup piece 0koliake_1_2
channel c1: piece handle=0koliake_1_2 tag=TAG20131004T114617
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:02:45
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00003 to +DATA
channel c1: restoring datafile 00006 to +DATA
channel c1: restoring datafile 00010 to +DATA
channel c1: restoring datafile 00011 to +DATA
channel c1: reading from backup piece 0loliakg_1_2




channel c1: piece handle=0loliakg_1_2 tag=TAG20131004T114617
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 01:39:27
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00002 to +DATA
channel c1: reading from backup piece 0joliake_1_2
channel c1: piece handle=0joliake_1_2 tag=TAG20131004T114617
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:03:25
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00007 to +DATA
channel c1: restoring datafile 00017 to +DATA
channel c1: restoring datafile 00019 to +DATA
channel c1: restoring datafile 00020 to +DATA
channel c1: reading from backup piece 0noliam4_1_2
channel c1: piece handle=0noliam4_1_2 tag=TAG20131004T114617
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:45
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to +DATA
channel c1: restoring datafile 00008 to +DATA
channel c1: restoring datafile 00012 to +DATA
channel c1: restoring datafile 00018 to +DATA
channel c1: reading from backup piece 0molial7_1_2
channel c1: piece handle=0molial7_1_2 tag=TAG20131004T114617
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:24:46
Finished restore at 04-OCT-13

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=42 STAMP=827940402 file name=+DATA/dupdb/datafile/XXXXXXXXXX
datafile 2 switched to datafile copy
................
datafile 21 switched to datafile copy
input datafile copy RECID=62 STAMP=827940403 file name=+DATA/dupdb/datafile/XXXXXXXXXXXXXX

contents of Memory Script:
{
   set until time  "to_date('OCT 04 2013 11:48:00', 'MON DD YYYY HH24:MI:SS')";
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 04-OCT-13

starting media recovery

channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=3
channel c1: reading from backup piece 0foliahc_1_2


channel c1: piece handle=0foliahc_1_2 tag=TAG20131004T114443
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 01:54:58
archived log file name=+DATA/dupdb/archivelog/2013_10_04/thread_1_seq_3.730.827947277 thread=1 sequence=3
channel clone_default: deleting archived log(s)
archived log file name=+DATA/dupdb/archivelog/2013_10_04/thread_1_seq_3.730.827947277 RECID=20 STAMP=827947298
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=4
channel c1: reading from backup piece 0goliahc_1_2
channel c1: piece handle=0goliahc_1_2 tag=TAG20131004T114443
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 18:27:13
archived log file name=+DATA/dupdb/archivelog/2013_10_05/thread_1_seq_4.730.828013663 thread=1 sequence=4
channel clone_default: deleting archived log(s)
archived log file name=+DATA/dupdb/archivelog/2013_10_05/thread_1_seq_4.730.828013663 RECID=21 STAMP=828013729
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=5
channel c1: reading from backup piece 0holiahc_1_2
channel c1: piece handle=0holiahc_1_2 tag=TAG20131004T114443
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:02:45
archived log file name=+DATA/dupdb/archivelog/2013_10_05/thread_1_seq_5.730.828013865 thread=1 sequence=5
channel clone_default: deleting archived log(s)
archived log file name=+DATA/dupdb/archivelog/2013_10_05/thread_1_seq_5.730.828013865 RECID=22 STAMP=828013905
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=6
channel c1: reading from backup piece 0ioliahh_1_2
channel c1: piece handle=0ioliahh_1_2 tag=TAG20131004T114443
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:02:35
archived log file name=+DATA/dupdb/archivelog/2013_10_05/thread_1_seq_6.730.828014051 thread=1 sequence=6
channel clone_default: deleting archived log(s)
archived log file name=+DATA/dupdb/archivelog/2013_10_05/thread_1_seq_6.730.828014051 RECID=23 STAMP=828014058
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=7
channel c1: reading from backup piece 0poliap9_1_2
channel c1: piece handle=0poliap9_1_2 tag=TAG20131004T114854
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:02:25
archived log file name=+DATA/dupdb/archivelog/2013_10_05/thread_1_seq_7.730.828014201 thread=1 sequence=7
channel clone_default: deleting archived log(s)
archived log file name=+DATA/dupdb/archivelog/2013_10_05/thread_1_seq_7.730.828014201 RECID=24 STAMP=828014201
media recovery complete, elapsed time: 00:00:01
Finished recover at 05-OCT-13
Oracle instance started

Total System Global Area    4175568896 bytes

Fixed Size                     2234960 bytes
Variable Size               2231371184 bytes
Database Buffers            1929379840 bytes
Redo Buffers                  12582912 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DUPDB'' 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 =  ''DUPDB'' 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    4175568896 bytes

Fixed Size                     2234960 bytes
Variable Size               2231371184 bytes
Database Buffers            1929379840 bytes
Redo Buffers                  12582912 bytes
allocated channel: c1
channel c1: SID=387 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUPDB" RESETLOGS ARCHIVELOG
  MAXLOGFILES    576
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    96
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   2 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   3 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   4 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE
 DATAFILE
  '+DATA/dupdb/datafile/system.709.827940285'
 CHARACTER SET AL32UTF8

sql statement: ALTER DATABASE ADD LOGFILE



  INSTANCE 'i2'
  GROUP   5 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   6 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   7 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   8 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE
sql statement: ALTER DATABASE ADD LOGFILE






  INSTANCE 'i3'
  GROUP   9 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  10 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  11 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  12 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE
sql statement: ALTER DATABASE ADD LOGFILE









  INSTANCE 'i4'
  GROUP  13 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  14 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  15 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  16 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE

contents of Memory Script:
{
   set newname for tempfile  1 to
 "+DATA";
   set newname for tempfile  2 to
 "+DATA";
   set newname for tempfile  3 to
 "+DATA";
   set newname for tempfile  4 to
 "+DATA";
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATA/dupdb/datafile/sysaux.XXXXX",
 "+DATA/dupdb/datafile/undotbs1.366.827938583",
 ..............
................
 "+DATA/dupdb/datafile/XXXXXXXXXX.572.827932361";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to +DATA in control file
renamed tempfile 2 to +DATA in control file
renamed tempfile 3 to +DATA in control file
renamed tempfile 4 to +DATA in control file

cataloged datafile copy
datafile copy file name=+DATA/dupdb/datafile/XXXXXXXX RECID=1 STAMP=828014358
cataloged datafile copy
...........
............
cataloged datafile copy
datafile copy file name=+DATA/dupdb/datafile/XXXXXXXXXXXXX RECID=20 STAMP=828014359

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=828014358 file name=+DATA/dupdb/datafile/XXXXXXXXX
datafile 3 switched to datafile copy
............
...........
datafile 21 switched to datafile copy
input datafile copy RECID=20 STAMP=828014359 file name=+DATA/dupdb/datafile/XXXXXXXXXXXXXXXX
contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 05-OCT-13
released channel: c1

RMAN>

Thursday, October 3, 2013

database restore to a different host using tape and catalog database(using auxillary command)


[oracle@subhen-db01 dbs]$ cat initTESTDB.ora
db_name=TESTDB
sga_target=4G


rman auxiliary / catalog <catalog_username>/<catalog_password>@<catalog_database>
run
{
allocate auxiliary channel c1 type 'SBT_TAPE' parms 'ENV=(NB_ORA_CLASS=XXXXXXXX, NB_ORA_SERV=XXXXXXXX, NB_ORA_SCHED=oracle,NB_ORA_CLIENT=<database server from where backup was taken>)';
DUPLICATE DATABASE TESTDB DBID 1060152041 to TESTDB UNTIL TIME "TO_DATE('08/24/2013 02:00:00','MM/DD/YYYY HH24:MI:SS')" SPFILE PARAMETER_VALUE_CONVERT="TESTDB","TESTDB"
set cluster_database="FALSE"
set DB_UNIQUE_NAME="TESTDB"
set db_create_file_dest="+DATA"
set instance_number="1"
set local_listener="LISTENER_TESTDB"
set REMOTE_LISTENER=''
set db_file_name_convert='+DATA/TESTDB','+DATA/TESTDB'
set log_file_name_convert='+FRA/TESTDB','+DATA/TESTDB'
set control_files='+DATA'
set db_recovery_file_dest='+DATA'
NOFILENAMECHECK;
}



[oracle@subhen-db01 dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 19 17:28:18 2013

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

Connected to an idle instance.

SQL> startup nomount pfile='initTESTDB.ora';
ORACLE instance started.

Total System Global Area 4275781632 bytes
Fixed Size                  2235208 bytes
Variable Size             822084792 bytes
Database Buffers         3439329280 bytes
Redo Buffers               12132352 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@subhen-db01 dbs]$ rman auxiliary / catalog <catalog_username>/<catalog_password>@<catalog_database>

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Sep 19 17:28:49 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to recovery catalog database
connected to auxiliary database: TESTDB (not mounted)

RMAN> run
{
2> 3> allocate auxiliary channel c1 type 'SBT_TAPE' parms 'ENV=(NB_ORA_CLASS=XXXXXXXXX, NB_ORA_SERV=XXXXXXX, NB_ORA_SCHED=oracle,NB_ORA_CLIENT=<db server from where backup was taken>)';
4> DUPLICATE DATABASE TESTDB DBID 1060152041 to TESTDB UNTIL TIME "TO_DATE('08/24/2013 02:00:00','MM/DD/YYYY HH24:MI:SS')" SPFILE PARAMETER_VALUE_CONVERT="TESTDB","TESTDB"
5> set cluster_database="FALSE"
6> set DB_UNIQUE_NAME="TESTDB"
7> set db_create_file_dest="+DATA"
8> set instance_number="1"
9> set local_listener="LISTENER_TESTDB"
set REMOTE_LISTENER=''
10> 11> set db_file_name_convert='+DATA/TESTDB','+DATA/TESTDB'
12> set log_file_name_convert='+FRA/TESTDB','+DATA/TESTDB'
set control_files='+DATA'
13> 14> set db_recovery_file_dest='+DATA'
15> NOFILENAMECHECK;
16> }

allocated channel: c1
channel c1: SID=429 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)

Starting Duplicate Db at 19-SEP-13

contents of Memory Script:
{
   set until scn  82219484;
   restore clone spfile to  '/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileTESTDB.ora';
   sql clone "alter system set spfile= ''/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileTESTDB.ora''";
}
executing Memory Script

executing command: SET until clause

Starting restore at 19-SEP-13

WARNING: A restore time was estimated based on the supplied UNTIL SCN
channel c1: starting datafile backup set restore
channel c1: restoring SPFILE
output file name=/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileTESTDB.ora
channel c1: reading from backup piece c-1060152041-20130910-01
channel c1: piece handle=c-1060152041-20130910-01 tag=TAG20130910T013455
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:09:15
Finished restore at 19-SEP-13

sql statement: alter system set spfile= ''/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileTESTDB.ora''

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''TESTDB'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  audit_file_dest =
 ''/oracle/app/admin/TESTDB/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers =
 ''(PROTOCOL=TCP) (SERVICE=TESTDBXDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  cluster_database =
 FALSE comment=
 '''' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''TESTDB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''+DATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  instance_number =
 1 comment=
 '''' scope=spfile";
   sql clone "alter system set  local_listener =
 ''LISTENER_TESTDB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  REMOTE_LISTENER =
 '''' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''+DATA/TESTDB'', ''+DATA/TESTDB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''+FRA/TESTDB'', ''+DATA/TESTDB'' comment=
 '''' scope=spfile";
   sql clone "alter system set  control_files =
 ''+DATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''+DATA'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''TESTDB'' comment= ''duplicate'' scope=spfile

sql statement: alter system set  audit_file_dest =  ''/oracle/app/admin/TESTDB/adump'' comment= '''' scope=spfile

sql statement: alter system set  dispatchers =  ''(PROTOCOL=TCP) (SERVICE=TESTDBXDB)'' comment= '''' scope=spfile

sql statement: alter system set  cluster_database =  FALSE comment= '''' scope=spfile

sql statement: alter system set  db_unique_name =  ''TESTDB'' comment= '''' scope=spfile

sql statement: alter system set  db_create_file_dest =  ''+DATA'' comment= '''' scope=spfile

sql statement: alter system set  instance_number =  1 comment= '''' scope=spfile

sql statement: alter system set  local_listener =  ''LISTENER_TESTDB'' comment= '''' scope=spfile

sql statement: alter system set  REMOTE_LISTENER =  '''' comment= '''' scope=spfile

sql statement: alter system set  db_file_name_convert =  ''+DATA/TESTDB'', ''+DATA/TESTDB'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''+FRA/TESTDB'', ''+DATA/TESTDB'' comment= '''' scope=spfile

sql statement: alter system set  control_files =  ''+DATA'' comment= '''' scope=spfile

sql statement: alter system set  db_recovery_file_dest =  ''+DATA'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    4175568896 bytes

Fixed Size                     2234960 bytes
Variable Size               2231371184 bytes
Database Buffers            1929379840 bytes
Redo Buffers                  12582912 bytes
allocated channel: c1
channel c1: SID=386 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)

contents of Memory Script:
{
   set until scn  82219484;
   sql clone "alter system set  control_files =
  ''+DATA/TESTDB/controlfile/current.570.826565911'' comment=
 ''Set by RMAN'' scope=spfile";
   sql clone "alter system set  db_name =
 ''TESTDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''TESTDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile;
   alter clone database mount;
}
executing Memory Script

executing command: SET until clause

sql statement: alter system set  control_files =   ''+DATA/TESTDB/controlfile/current.570.826565911'' comment= ''Set by RMAN'' scope=spfile

sql statement: alter system set  db_name =  ''TESTDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''TESTDB'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area    4175568896 bytes

Fixed Size                     2234960 bytes
Variable Size               2231371184 bytes
Database Buffers            1929379840 bytes
Redo Buffers                  12582912 bytes
allocated channel: c1
channel c1: SID=386 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)

Starting restore at 19-SEP-13

channel c1: starting datafile backup set restore
channel c1: restoring control file
channel c1: reading from backup piece c-1060152041-20130824-01
channel c1: piece handle=c-1060152041-20130824-01 tag=TAG20130824T013750
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:02:15
output file name=+DATA/TESTDB/controlfile/current.570.826565911
Finished restore at 19-SEP-13

database mounted
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.

contents of Memory Script:
{
   set until scn  82219484;
   set newname for datafile  1 to
 "+DATA";
   set newname for datafile  2 to
 "+DATA";
   set newname for datafile  3 to
 "+DATA";
   set newname for datafile  4 to
 "+DATA";
   set newname for datafile  5 to
 "+DATA";
   set newname for datafile  6 to
 "+DATA";
   set newname for datafile  7 to
 "+DATA";
   set newname for datafile  8 to
 "+DATA";
   set newname for datafile  9 to
 "+DATA";
   set newname for datafile  10 to
 "+DATA";
   set newname for datafile  11 to
 "+DATA";
   set newname for datafile  12 to
 "+DATA";
   set newname for datafile  13 to
 "+DATA";
   set newname for datafile  14 to
 "+DATA";
   set newname for datafile  15 to
 "+DATA";
   set newname for datafile  16 to
 "+DATA";
   set newname for datafile  17 to
 "+DATA";
   set newname for datafile  18 to
 "+DATA";
   set newname for datafile  19 to
 "+DATA";
   set newname for datafile  20 to
 "+DATA";
   set newname for datafile  21 to
 "+DATA";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

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

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 19-SEP-13

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00004 to +DATA
channel c1: restoring datafile 00013 to +DATA
channel c1: restoring datafile 00015 to +DATA
channel c1: restoring datafile 00016 to +DATA
channel c1: reading from backup piece 2joi2dms_1_2
channel c1: piece handle=2joi2dms_1_2 tag=TAG20130824T011154
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:02:36
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00009 to +DATA
channel c1: restoring datafile 00010 to +DATA
channel c1: restoring datafile 00019 to +DATA
channel c1: restoring datafile 00020 to +DATA
channel c1: reading from backup piece 2loi2dms_1_2
channel c1: piece handle=2loi2dms_1_2 tag=TAG20130824T011154
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:45
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00006 to +DATA
channel c1: restoring datafile 00011 to +DATA
channel c1: restoring datafile 00012 to +DATA
channel c1: restoring datafile 00021 to +DATA
channel c1: reading from backup piece 2moi2dnc_1_2
channel c1: piece handle=2moi2dnc_1_2 tag=TAG20130824T011154
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:25
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00005 to +DATA
channel c1: restoring datafile 00007 to +DATA
channel c1: restoring datafile 00017 to +DATA
channel c1: restoring datafile 00018 to +DATA
channel c1: reading from backup piece 2noi2dnc_1_2
channel c1: piece handle=2noi2dnc_1_2 tag=TAG20130824T011154
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:25
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to +DATA
channel c1: restoring datafile 00003 to +DATA
channel c1: restoring datafile 00008 to +DATA
channel c1: restoring datafile 00014 to +DATA
channel c1: reading from backup piece 2koi2dms_1_2
channel c1: piece handle=2koi2dms_1_2 tag=TAG20130824T011154
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:55
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00002 to +DATA
channel c1: reading from backup piece 2ioi2dms_1_2
channel c1: piece handle=2ioi2dms_1_2 tag=TAG20130824T011154
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:04:25
Finished restore at 19-SEP-13

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=22 STAMP=826567036 file name=+DATA/TESTDB/datafile/system.514.826566731
datafile 2 switched to datafile copy
.............
.............
............
.............
datafile 21 switched to datafile copy
input datafile copy RECID=42 STAMP=826567038 file name=+DATA/TESTDB/datafile/nwbpam_soainfra.829.826566553

contents of Memory Script:
{
   set until time  "to_date('AUG 24 2013 02:00:00', 'MON DD YYYY HH24:MI:SS')";
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 19-SEP-13

starting media recovery

channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=4 sequence=145
channel c1: reading from backup piece 2ooi2dpc_1_2
channel c1: piece handle=2ooi2dpc_1_2 tag=TAG20130824T011314
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:35
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=2 sequence=143
channel c1: reading from backup piece 2poi2dpc_1_2
channel c1: piece handle=2poi2dpc_1_2 tag=TAG20130824T011314
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:03:45
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_2_seq_143.804.826567419 thread=2 sequence=143
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=148
channel c1: reading from backup piece 2qoi2dpc_1_2
channel c1: piece handle=2qoi2dpc_1_2 tag=TAG20130824T011314
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:06:25
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_1_seq_148.808.826567807 thread=1 sequence=148
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=3 sequence=137
channel c1: reading from backup piece 2roi2dpc_1_2
channel c1: piece handle=2roi2dpc_1_2 tag=TAG20130824T011314
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:05:15
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_3_seq_137.802.826568123 thread=3 sequence=137
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_4_seq_145.872.826567195 thread=4 sequence=145
channel clone_default: deleting archived log(s)
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_2_seq_143.804.826567419 RECID=575 STAMP=826567419
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=2 sequence=144
channel c1: reading from backup piece 2uoi48q3_1_2
channel c1: piece handle=2uoi48q3_1_2 tag=TAG20130824T180033
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:05:05
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_2_seq_144.804.826568419 thread=2 sequence=144
channel clone_default: deleting archived log(s)
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_3_seq_137.802.826568123 RECID=577 STAMP=826568123
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=3 sequence=138
channel c1: reading from backup piece 2voi48q3_1_2
channel c1: piece handle=2voi48q3_1_2 tag=TAG20130824T180033
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:03:15
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_3_seq_138.802.826568617 thread=3 sequence=138
channel clone_default: deleting archived log(s)
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_4_seq_145.872.826567195 RECID=574 STAMP=826567195
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=4 sequence=146
channel c1: reading from backup piece 30oi48q4_1_2
channel c1: piece handle=30oi48q4_1_2 tag=TAG20130824T180033
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:02:05
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_4_seq_146.872.826568753 thread=4 sequence=146
channel clone_default: deleting archived log(s)
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_1_seq_148.808.826567807 RECID=576 STAMP=826567806
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=149
channel c1: reading from backup piece 31oi48q4_1_2
channel c1: piece handle=31oi48q4_1_2 tag=TAG20130824T180033
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:35
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_1_seq_149.808.826568839 thread=1 sequence=149
channel clone_default: deleting archived log(s)
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_1_seq_149.808.826568839 RECID=581 STAMP=826568849
channel clone_default: deleting archived log(s)
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_2_seq_144.804.826568419 RECID=578 STAMP=826568431
channel clone_default: deleting archived log(s)
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_3_seq_138.802.826568617 RECID=579 STAMP=826568626
channel clone_default: deleting archived log(s)
archived log file name=+DATA/TESTDB/archivelog/2013_09_19/thread_4_seq_146.872.826568753 RECID=580 STAMP=826568754
media recovery complete, elapsed time: 00:00:01
Finished recover at 19-SEP-13
Oracle instance started

Total System Global Area    4175568896 bytes

Fixed Size                     2234960 bytes
Variable Size               2231371184 bytes
Database Buffers            1929379840 bytes
Redo Buffers                  12582912 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''TESTDB'' 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 =  ''TESTDB'' 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    4175568896 bytes

Fixed Size                     2234960 bytes
Variable Size               2231371184 bytes
Database Buffers            1929379840 bytes
Redo Buffers                  12582912 bytes
allocated channel: c1
channel c1: SID=387 device type=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TESTDB" RESETLOGS ARCHIVELOG
  MAXLOGFILES    576
  MAXLOGMEMBERS      3
  MAXDATAFILES     1024
  MAXINSTANCES    96
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   2 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   3 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   4 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE
 DATAFILE
  '+DATA/TESTDB/datafile/system.514.826566731'
 CHARACTER SET AL32UTF8

sql statement: ALTER DATABASE ADD LOGFILE



  INSTANCE 'i2'
  GROUP   5 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   6 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   7 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP   8 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE
sql statement: ALTER DATABASE ADD LOGFILE






  INSTANCE 'i3'
  GROUP   9 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  10 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  11 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  12 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE
sql statement: ALTER DATABASE ADD LOGFILE









  INSTANCE 'i4'
  GROUP  13 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  14 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  15 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE,
  GROUP  16 ( '+DATA', '+DATA' ) SIZE 512 M  REUSE

contents of Memory Script:
{
   set newname for tempfile  1 to
 "+DATA";
   set newname for tempfile  2 to
 "+DATA";
   set newname for tempfile  3 to
 "+DATA";
   set newname for tempfile  4 to
 "+DATA";
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATA/TESTDB/datafile/sysaux.883.826566839",
 "+DATA/TESTDB/datafile/undotbs1.482.826566733",
 ................
.................
.................
 "+DATA/TESTDB/datafile/nwbpam_soainfra.829.826566553";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

renamed tempfile 1 to +DATA in control file
renamed tempfile 2 to +DATA in control file
renamed tempfile 3 to +DATA in control file
renamed tempfile 4 to +DATA in control file

cataloged datafile copy
datafile copy file name=+DATA/TESTDB/datafile/sysaux.883.826566839 RECID=1 STAMP=826569338
cataloged datafile copy
..............
.............
cataloged datafile copy
datafile copy file name=+DATA/TESTDB/datafile/nwbpam_soainfra.829.826566553 RECID=20 STAMP=826569339

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=826569338 file name=+DATA/TESTDB/datafile/sysaux.883.826566839
datafile 3 switched to datafile copy
...................
..................
datafile 21 switched to datafile copy
input datafile copy RECID=20 STAMP=826569339 file name=+DATA/TESTDB/datafile/nwbpam_soainfra.829.826566553
Reenabling controlfile options for auxiliary database
Executing: alter database enable block change tracking using file '+DATA/TESTDB/changetracking/ctf.2593.821032547'
ORACLE error from auxiliary database: ORA-19751: could not create the change tracking file
ORA-19750: change tracking file: '+DATA/TESTDB/changetracking/ctf.2593.821032547'
ORA-17502: ksfdcre:4 Failed to create file +DATA/TESTDB/changetracking/ctf.2593.821032547
ORA-15046: ASM file name '+DATA/TESTDB/changetracking/ctf.2593.821032547' is not in single-file creation form

Ignoring error, reattempt command after duplicate finishes

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 19-SEP-13
released channel: c1

RMAN>