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>

Tuesday, September 3, 2013

ORA-01194: ORA-01110: Controlfile is lost but everything else is in place(spfile,database files)

Controlfile is lost but everything else is in place(spfile,database files)


SQL> show parameter db_name

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_name                              string      ORCL


################################################################################
--Here i recreated the controlfile from other databases running in the same DB host to trace and modified content of the controlfile trace for the database file  PATH and NAME.
--sample as below

[oracle@orkxr2decmdb01 dbs]$ cat /oracle/app/diag/rdbms/blaoid2/BLAOID2/trace/control_file.sql
CREATE CONTROLFILE REUSE DATABASE "ORCL" RESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 (
    '+DATA/ORCL/ONLINELOG/group_1.576.823609463',
    '+DATA/ORCL/ONLINELOG/group_1.729.823609365'
  ) SIZE 512M BLOCKSIZE 512,
  GROUP 2 (
    '+DATA/ORCL/ONLINELOG/group_2.551.823609557',
    '+DATA/ORCL/ONLINELOG/group_2.634.823609655'
  ) SIZE 512M BLOCKSIZE 512
DATAFILE
  '+DATA/ORCL/DATAFILE/SYSAUX.511.823608335',
  '+DATA/ORCL/DATAFILE/SYSTEM.743.823607991',
  '+DATA/ORCL/DATAFILE/UNDOTBS1.585.823607993',
  '+DATA/ORCL/DATAFILE/UNDOTBS2.423.823608337',
  '+DATA/ORCL/DATAFILE/USERS.481.823607241'
 
CHARACTER SET AL32UTF8;
/

################################################################################



SQL> @/oracle/app/diag/rdbms/trace/control_file.sql

Control file created.


SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ORCL  MOUNTED              PRIMARY

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open


SQL> alter database open RESETLOGS;
alter database open RESETLOGS
*
ERROR at line 1:
ORA-01194: file 1 needs more recovery to be consistent
ORA-01110: data file 1: '+DATA/ORCL/datafile/system.743.823607991'


#####################################################################################
but in RMAN max archive sequence was 21only

RMAN> list archivelog all;

using target database control file instead of recovery catalog
List of Archived Log Copies for database with db_unique_name ORCL
=====================================================================

Key     Thrd Seq     S Low Time
------- ---- ------- - ---------
22      1    130     A 04-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_16/thread_1_seq_130.790.823609333

23      1    1       A 16-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_16/thread_1_seq_1.690.823612289

20      1    2       A 16-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_20/thread_1_seq_2.562.823955047

8       1    3       A 20-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_3.314.824833347

9       1    4       A 20-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_4.313.824833347

10      1    5       A 24-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_5.310.824833351

11      1    6       A 29-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_6.320.824837921

12      1    7       A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_7.626.824838523

13      1    8       A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_8.596.824838529

14      1    9       A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_9.762.824838537

15      1    10      A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_10.683.824838543

16      1    11      A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_11.628.824838547

17      1    12      A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_12.689.824838555

18      1    13      A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_13.522.824838687

19      1    14      A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_08_30/thread_1_seq_14.434.824838837

5       1    15      A 30-AUG-13
        Name: +DATA/ORCL/archivelog/2013_09_02/thread_1_seq_15.312.825037213

6       1    16      A 02-SEP-13
        Name: +DATA/ORCL/archivelog/2013_09_02/thread_1_seq_16.316.825098333

7       1    17      A 02-SEP-13
        Name: +DATA/ORCL/archivelog/2013_09_02/thread_1_seq_17.324.825098457

1       1    18      A 02-SEP-13
        Name: +DATA/ORCL/archivelog/2013_09_03/thread_1_seq_18.322.825161951

2       1    19      A 03-SEP-13
        Name: +DATA/ORCL/archivelog/2013_09_03/thread_1_seq_19.323.825162591

3       1    20      A 03-SEP-13
        Name: +DATA/ORCL/archivelog/2013_09_03/thread_1_seq_20.778.825163231

4       1    21      A 03-SEP-13
        Name: +DATA/ORCL/archivelog/2013_09_03/thread_1_seq_21.327.825163525



#####################################################################################

-- i tried to give the archivelog sequence 21 but it is looking for next sequence which doesnot exists so give the redolog file

SQL> recover database using backup controlfile;
ORA-00279: change 15642916 generated at 09/03/2013 12:05:24 needed for thread 1
ORA-00289: suggestion : +DATA
ORA-00280: change 15642916 for thread 1 is in sequence #22


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
+DATA/ORCL/archivelog/2013_09_03/thread_1_seq_21.327.825163525
ORA-00310: archived log contains sequence 21; sequence 22 required
ORA-00334: archived log:
'+DATA/ORCL/archivelog/2013_09_03/thread_1_seq_21.327.825163525'

###########################################################################

ASMCMD> pwd
+DATA/ORCL/ONLINELOG
ASMCMD> ls -ltr
WARNING:option 'r' is deprecated for 'ls'
please use 'reverse'

Type       Redund  Striped  Time             Sys  Name
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_1.576.823609463
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_1.729.823609365
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_2.551.823609557
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_2.634.823609655
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_3.395.824839135
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_3.421.824839137
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_4.617.824839139
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_4.699.824839143
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_5.315.825095933
ONLINELOG  UNPROT  COARSE   SEP 03 14:00:00  Y    group_5.319.825095935


############################################################################

SQL> recover database using backup controlfile;
ORA-00279: change 15642916 generated at 09/03/2013 12:05:24 needed for thread 1
ORA-00289: suggestion : +DATA
ORA-00280: change 15642916 for thread 1 is in sequence #22


Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
+DATA/ORCL/ONLINELOG/group_1.576.823609463
Log applied.
Media recovery complete.
SQL> alter database open resetlogs;

Database altered.

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ORCL  READ WRITE           PRIMARY

SQL> exit

Tuesday, August 27, 2013

RMAN-06094: datafile 1 must be restored

RMAN> restore database;

Starting restore at 28-AUG-13
using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA/ORCL/datafile/system.307.789559755
...............
.................
channel ORA_DISK_1: restoring datafile 00010 to +DATA/ORCL/datafile/olts_attrstore.312.789559757
channel ORA_DISK_1: reading from backup piece +DATA/ORCL/backup/ORCL_db_thoie5nb_1_1
channel ORA_DISK_1: piece handle=+DATA/ORCL/backup/ORCL_db_thoie5nb_1_1 tag=TAG20130828T120914
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:01:15
Finished restore at 28-AUG-13

RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

RMAN> recover database;

Starting recover at 28-AUG-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=429 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 08/28/2013 12:23:47
RMAN-06094: datafile 1 must be restored


******************************************************************************************************

******************************************************************************************************

[oracle@subhendb01 dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Aug 28 12:54:05 2013

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

connected to target database: ORCL (DBID=2248909719, not open)

RMAN> catalog start with '+DATA/ORCL/datafile/';

Starting implicit crosscheck backup at 28-AUG-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=386 device type=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 28-AUG-13

Starting implicit crosscheck copy at 28-AUG-13
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 28-AUG-13

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +DATA/ORCL/AUTOBACKUP/2013_08_28/s_824645393.441.824645393
File Name: +DATA/ORCL/DATAFILE/SYSAUX.317.824646107
File Name: +DATA/ORCL/DATAFILE/SYSTEM.318.824646107
File Name: +DATA/ORCL/DATAFILE/UNDOTBS1.328.824646107
File Name: +DATA/ORCL/DATAFILE/INTIDM_IAS_OIF.327.824646107
File Name: +DATA/ORCL/DATAFILE/OLTS_CT_STORE.326.824646109
File Name: +DATA/ORCL/DATAFILE/OLTS_ATTRSTORE.325.824646109
File Name: +DATA/ORCL/DATAFILE/OLTS_DEFAULT.324.824646109
File Name: +DATA/ORCL/DATAFILE/OLTS_SVRMGSTORE.323.824646109
File Name: +DATA/ORCL/DATAFILE/USERS.322.824646115
File Name: +DATA/ORCL/DATAFILE/OLTS_BATTRSTORE.321.824646115

searching for all files that match the pattern +DATA/ORCL/datafile/
no files found to be unknown to the database

RMAN> switch database to copy
2> ;

datafile 1 switched to datafile copy "+DATA/ORCL/datafile/system.318.824646107"
datafile 2 switched to datafile copy "+DATA/ORCL/datafile/sysaux.317.824646107"
datafile 3 switched to datafile copy "+DATA/ORCL/datafile/undotbs1.328.824646107"
datafile 4 switched to datafile copy "+DATA/ORCL/datafile/users.322.824646115"
datafile 5 switched to datafile copy "+DATA/ORCL/datafile/olts_default.324.824646109"
datafile 6 switched to datafile copy "+DATA/ORCL/datafile/intidm_ias_oif.327.824646107"
datafile 7 switched to datafile copy "+DATA/ORCL/datafile/olts_svrmgstore.323.824646109"
datafile 8 switched to datafile copy "+DATA/ORCL/datafile/olts_battrstore.321.824646115"
datafile 9 switched to datafile copy "+DATA/ORCL/datafile/olts_ct_store.326.824646109"
datafile 10 switched to datafile copy "+DATA/ORCL/datafile/olts_attrstore.325.824646109"

RMAN> recover database;

Starting recover at 28-AUG-13
using channel ORA_DISK_1

starting media recovery

channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=981
channel ORA_DISK_1: reading from backup piece +DATA/ORCL/backup/ORCL_arc_tioie5o9_1_1
channel ORA_DISK_1: piece handle=+DATA/ORCL/backup/ORCL_arc_tioie5o9_1_1 tag=TAG20130828T120944
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=+DATA/ORCL/archivelog/2013_08_28/thread_1_seq_981.320.824648181 thread=1 sequence=981
channel default: deleting archived log(s)
archived log file name=+DATA/ORCL/archivelog/2013_08_28/thread_1_seq_981.320.824648181 RECID=981 STAMP=824648181
unable to find archived log
archived log thread=1 sequence=982
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 08/28/2013 12:56:22
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 982 and starting SCN of 20072556

RMAN> sql 'alter database open resetlogs';

sql statement: alter database open resetlogs

RMAN> exit



restore database from disk without DBID

[oracle@subhendb01 dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Aug 28 15:12:16 2013

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

connected to target database (not started)

RMAN> startup

startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL.ora'

starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of startup command at 08/28/2013 15:12:28
ORA-00205: error in identifying control file, check alert log for more info

RMAN> restore spfile from autobackup recovery area '+DATA01' db_name 'ORCL';

Starting restore at 28-AUG-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=429 device type=DISK

recovery area destination: +DATA01
database name (or database unique name) used for search: ORCL
channel ORA_DISK_1: AUTOBACKUP +data01/ORCL/AUTOBACKUP/2013_08_28/s_824655882.307.824655883 found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring spfile from AUTOBACKUP +data01/ORCL/AUTOBACKUP/2013_08_28/s_824655882.307.824655883
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
Finished restore at 28-AUG-13

RMAN> shutdown immediate

Oracle instance shut down

RMAN> startup nomount

connected to target database (not started)
Oracle instance started

Total System Global Area    5344731136 bytes

Fixed Size                     2237776 bytes
Variable Size               4630514352 bytes
Database Buffers             704643072 bytes
Redo Buffers                   7335936 bytes

RMAN> restore controlfile from autobackup recovery area '+DATA01' db_name 'ORCL';

Starting restore at 28-AUG-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1149 device type=DISK

recovery area destination: +DATA01
database name (or database unique name) used for search: ORCL
channel ORA_DISK_1: AUTOBACKUP +data01/ORCL/AUTOBACKUP/2013_08_28/s_824655882.307.824655883 found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP +data01/ORCL/AUTOBACKUP/2013_08_28/s_824655882.307.824655883
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/oracle/app/database/11.2.0.3/dbhome_1/dbs/cntrlORCL.dbf
Finished restore at 28-AUG-13

RMAN> alter database mount
2> ;

database mounted
released channel: ORA_DISK_1

RMAN> restore database;

Starting restore at 28-AUG-13
Starting implicit crosscheck backup at 28-AUG-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=385 device type=DISK
Crosschecked 4 objects
Finished implicit crosscheck backup at 28-AUG-13

Starting implicit crosscheck copy at 28-AUG-13
using channel ORA_DISK_1
Crosschecked 2 objects
Finished implicit crosscheck copy at 28-AUG-13

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +data01/ORCL/AUTOBACKUP/2013_08_28/s_824645393.441.824645393
File Name: +data01/ORCL/AUTOBACKUP/2013_08_28/s_824648207.309.824648209
File Name: +data01/ORCL/AUTOBACKUP/2013_08_28/s_824655882.307.824655883

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to +DATA01/ORCL/datafile/system.314.824655691
...................
....................
channel ORA_DISK_1: piece handle=+DATA01/pptnwxbr/backup/pptnwxbr_db_thoie5nb_1_1 tag=TAG20130828T120914
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:36
Finished restore at 28-AUG-13

RMAN> recover database;

Starting recover at 28-AUG-13
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 981 is already on disk as file +DATA01/ORCL/archivelog/2013_08_28/thread_1_seq_981.326.824655769
archived log file name=+DATA01/ORCL/archivelog/2013_08_28/thread_1_seq_981.326.824655769 thread=1 sequence=981
unable to find archived log
archived log thread=1 sequence=1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 08/28/2013 15:17:43
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 1 and starting SCN of 20072557

RMAN> alter database open resetlogs;

database opened

Monday, August 26, 2013

Restore database to a different host using disk based backups

##### start database with dummy pfile

[oracle@subhendb dbs]$ vi initORCL.ora
[oracle@subhendb dbs]$ . oraenv
ORACLE_SID = [ORCL] ?
ORACLE_HOME = [/home/oracle] ? /oracle/app/database/11.2.0.3/dbhome_1
The Oracle base for ORACLE_HOME=/oracle/app/database/11.2.0.3/dbhome_1 is /oracle/app
[oracle@subhendb dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 16 10:49:11 2013

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

Connected to an idle instance.

SQL> startup nomount
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

#### restore the pfile from backup

[oracle@subhendb dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 16 10:49:57 2013

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

connected to target database: ORCL (not mounted)

RMAN>  set dbid 1363579986

executing command: SET DBID

RMAN> run{
allocate channel c1 device type disk;
restore spfile to pfile '/oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL.ora' from '/oracle/app/backup_ORCL/s_822546124.21617.822546137';
}2> 3> 4>

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=429 device type=DISK

Starting restore at 16-AUG-13

channel c1: restoring spfile from AUTOBACKUP /oracle/app/backup_ORCL/s_822546124.21617.822546137
channel c1: SPFILE restore from AUTOBACKUP complete
Finished restore at 16-AUG-13
released channel: c1

RMAN> exit


Recovery Manager complete.

Disconnected

##### modify the pfile for required parameter changes

[oracle@subhendb dbs]$ cp /oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL.ora /oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL.ora.bkp
[oracle@subhendb dbs]$ vi /oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL.ora

[oracle@subhendb dbs]$ cat initORCL.ora.bkp1
*.audit_file_dest='/oracle/app/admin/ORCL/adump'
*.audit_trail='db'
#*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATA01/ORCL/controlfile/current.1291.814453203','+DATA01/ORCL/controlfile/current.22974.814453203'
*.db_block_size=8192
*.db_create_file_dest='+DATA01'
*.db_domain=''
*.db_name='ORCL'
*.db_recovery_file_dest='+DATA01'
*.db_recovery_file_dest_size=5G
*.diagnostic_dest='/oracle/app'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=4G
*.open_cursors=300
*.processes=1000
#*.remote_listener='subhendbSCAN.esptest.aurtest.national.com.au:1621'
*.local_listener='LISTENER_ORCL'
*.remote_login_passwordfile='exclusive'
*.sessions=1105

[oracle@subhendb dbs]$ echo $ORACLE_SID
ORCL

[oracle@subhendb dbs]$ pwd
/oracle/app/database/11.2.0.3/dbhome_1/dbs

[oracle@subhendb admin]$ vi tnsnames.ora

### make the below entry to tnsnames.ora
LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = subhendb.espdev.aurdev.national.com.au)(PORT = 1621))

##### create dump directory

[oracle@subhendb admin]$ mkdir -p /oracle/app/admin/ORCL/adump

#### start the database using modified pfile

[oracle@subhendb admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 16 11:04:08 2013

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

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 4275781632 bytes
Fixed Size                  2235208 bytes
Variable Size            2298479800 bytes
Database Buffers         1962934272 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


###### create spfile from the pfile and start database using this spfile

[oracle@subhendb admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 16 11:04:23 2013

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


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

SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string
SQL> create spfile='/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileORCL' from pfile='/oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL.ora';

File created.

SQL> shu immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> exit
Disconnected from 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

##### start using spfile

[oracle@subhendb dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Fri Aug 16 11:09:39 2013

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

Connected to an idle instance.

SQL> startup nomount
ORACLE instance started.

Total System Global Area 4275781632 bytes
Fixed Size                  2235208 bytes
Variable Size            2298479800 bytes
Database Buffers         1962934272 bytes
Redo Buffers               12132352 bytes
SQL> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /oracle/app/database/11.2.0.3/
                                                 dbhome_1/dbs/spfileORCL.or
                                                 a
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@subhendb dbs]$ sleep 2d

[oracle@subhendb dbs]$ echo $ORACLE_SID
ORCL

#### restore control from from backup and mount database

[oracle@subhendb dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 16 11:19:01 2013

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

connected to target database: ORCL (not mounted)

RMAN> set dbid 1363579986

executing command: SET DBID

RMAN> run{
allocate channel c1 device type disk;
restore controlfile from '/oracle/app/backup_ORCL/s_822546124.21617.822546137';
}2> 3> 4>

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=7 device type=DISK

Starting restore at 16-AUG-13

channel c1: restoring control file
channel c1: restore complete, elapsed time: 00:00:01
output file name=+DATA01/ORCL/controlfile/current.778.823605623
output file name=+DATA01/ORCL/controlfile/current.609.823605623
Finished restore at 16-AUG-13
released channel: c1

RMAN> sql 'alter database mount'
2> ;

sql statement: alter database mount

RMAN> exit


Recovery Manager complete.

##### catalog backups and restore,recover database

[oracle@subhendb dbs]$ rman target /

Recovery Manager: Release 11.2.0.3.0 - Production on Fri Aug 16 11:21:06 2013

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

connected to target database: ORCL (DBID=1363579986, not open)

RMAN> catalog start with '/oracle/app/backup_ORCL/';

Starting implicit crosscheck backup at 16-AUG-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=7 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=769 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=1149 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=8 device type=DISK
Crosschecked 92 objects
Finished implicit crosscheck backup at 16-AUG-13

Starting implicit crosscheck copy at 16-AUG-13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
Finished implicit crosscheck copy at 16-AUG-13

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern /oracle/app/backup_ORCL/

List of Files Unknown to the Database
=====================================
File Name: /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4413.822546067
File Name: /oracle/app/backup_ORCL/annnf0_tag20130804t050153_0.9689.822546121
File Name: /oracle/app/backup_ORCL/annnf0_tag20130804t050153_0.21432.822546121
File Name: /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.20182.822546067
File Name: /oracle/app/backup_ORCL/s_822546124.21617.822546137
File Name: /oracle/app/backup_ORCL/annnf0_tag20130804t050101_0.23436.822546061
File Name: /oracle/app/backup_ORCL/annnf0_tag20130804t050101_0.13860.822546061
File Name: /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4984.822546067
File Name: /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.24077.822546067

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4413.822546067
File Name: /oracle/app/backup_ORCL/annnf0_tag20130804t050153_0.9689.822546121
File Name: /oracle/app/backup_ORCL/annnf0_tag20130804t050153_0.21432.822546121
File Name: /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.20182.822546067
File Name: /oracle/app/backup_ORCL/s_822546124.21617.822546137
File Name: /oracle/app/backup_ORCL/annnf0_tag20130804t050101_0.23436.822546061
File Name: /oracle/app/backup_ORCL/annnf0_tag20130804t050101_0.13860.822546061
File Name: /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4984.822546067
File Name: /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.24077.822546067

RMAN> restore database;

Starting restore at 16-AUG-13
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=770 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Veritas NetBackup for Oracle - Release 6.5 (2010042404)
allocated channel: ORA_SBT_TAPE_2
channel ORA_SBT_TAPE_2: SID=1150 device type=SBT_TAPE
channel ORA_SBT_TAPE_2: Veritas NetBackup for Oracle - Release 6.5 (2010042404)
allocated channel: ORA_SBT_TAPE_3
channel ORA_SBT_TAPE_3: SID=9 device type=SBT_TAPE
channel ORA_SBT_TAPE_3: Veritas NetBackup for Oracle - Release 6.5 (2010042404)
allocated channel: ORA_SBT_TAPE_4
channel ORA_SBT_TAPE_4: SID=389 device type=SBT_TAPE
channel ORA_SBT_TAPE_4: Veritas NetBackup for Oracle - Release 6.5 (2010042404)

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to +DATA/ORCL/datafile/users.1292.814453143
channel ORA_DISK_1: restoring datafile 00006 to +DATA/ORCL/datafile/nwxbrl_encrypted.1921.814725889
channel ORA_DISK_1: reading from backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4984.822546067
channel ORA_DISK_2: starting datafile backup set restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
channel ORA_DISK_2: restoring datafile 00007 to +DATA/ORCL/datafile/piddata.1586.819288133
channel ORA_DISK_2: restoring datafile 00008 to +DATA/ORCL/datafile/superstream.1827.819990123
channel ORA_DISK_2: restoring datafile 00010 to +DATA/ORCL/datafile/nwwsrm_tbs_encrypted.1449.821527815
channel ORA_DISK_2: restoring datafile 00013 to +DATA/ORCL/datafile/ebms3_tbs_encrypted.1544.821527975
channel ORA_DISK_2: reading from backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.20182.822546067
channel ORA_DISK_3: starting datafile backup set restore
channel ORA_DISK_3: specifying datafile(s) to restore from backup set
channel ORA_DISK_3: restoring datafile 00001 to +DATA/ORCL/datafile/system.1295.814453143
channel ORA_DISK_3: restoring datafile 00003 to +DATA/ORCL/datafile/undotbs1.1293.814453143
channel ORA_DISK_3: restoring datafile 00009 to +DATA/ORCL/datafile/nwebms3_tbs_encrypted.1450.821527793
channel ORA_DISK_3: restoring datafile 00012 to +DATA/ORCL/datafile/quartz_tbs_encrypted.1543.821527877
channel ORA_DISK_3: reading from backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.24077.822546067
channel ORA_DISK_4: starting datafile backup set restore
channel ORA_DISK_4: specifying datafile(s) to restore from backup set
channel ORA_DISK_4: restoring datafile 00002 to +DATA/ORCL/datafile/sysaux.1294.814453143
channel ORA_DISK_4: restoring datafile 00005 to +DATA/ORCL/datafile/undotbs2.1884.814453325
channel ORA_DISK_4: restoring datafile 00011 to +DATA/ORCL/datafile/afpo_soa_tbs_encrypted.1542.821527853
channel ORA_DISK_4: restoring datafile 00014 to +DATA/ORCL/datafile/wsrm_tbs_encrypted.1539.821527985
channel ORA_DISK_4: reading from backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4413.822546067
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 08/16/2013 11:23:00
ORA-19870: error while restoring backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4984.822546067
ORA-19913: unable to decrypt backup
ORA-28365: wallet is not open

###### copy the wallet file and try restore and recover again


RMAN>
RMAN> run{
allocate channel c1 device type disk;
restore database;
}

2> 3> 4>
allocated channel: c1
channel c1: SID=7 device type=DISK

Starting restore at 16-AUG-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/ORCL/datafile/users.1292.814453143
channel c1: restoring datafile 00006 to +DATA/ORCL/datafile/nwxbrl_encrypted.1921.814725889
channel c1: reading from backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4984.822546067
channel c1: piece handle=/oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4984.822546067 tag=TAG20130804T050105
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:06:45
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00007 to +DATA/ORCL/datafile/piddata.1586.819288133
channel c1: restoring datafile 00008 to +DATA/ORCL/datafile/superstream.1827.819990123
channel c1: restoring datafile 00010 to +DATA/ORCL/datafile/nwwsrm_tbs_encrypted.1449.821527815
channel c1: restoring datafile 00013 to +DATA/ORCL/datafile/ebms3_tbs_encrypted.1544.821527975
channel c1: reading from backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.20182.822546067
channel c1: piece handle=/oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.20182.822546067 tag=TAG20130804T050105
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:05: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/ORCL/datafile/system.1295.814453143
channel c1: restoring datafile 00003 to +DATA/ORCL/datafile/undotbs1.1293.814453143
channel c1: restoring datafile 00009 to +DATA/ORCL/datafile/nwebms3_tbs_encrypted.1450.821527793
channel c1: restoring datafile 00012 to +DATA/ORCL/datafile/quartz_tbs_encrypted.1543.821527877
channel c1: reading from backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.24077.822546067
channel c1: piece handle=/oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.24077.822546067 tag=TAG20130804T050105
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:05:45
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00002 to +DATA/ORCL/datafile/sysaux.1294.814453143
channel c1: restoring datafile 00005 to +DATA/ORCL/datafile/undotbs2.1884.814453325
channel c1: restoring datafile 00011 to +DATA/ORCL/datafile/afpo_soa_tbs_encrypted.1542.821527853
channel c1: restoring datafile 00014 to +DATA/ORCL/datafile/wsrm_tbs_encrypted.1539.821527985
channel c1: reading from backup piece /oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4413.822546067
channel c1: piece handle=/oracle/app/backup_ORCL/nnndn0_tag20130804t050105_0.4413.822546067 tag=TAG20130804T050105
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:06:05
Finished restore at 16-AUG-13
released channel: c1

RMAN>
RMAN>

RMAN>

RMAN> run{
allocate channel c1 device type disk;
recover database;
}2> 3> 4>

allocated channel: c1
channel c1: SID=7 device type=DISK

Starting recover at 16-AUG-13

starting media recovery

channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=2 sequence=125
channel c1: reading from backup piece /oracle/app/backup_ORCL/annnf0_tag20130804t050153_0.21432.822546121
channel c1: piece handle=/oracle/app/backup_ORCL/annnf0_tag20130804t050153_0.21432.822546121 tag=TAG20130804T050153
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:01
archived log file name=+DATA01/ORCL/archivelog/2013_08_16/thread_2_seq_125.729.823609331 thread=2 sequence=125
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=130
channel c1: reading from backup piece /oracle/app/backup_ORCL/annnf0_tag20130804t050153_0.9689.822546121
channel c1: piece handle=/oracle/app/backup_ORCL/annnf0_tag20130804t050153_0.9689.822546121 tag=TAG20130804T050153
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:00:01
archived log file name=+DATA01/ORCL/archivelog/2013_08_16/thread_1_seq_130.790.823609333 thread=1 sequence=130
channel default: deleting archived log(s)
archived log file name=+DATA01/ORCL/archivelog/2013_08_16/thread_2_seq_125.729.823609331 RECID=256 STAMP=823609331
unable to find archived log
archived log thread=2 sequence=126
released channel: c1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 08/16/2013 12:22:14
RMAN-06054: media recovery requesting unknown archived log for thread 2 with sequence 126 and starting SCN of 13935816

RMAN> sql 'alter database open resetlogs';

sql statement: alter database open resetlogs

RMAN> exit


Recovery Manager complete.
[oracle@subhendb dbs]$ sleep 2d



active database duplication from single host to RAC

# Added to the tnsnames.ora at source and destination server

ORCL1_SOURCE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = source_host.espdev.aurdev.national.com.au)(PORT = 1621))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = ORCL1)
    )
  )

#create a dummy pfile and start database in nomount state

[oracle@subhendb01 ~]$ echo $ORACLE_SID
ORCL1
[oracle@subhendb01 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu May 23 16:47:15 2013

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

Connected to an idle instance.

SQL> startup nomount pfile='/oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL1.ora'
ORACLE instance started.

Total System Global Area  413429760 bytes
Fixed Size                  2228784 bytes
Variable Size             301993424 bytes
Database Buffers          100663296 bytes
Redo Buffers                8544256 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
[oracle@subhendb01 ~]$ rman TARGET sys/xxxxxx@ORCL1_SOURCE AUXILIARY sys/xxxxxx@ORCL1_DESTINATION

Recovery Manager: Release 11.2.0.3.0 - Production on Thu May 23 16:47:48 2013

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

connected to target database: ORCL1 (DBID=1763963481)
connected to auxiliary database: ORCL1 (not mounted)

RMAN> duplicate TARGET DATABASE TO ORCL1 FROM ACTIVE DATABASE
NOFILENAMECHECK
SPFILE
PARAMETER_VALUE_CONVERT='ORCL1','ORCL1'
SET db_file_name_convert='+DATA01/ORCL1','+R2BDATA/ORCL1'
SET log_file_name_convert='+DATA01/ORCL1','+R2BDATA/ORCL1','+DATA01/ORCL1','+R2BFRA/ORCL1'
set db_create_file_dest= '+R2BDATA'
set cluster_database='FALSE'
set DB_UNIQUE_NAME='ORCL1'
set instance_number='1'
set db_recovery_file_dest='+R2BFRA'
set SGA_TARGET='3G'
set PGA_AGGREGATE_TARGET='2G'
set processes='500'
set local_listener='(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.40.4.25)(PORT=1621))))'
reset MEMORY_TARGET
reset memory_max_target
SET CONTROL_FILES='+R2BDATA/ORCL1/control01.ctl','+R2BFRA/ORCL1/control01.ctl';

Starting Duplicate Db at 23-MAY-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=194 device type=DISK

contents of Memory Script:
{
   backup as copy reuse
   targetfile  '+DATA01/ORCL1/spfileORCL1.ora' auxiliary format
 '/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileORCL1.ora'   ;
   sql clone "alter system set spfile= ''/oracle/app/database/11.2.0.3/dbhome_1/dbs/spfileORCL1.ora''";
}
executing Memory Script

Starting backup at 23-MAY-13
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1186 device type=DISK
Finished backup at 23-MAY-13

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

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''ORCL1'' comment=
 ''duplicate'' scope=spfile";
   sql clone "alter system set  audit_file_dest =
 ''/oracle/app/admin/ORCL1/adump'' comment=
 '''' scope=spfile";
   sql clone "alter system set  dispatchers =
 ''(PROTOCOL=TCP) (SERVICE=ORCL1XDB)'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_file_name_convert =
 ''+DATA01/ORCL1'', ''+R2BDATA/ORCL1'' comment=
 '''' scope=spfile";
   sql clone "alter system set  log_file_name_convert =
 ''+DATA01/ORCL1'', ''+R2BDATA/ORCL1'', ''+DATA01/ORCL1'', ''+R2BFRA/ORCL1'' comment=
 '''' scope=spfile";
   sql clone "alter system set  db_create_file_dest =
 ''+R2BDATA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  cluster_database =
 FALSE comment=
 '''' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCL1'' comment=
 '''' scope=spfile";
   sql clone "alter system set  instance_number =
 1 comment=
 '''' scope=spfile";
   sql clone "alter system set  db_recovery_file_dest =
 ''+R2BFRA'' comment=
 '''' scope=spfile";
   sql clone "alter system set  SGA_TARGET =
 3G comment=
 '''' scope=spfile";
   sql clone "alter system set  PGA_AGGREGATE_TARGET =
 2G comment=
 '''' scope=spfile";
   sql clone "alter system set  processes =
 500 comment=
 '''' scope=spfile";
   sql clone "alter system set  local_listener =
 ''(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xx.xx.xx.25)(PORT=1621))))'' comment=
 '''' scope=spfile";
   sql clone "alter system reset  MEMORY_TARGET scope=spfile";
   sql clone "alter system reset  memory_max_target scope=spfile";
   sql clone "alter system set  CONTROL_FILES =
 ''+R2BDATA/ORCL1/control01.ctl'', ''+R2BFRA/ORCL1/control01.ctl'' comment=
 '''' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

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

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

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

sql statement: alter system set  db_file_name_convert =  ''+DATA01/ORCL1'', ''+R2BDATA/ORCL1'' comment= '''' scope=spfile

sql statement: alter system set  log_file_name_convert =  ''+DATA01/ORCL1'', ''+R2BDATA/ORCL1'', ''+DATA01/ORCL1'', ''+R2BFRA/ORCL1'' comment= '''' scope=spfile

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

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

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

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

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

sql statement: alter system set  SGA_TARGET =  3G comment= '''' scope=spfile

sql statement: alter system set  PGA_AGGREGATE_TARGET =  2G comment= '''' scope=spfile

sql statement: alter system set  processes =  500 comment= '''' scope=spfile

sql statement: alter system set  local_listener =  ''(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.40.4.25)(PORT=1621))))'' comment= '''' scope=spfile

sql statement: alter system reset  MEMORY_TARGET scope=spfile

sql statement: alter system reset  memory_max_target scope=spfile

sql statement: alter system set  CONTROL_FILES =  ''+R2BDATA/ORCL1/control01.ctl'', ''+R2BFRA/ORCL1/control01.ctl'' comment= '''' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    3206836224 bytes

Fixed Size                     2232640 bytes
Variable Size               1291849408 bytes
Database Buffers            1895825408 bytes
Redo Buffers                  16928768 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''ORCL1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCL1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '+R2BDATA/ORCL1/control01.ctl';
   restore clone controlfile to  '+R2BFRA/ORCL1/control01.ctl' from
 '+R2BDATA/ORCL1/control01.ctl';
   alter clone database mount;
}
executing Memory Script

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area    3206836224 bytes

Fixed Size                     2232640 bytes
Variable Size               1291849408 bytes
Database Buffers            1895825408 bytes
Redo Buffers                  16928768 bytes

Starting backup at 23-MAY-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/oracle/app/database/11.2.0.3/dbhome_1/dbs/snapcf_ORCL1.f tag=TAG20130523T164830 RECID=4 STAMP=816194910
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 23-MAY-13

Starting restore at 23-MAY-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=425 device type=DISK

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 23-MAY-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 newname for datafile  1 to
 "+r2bdata";
   set newname for datafile  2 to
 "+r2bdata";
   set newname for datafile  3 to
 "+r2bdata";
   set newname for datafile  4 to
 "+r2bdata";
   set newname for datafile  5 to
 "+r2bdata";
   set newname for datafile  6 to
 "+r2bdata";
   set newname for datafile  7 to
 "+r2bdata";
   set newname for datafile  8 to
 "+r2bdata";
   set newname for datafile  9 to
 "+r2bdata";
   set newname for datafile  10 to
 "+r2bdata";
   set newname for datafile  11 to
 "+r2bdata";
   set newname for datafile  12 to
 "+r2bdata";
   set newname for datafile  13 to
 "+r2bdata";
   set newname for datafile  14 to
 "+r2bdata";
   set newname for datafile  15 to
 "+r2bdata";
   set newname for datafile  16 to
 "+r2bdata";
   set newname for datafile  17 to
 "+r2bdata";
   set newname for datafile  18 to
 "+r2bdata";
   backup as copy reuse
   datafile  1 auxiliary format
 "+r2bdata"   datafile
 2 auxiliary format
 "+r2bdata"   datafile
 3 auxiliary format
 "+r2bdata"   datafile
 4 auxiliary format
 "+r2bdata"   datafile
 5 auxiliary format
 "+r2bdata"   datafile
 6 auxiliary format
 "+r2bdata"   datafile
 7 auxiliary format
 "+r2bdata"   datafile
 8 auxiliary format
 "+r2bdata"   datafile
 9 auxiliary format
 "+r2bdata"   datafile
 10 auxiliary format
 "+r2bdata"   datafile
 11 auxiliary format
 "+r2bdata"   datafile
 12 auxiliary format
 "+r2bdata"   datafile
 13 auxiliary format
 "+r2bdata"   datafile
 14 auxiliary format
 "+r2bdata"   datafile
 15 auxiliary format
 "+r2bdata"   datafile
 16 auxiliary format
 "+r2bdata"   datafile
 17 auxiliary format
 "+r2bdata"   datafile
 18 auxiliary format
 "+r2bdata"   ;
   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

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-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA01/ORCL1/datafile/sysaux.281.789556875
output file name=+R2BDATA/ORCL1/datafile/sysaux.3216.816194921 tag=TAG20130523T164841
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
.............
.............
.............
input datafile file number=00004 name=+DATA01/ORCL1/datafile/users.283.789556875
output file name=+R2BDATA/ORCL1/datafile/users.3233.816195025 tag=TAG20130523T164841
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 23-MAY-13

sql statement: alter system archive log current

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "+DATA01/ORCL1/archivelog/2013_05_23/thread_1_seq_2293.359.816195027" auxiliary format
 "+R2BFRA"   ;
   catalog clone start with  "+R2BFRA";
   switch clone datafile all;
}
executing Memory Script

Starting backup at 23-MAY-13
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=2293 RECID=2290 STAMP=816195026
output file name=+R2BFRA/ORCL1/archivelog/2013_05_23/thread_1_seq_2293.15585.816195029 RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 23-MAY-13

searching for all files that match the pattern +R2BFRA

List of Files Unknown to the Database
=====================================
File Name: +r2bfra/CISOCH/CONTROLFILE/Backup.24219.816194287
File Name: +r2bfra/SNAPCF_DIR/snapcf_st6cas.f
File Name: +r2bfra/SNAPCF_DIR/snapcf_st66is.f


..................
..................
...................
File Name: +r2bfra/R2BINT/ONLINELOG/group_32.12018.815937759
  RMAN-07518: Reason: Foreign database file DBID: 2361498805  Database Name: R2BINT
File Name: +r2bfra/R2BINT/CONTROLFILE/Current.256.797689781
  RMAN-07518: Reason: Foreign database file DBID: 2361498805  Database Name: R2BINT

datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=816195536 file name=+R2BDATA/ORCL1/datafile/system.3217.816194947
datafile 2 switched to datafile copy
input datafile copy RECID=5 STAMP=816195536 file name=+R2BDATA/ORCL1/datafile/sysaux.3216.816194921
datafile 3 switched to datafile copy
...................
...................
....................
input datafile copy RECID=19 STAMP=816195537 file name=+R2BDATA/ORCL1/datafile/ecmcons_ocssearch.3225.816195005
datafile 17 switched to datafile copy
input datafile copy RECID=20 STAMP=816195537 file name=+R2BDATA/ORCL1/datafile/ecmcont_ocssearch.3226.816195009
datafile 18 switched to datafile copy
input datafile copy RECID=21 STAMP=816195537 file name=+R2BDATA/ORCL1/datafile/ecmcont_ocs.3219.816194969

contents of Memory Script:
{
   set until scn  46199166;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 23-MAY-13
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 2293 is already on disk as file +R2BFRA/ORCL1/archivelog/2013_05_23/thread_1_seq_2293.15585.816195029
archived log file name=+R2BFRA/ORCL1/archivelog/2013_05_23/thread_1_seq_2293.15585.816195029 thread=1 sequence=2293
media recovery complete, elapsed time: 00:00:00
Finished recover at 23-MAY-13
Oracle instance started

Total System Global Area    3206836224 bytes

Fixed Size                     2232640 bytes
Variable Size               1291849408 bytes
Database Buffers            1895825408 bytes
Redo Buffers                  16928768 bytes

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

Fixed Size                     2232640 bytes
Variable Size               1291849408 bytes
Database Buffers            1895825408 bytes
Redo Buffers                  16928768 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "ORCL1" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1 ( '+r2bdata', '+r2bdata' ) SIZE 50 M  REUSE,
  GROUP   2 ( '+r2bdata', '+r2bdata' ) SIZE 50 M  REUSE,
  GROUP   3 ( '+r2bdata', '+r2bdata' ) SIZE 50 M  REUSE
 DATAFILE
  '+R2BDATA/ORCL1/datafile/system.3217.816194947'
 CHARACTER SET AL32UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to
 "+r2bdata";
   set newname for tempfile  2 to
 "+r2bdata";
   set newname for tempfile  3 to
 "+r2bdata";
   set newname for tempfile  4 to
 "+r2bdata";
   set newname for tempfile  5 to
 "+r2bdata";
   set newname for tempfile  6 to
 "+r2bdata";
   set newname for tempfile  7 to
 "+r2bdata";
   switch clone tempfile all;
   catalog clone datafilecopy  "+R2BDATA/ORCL1/datafile/sysaux.3216.816194921",
 "+R2BDATA/ORCL1/datafile/undotbs1.3224.816195003",
 "+R2BDATA/ORCL1/datafile/users.3233.816195025",

 ......................
.......................
...................
 "+R2BDATA/ORCL1/datafile/ecmcont_ocssearch.3226.816195009",
 "+R2BDATA/ORCL1/datafile/ecmcont_ocs.3219.816194969";
   switch clone datafile all;
}
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

renamed tempfile 1 to +r2bdata in control file
renamed tempfile 2 to +r2bdata in control file
renamed tempfile 3 to +r2bdata in control file
renamed tempfile 4 to +r2bdata in control file
renamed tempfile 5 to +r2bdata in control file
renamed tempfile 6 to +r2bdata in control file
renamed tempfile 7 to +r2bdata in control file

cataloged datafile copy
datafile copy file name=+R2BDATA/ORCL1/datafile/sysaux.3216.816194921 RECID=1 STAMP=816195564
......................
......................
cataloged datafile copy
datafile copy file name=+R2BDATA/ORCL1/datafile/ecmcont_ocs.3219.816194969 RECID=17 STAMP=816195564

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=816195564 file name=+R2BDATA/ORCL1/datafile/sysaux.3216.816194921
datafile 3 switched to datafile copy
................
................

datafile 18 switched to datafile copy
input datafile copy RECID=17 STAMP=816195564 file name=+R2BDATA/ORCL1/datafile/ecmcont_ocs.3219.816194969

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

database opened
Finished Duplicate Db at 23-MAY-13

RMAN>



Wednesday, July 10, 2013

Tape Database backup restore to a different Host/cluster

restoring a RAC database to single instance on separate cluster/NODE with different file/ASM path from tape

--list of tape backup taken to tape

6688    B  F  A SBT_TAPE    09-JUL-13       1       1       NO         TAG20130709T152555
6689    B  F  A SBT_TAPE    09-JUL-13       1       1       YES        FULLDBORCL_9JULY13
6690    B  F  A SBT_TAPE    09-JUL-13       1       1       YES        FULLDBORCL_9JULY13
6691    B  A  A SBT_TAPE    09-JUL-13       1       1       YES        ARCHIVELOGORCL_9JULY13
6692    B  A  A SBT_TAPE    09-JUL-13       1       1       YES        ARCHIVELOGORCL_9JULY13
6693    B  F  A SBT_TAPE    09-JUL-13       1       1       YES        ORCL_CONTROLFILE
6694    B  F  A SBT_TAPE    09-JUL-13       1       1       NO         TAG20130709T153601

=========================================================================================================================================
BACKUP INFORMATION DETAILS from RMAN PROMPT (NOTE: the last SCN in archivelog backup is 93413348 this would be used in recovery purpose)
=========================================================================================================================================

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6689    Full    262.00M    SBT_TAPE    00:04:25     09-JUL-13
        BP Key: 6689   Status: AVAILABLE  Compressed: YES  Tag: FULLDBORCL_9JULY13
        Handle: peoeamcb_1_1   Media: Z05723
  List of Datafiles in backup set 6689
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  3       Full 93412607   09-JUL-13 +SDATA/ORCL/datafile/undotbs1.389.812985451
................
...................
...................
  32      Full 93412607   09-JUL-13 +SDATA/ORCL/datafile/undotbs4.3054.815489519

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6690    Full    761.00M    SBT_TAPE    00:07:06     09-JUL-13
        BP Key: 6690   Status: AVAILABLE  Compressed: YES  Tag: FULLDBORCL_9JULY13
        Handle: pdoeamca_1_1   Media: X08001
  List of Datafiles in backup set 6690
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1       Full 93412598   09-JUL-13 +SDATA/ORCL/datafile/system.387.812985451
 .............
...............
..............
  30      Full 93412598   09-JUL-13 +SDATA/ORCL/datafile/wcc_cons.399.812985475

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6691    512.00K    SBT_TAPE    00:02:49     09-JUL-13
        BP Key: 6691   Status: AVAILABLE  Compressed: YES  Tag: ARCHIVELOGORCL_9JULY13
        Handle: pgoeampp_1_1   Media: X08878

  List of Archived Logs in backup set 6691
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  2    535     93412208   09-JUL-13 93413354   09-JUL-13

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
6692    512.00K    SBT_TAPE    00:02:49     09-JUL-13
        BP Key: 6692   Status: AVAILABLE  Compressed: YES  Tag: ARCHIVELOGORCL_9JULY13
        Handle: phoeampp_1_1   Media: X08001

  List of Archived Logs in backup set 6692
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    524     93412212   09-JUL-13 93413348   09-JUL-13

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6693    Full    1.25M      SBT_TAPE    00:01:53     09-JUL-13
        BP Key: 6693   Status: AVAILABLE  Compressed: YES  Tag: ORCL_CONTROLFILE
        Handle: pioeamva_1_1   Media: X08001
  Control File Included: Ckp SCN: 93413596     Ckp time: 09-JUL-13

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6694    Full    23.50M     SBT_TAPE    00:01:27     09-JUL-13
        BP Key: 6694   Status: AVAILABLE  Compressed: NO  Tag: TAG20130709T153601
        Handle: c-3319723476-20130709-02   Media: X08001
  SPFILE Included: Modification time: 20-JUN-13
  SPFILE db_unique_name: ORCL
  Control File Included: Ckp SCN: 93413798     Ckp time: 09-JUL-13

====================================================================================

--restoring the spfile in destination host/cluster

[export the database name]

[oracle@osubhen-db01 ~]$ . oraenv
ORACLE_SID = [BLAINT1] ? ORCL
ORACLE_HOME = [/home/oracle] ? /oracle/app/database/11.2.0.3/dbhome_1
The Oracle base for ORACLE_HOME=/oracle/app/database/11.2.0.3/dbhome_1 is /oracle/app

[connect to destination database as well to recovery catalog]
[resync the tape backup to recovery catalog(resync catalog) so that we can be able to see the backups from destination server]

[oracle@osubhen-db01 ~]$ rman target / catalog RCAT_OWNER/RC112cat@DEVRCAT

Recovery Manager: Release 11.2.0.3.0 - Production on Thu Jul 11 10:31:53 2013

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

connected to target database (not started)
connected to recovery catalog database

-- set the DBID for the destination database (can find it in autobackup of controlfile)

RMAN> set dbid 3319723476

executing command: SET DBID
database name is "ORCL" and DBID is 3319723476

--restore spfile to pfile and modify accordingly

RMAN>
run{
allocate channel c1 type 'SBT_TAPE' parms 'ENV=(NB_ORA_CLASS=x-xxxx-xx-ora-3m-2,NB_ORA_SERV=server.domain.com,NB_ORA_CLIENT= source_server.com.au,NB_ORA_SCHED=oracle_5_years)';
restore spfile to pfile '/oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL.ora' from tag 'TAG20130709T153601';
}

--sample pfile after modification (note here local_listener change we need to make entry in tnsnames.ora file as well)

[oracle@osubhen-db01 dbs]$ cat initORCL.ora
*.audit_file_dest='/oracle/app/admin/ORCL/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_file_record_keep_time=31
*.control_files='+DATA01/ORCL/controlfile/current.285.789557145','+DATA01/ORCL/controlfile/current.284.789557145'
*.db_block_size=8192
*.db_create_file_dest='+DATA01'
*.db_domain=''
*.db_name='ORCL'
*.db_recovery_file_dest='+DATA01'
*.db_recovery_file_dest_size=10G
*.diagnostic_dest='/oracle/app'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=3000
*.pga_aggregate_target=2G
*.processes=2000
*.remote_login_passwordfile='exclusive'
*.local_listener='LISTENER_ORCL'
*.sessions=2205
*.sga_max_size=4G
*.sga_target=3G

--entry in tnsnames.ora file for local listener
LISTENER_ORCL =
  (ADDRESS = (PROTOCOL = TCP)(HOST = osubhen-db01.espdev.aurdev.national.com.au)(PORT = 1621))


-- start the instance in nomount state with the modified pfile

RMAN> startup nomount pfile='/oracle/app/database/11.2.0.3/dbhome_1/dbs/initORCL.ora'

Oracle instance started

Total System Global Area    4275781632 bytes

Fixed Size                     2235208 bytes
Variable Size               1728054456 bytes
Database Buffers            2533359616 bytes
Redo Buffers                  12132352 bytes

--restore the control file from tape

RMAN> run{
allocate channel c1 type 'SBT_TAPE' parms 'ENV=(NB_ORA_CLASS=x-xxxx-xx-ora-3m-2,NB_ORA_SERV=server.domain.com,NB_ORA_CLIENT= orkxdr2bintdb03-mgtespdev.aurdev.national.com.au,NB_ORA_SCHED=oracle_5_years)';
restore controlfile from tag 'ORCL_CONTROLFILE';
}

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

Starting restore at 11-JUL-13

channel c1: starting datafile backup set restore
channel c1: restoring control file
channel c1: reading from backup piece pioeamva_1_1
channel c1: piece handle=pioeamva_1_1 tag=ORCL_CONTROLFILE
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:25
output file name=+DATA01/ORCL/controlfile/current.631.820492623
output file name=+DATA01/ORCL/controlfile/current.550.820492623
Finished restore at 11-JUL-13
released channel: c1

--mount the database

RMAN> alter database mount;

database mounted

-- run the restore command to restore from tape
--note: here we might need to rename the database files to match the new path/ASM in destination server

run{
allocate channel c1 type 'SBT_TAPE' parms 'ENV=(NB_ORA_CLASS=x-xxxx-xx-ora-3m-2,NB_ORA_SERV=server.domain.com,NB_ORA_CLIENT=source_server.com.au,NB_ORA_SCHED=oracle_5_years)';
set newname for datafile 1 to    '+DATA01/ORCL/datafile/system.387.812985451';
...............
..............
...............
set newname for datafile 32 to    '+DATA01/ORCL/datafile/undotbs4.3054.815489519';

set until SCN 93413348; /**** comment: this SCN can be found from archivelog backup **** /
restore database from tag 'FULLDBORCL_9JULY13';
switch datafile all;
recover database from tag 'ARCHIVELOGORCL_9JULY13';
}


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

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

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 until clause

Starting restore at 11-JUL-13

channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
................
..................
..................
channel c1: restoring datafile 00032 to +DATA01/ORCL/datafile/undotbs4.3054.815489519
channel c1: reading from backup piece peoeamcb_1_1
channel c1: piece handle=peoeamcb_1_1 tag=FULLDBORCL_9JULY13
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:04:36
channel c1: starting datafile backup set restore
channel c1: specifying datafile(s) to restore from backup set
channel c1: restoring datafile 00001 to +DATA01/ORCL/datafile/system.387.812985451
..................
..................
......................
channel c1: restoring datafile 00030 to +DATA01/ORCL/datafile/wcc_cons.399.812985475
channel c1: reading from backup piece pdoeamca_1_1
channel c1: piece handle=pdoeamca_1_1 tag=FULLDBORCL_9JULY13
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:08:07
Finished restore at 11-JUL-13

datafile 1 switched to datafile copy
input datafile copy RECID=50 STAMP=820495627 file name=+DATA01/ORCL/datafile/system.509.820495199
datafile 2 switched to datafile copy
..................
..................
...................
datafile 32 switched to datafile copy
input datafile copy RECID=81 STAMP=820495633 file name=+DATA01/ORCL/datafile/undotbs4.681.820495037

Starting recover at 11-JUL-13

starting media recovery

channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=2 sequence=535
channel c1: reading from backup piece pgoeampp_1_1
channel c1: piece handle=pgoeampp_1_1 tag=ARCHIVELOGORCL_9JULY13
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:06
channel c1: starting archived log restore to default destination
channel c1: restoring archived log
archived log thread=1 sequence=524
channel c1: reading from backup piece phoeampp_1_1
channel c1: piece handle=phoeampp_1_1 tag=ARCHIVELOGORCL_9JULY13
channel c1: restored backup piece 1
channel c1: restore complete, elapsed time: 00:01:15
archived log file name=+DATA01/ORCL/archivelog/2013_07_11/thread_1_seq_524.846.820495855 thread=1 sequence=524
archived log file name=+DATA01/ORCL/archivelog/2013_07_11/thread_2_seq_535.380.820495775 thread=2 sequence=535
channel default: deleting archived log(s)
archived log file name=+DATA01/ORCL/archivelog/2013_07_11/thread_1_seq_524.846.820495855 RECID=5467 STAMP=820495855
channel default: deleting archived log(s)
archived log file name=+DATA01/ORCL/archivelog/2013_07_11/thread_2_seq_535.380.820495775 RECID=5466 STAMP=820495775
media recovery complete, elapsed time: 00:00:01
Finished recover at 11-JUL-13
released channel: c1

RMAN> alter database open resetlogs;

database opened
new incarnation of database registered in recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of alter db command at 07/11/2013 11:58:10
ORA-01580: error creating control backup file +SFRA/snapcf_dir/snapcf_ORCL_.f
ORA-17502: ksfdcre:3 Failed to create file +SFRA/snapcf_dir/snapcf_ORCL_.f
ORA-15001: diskgroup "SFRA" does not exist or is not mounted
ORA-15001: diskgroup "SFRA" does not exist or is not mounted

RMAN>

-- login and check the status

[oracle@osubhen-db01 admin]$ . oraenv
ORACLE_SID = [+ASM] ? ORCL
ORACLE_HOME = [/home/oracle] ? /oracle/app/database/11.2.0.3/dbhome_1
The Oracle base for ORACLE_HOME=/oracle/app/database/11.2.0.3/dbhome_1 is /oracle/app
[oracle@osubhen-db01 admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 11 12:02:01 2013

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


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

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ORCL  READ WRITE           PRIMARY