Friday, March 29, 2013

How to duplicate a production database on a different server mantaining the same SID and directory structures with 'duplicate' RMAN command

In the following scenario I simply want to have a copy of my production database to a different server preserving the same database directory structures and even the same database name.
My production database is running on vsi08 server and its system id (ORACLE_SID) is PROD; the remote server is vsi10 and I want to duplicate here the PROD database currently available on vsi08.

Usually when I install a new database I try to save all the related scripts to recreate it: it's just another checkbox during a typical dbca installation.

On the local vsi08 server I can find those scripts located at $ORACLE_BASE/admin/'db_name'/scripts, that is:
[oracle@vsi08 ~]$ cd /opt/app/oracle/admin/PROD/scripts
[oracle@vsi08 scripts]$ ll
total 52
-rw-r----- 1 oracle oinstall  234 Mar 27 13:41 apex.sql
-rw-r----- 1 oracle oinstall  756 Mar 27 13:41 CreateDBCatalog.sql
-rw-r----- 1 oracle oinstall  396 Mar 27 13:41 CreateDBFiles.sql
-rw-r----- 1 oracle oinstall 1219 Mar 27 13:41 CreateDB.sql
-rw-r----- 1 oracle oinstall 1916 Mar 27 13:41 init.ora
-rw-r----- 1 oracle oinstall  202 Mar 27 13:41 interMedia.sql
-rw-r----- 1 oracle oinstall  443 Mar 27 13:41 JServer.sql
-rw-r----- 1 oracle oinstall  507 Mar 27 13:41 lockAccount.sql
-rw-r----- 1 oracle oinstall  211 Mar 27 13:41 ordinst.sql
-rw-r----- 1 oracle oinstall  786 Mar 27 13:41 postDBCreation.sql
-rwxr-xr-x 1 oracle oinstall  685 Mar 27 13:41 PROD.sh
-rwxr-xr-x 1 oracle oinstall  781 Mar 27 13:41 PROD.sql
-rw-r----- 1 oracle oinstall  395 Mar 27 13:41 xdb_protocol.sql
If you look at the content of the unique sh file you can verify it creates few directories. I want to use the content of that file to create the same database directory structures on the remote server.
[oracle@vsi08 scripts]$ more PROD.sh 
#!/bin/sh

OLD_UMASK=`umask`
umask 0027
mkdir -p /opt/app/oracle/admin/PROD/adump
mkdir -p /opt/app/oracle/admin/PROD/dpdump
mkdir -p /opt/app/oracle/admin/PROD/pfile
mkdir -p /opt/app/oracle/cfgtoollogs/dbca/PROD
mkdir -p /opt/app/oracle/flash_recovery_area
mkdir -p /opt/app/oracle/flash_recovery_area/PROD
mkdir -p /opt/app/oracle/oradata/PROD
mkdir -p /opt/app/oracle/product/11.2.0/db_1/dbs
umask ${OLD_UMASK}
ORACLE_SID=PROD; export ORACLE_SID
PATH=$ORACLE_HOME/bin:$PATH; export PATH
echo You should Add this entry in the /etc/oratab: PROD:/opt/app/oracle/product/11.2.0/db_1:Y
/opt/app/oracle/product/11.2.0/db_1/bin/sqlplus /nolog @/opt/app/oracle/admin/PROD/scripts/PROD.sql
So on remote vsi10 server I recreate the same directory structures of vsi08:
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/admin/PROD/adump
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/admin/PROD/dpdump
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/admin/PROD/pfile
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/cfgtoollogs/dbca/PROD
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/flash_recovery_area
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/flash_recovery_area/PROD
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/oradata/PROD
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/product/11.2.0/db_1/dbs
Next step is to create a pfile from the current PROD database located on vsi08 server and transfer that copy to vsi10 server:
[oracle@vsi08 pfile]$ sqlplus / as sysdba
SQL> create pfile='/tmp/initPROD_20130328.txt' from spfile;

File created.

[oracle@vsi08 pfile]$ scp /tmp/initPROD_20130328.txt vsi10.mydomain.it:/opt/app/oracle/admin/PROD/pfile
oracle@vsi10.mydomain.it's password: 
initPROD_20130328.txt                                 100%  944     0.9KB/s   00:00
Now it's time to create a tns entry for vsi10 server referencing PROD database at vsi08 server. I first have a look at the current tns entry on the local vsi08 server...
[oracle@vsi08 admin]$ pwd
/opt/app/oracle/product/11.2.0/db_1/network/admin
[oracle@vsi08 admin]$ cat tnsnames.ora 
# tnsnames.ora Network Configuration File: /opt/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

PROD =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = vsi08.mydomain.it)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PROD)
    )
  )
... and then, using a simple copy-and-paste operation, I can create the new one on tnsnames.ora file of vsi10 server.
I modify only the reference of the tns entry from PROD to PROD_AT_VSI08 because I really want to remember I'm connecting to PROD database located at vsi08 server:
[oracle@vsi10 ~]$ cd $ORACLE_HOME 
[oracle@vsi10 db_1]$ cd network/admin/
[oracle@vsi10 admin]$ vi tnsnames.ora 
[oracle@vsi10 admin]$ cat tnsnames.ora 
PROD_AT_VSI08 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = vsi08.mydomain.it)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PROD)
    )
  )
After the creation of PROD_AT_VSI08 tns entry I want to test it and try to connect from vsi10 server to PROD database on vsi08 server.
Before proceeding I have to successfully establish a connection otherwise my attempt to duplicate PROD database on vsi10 server won't work.
[oracle@vsi10 admin]$ sqlplus sys/oracle@PROD_AT_VSI08 as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 28 12:37:34 2013

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> exit
Ok... I'm able to connect to PROD database at vsi08 server and now it's time to have a complete backup of the database I want to duplicate. So from vsi08 server I set the following environment settings, backing up the database and its archivelogs. RMAN is configured using autobackup on so it will perform also a backup of the current control file and spfile:
[oracle@vsi08 ~]$ export NLS_DATE_FORMAT='DD-MM-RRRR HH24:MI:SS'
[oracle@vsi08 ~]$ export ORACLE_SID=PROD
[oracle@vsi08 ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Mar 28 10:49:42 2013

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

connected to target database: PROD (DBID=223010867)

RMAN> backup database plus archivelog;

Starting backup at 28-03-2013 10:52:07
current log archived
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=50 RECID=3 STAMP=811248727
channel ORA_DISK_1: starting piece 1 at 28-03-2013 10:52:07
channel ORA_DISK_1: finished piece 1 at 28-03-2013 10:52:08
piece handle=/opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_annnn_TAG20130328T105207_8o84p7o6_.bkp tag=TAG20130328T105207 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 28-03-2013 10:52:08

Starting backup at 28-03-2013 10:52:08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/opt/app/oracle/oradata/PROD/system01.dbf
input datafile file number=00002 name=/opt/app/oracle/oradata/PROD/sysaux01.dbf
input datafile file number=00003 name=/opt/app/oracle/oradata/PROD/undotbs01.dbf
input datafile file number=00004 name=/opt/app/oracle/oradata/PROD/users01.dbf
channel ORA_DISK_1: starting piece 1 at 28-03-2013 10:52:08
channel ORA_DISK_1: finished piece 1 at 28-03-2013 10:52:33
piece handle=/opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_nnndf_TAG20130328T105208_8o84p8vq_.bkp tag=TAG20130328T105208 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
Finished backup at 28-03-2013 10:52:33

Starting backup at 28-03-2013 10:52:33
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=51 RECID=4 STAMP=811248753
channel ORA_DISK_1: starting piece 1 at 28-03-2013 10:52:34
channel ORA_DISK_1: finished piece 1 at 28-03-2013 10:52:35
piece handle=/opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_annnn_TAG20130328T105233_8o84q231_.bkp tag=TAG20130328T105233 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 28-03-2013 10:52:35

Starting Control File and SPFILE Autobackup at 28-03-2013 10:52:35
piece handle=/opt/app/oracle/flash_recovery_area/PROD/autobackup/2013_03_28/o1_mf_s_811248755_8o84q3cz_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 28-03-2013 10:52:36
The current backup pieces are located into two directories:
RMAN> list backup;

using target database control file instead of recovery catalog

List of Backup Sets
===================


BS Key  Size       Device Type Elapsed Time Completion Time    
------- ---------- ----------- ------------ -------------------
5       3.00K      DISK        00:00:00     28-03-2013 10:52:07
        BP Key: 5   Status: AVAILABLE  Compressed: NO  Tag: TAG20130328T105207
        Piece Name: /opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_annnn_TAG20130328T105207_8o84p7o6_.bkp

  List of Archived Logs in backup set 5
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    50      730126     28-03-2013 10:48:33 730283     28-03-2013 10:52:07

BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
6       Full    725.99M    DISK        00:00:17     28-03-2013 10:52:25
        BP Key: 6   Status: AVAILABLE  Compressed: NO  Tag: TAG20130328T105208
        Piece Name: /opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_nnndf_TAG20130328T105208_8o84p8vq_.bkp
  List of Datafiles in backup set 6

  File LV Type Ckp SCN    Ckp Time            Name
  ---- -- ---- ---------- ------------------- ----
  1       Full 730292     28-03-2013 10:52:08 /opt/app/oracle/oradata/PROD/system01.dbf
  2       Full 730292     28-03-2013 10:52:08 /opt/app/oracle/oradata/PROD/sysaux01.dbf
  3       Full 730292     28-03-2013 10:52:08 /opt/app/oracle/oradata/PROD/undotbs01.dbf
  4       Full 730292     28-03-2013 10:52:08 /opt/app/oracle/oradata/PROD/users01.dbf

BS Key  Size       Device Type Elapsed Time Completion Time    
------- ---------- ----------- ------------ -------------------
7       2.00K      DISK        00:00:00     28-03-2013 10:52:34
        BP Key: 7   Status: AVAILABLE  Compressed: NO  Tag: TAG20130328T105233
        Piece Name: /opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_annnn_TAG20130328T105233_8o84q231_.bkp

  List of Archived Logs in backup set 7
  Thrd Seq     Low SCN    Low Time            Next SCN   Next Time
  ---- ------- ---------- ------------------- ---------- ---------
  1    51      730283     28-03-2013 10:52:07 730305     28-03-2013 10:52:33

BS Key  Type LV Size       Device Type Elapsed Time Completion Time    
------- ---- -- ---------- ----------- ------------ -------------------
8       Full    9.36M      DISK        00:00:00     28-03-2013 10:52:35
        BP Key: 8   Status: AVAILABLE  Compressed: NO  Tag: TAG20130328T105235
        Piece Name: /opt/app/oracle/flash_recovery_area/PROD/autobackup/2013_03_28/o1_mf_s_811248755_8o84q3cz_.bkp
  SPFILE Included: Modification time: 28-03-2013 10:45:50
  SPFILE db_unique_name: PROD
  Control File Included: Ckp SCN: 730314       Ckp time: 28-03-2013 10:52:35
I need to create the same backup directories into vsi10 server:
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/
[oracle@vsi10 ~]$ mkdir -p /opt/app/oracle/flash_recovery_area/PROD/autobackup/2013_03_28/
From vsi08 server I copy the backup pieces to vsi10 server into the appropriate directories:
[oracle@vsi08 ~]$ ll /opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/
total 744164
-rw-r----- 1 oracle oinstall      3584 Mar 28 10:52 o1_mf_annnn_TAG20130328T105207_8o84p7o6_.bkp
-rw-r----- 1 oracle oinstall      2560 Mar 28 10:52 o1_mf_annnn_TAG20130328T105233_8o84q231_.bkp
-rw-r----- 1 oracle oinstall 761266176 Mar 28 10:52 o1_mf_nnndf_TAG20130328T105208_8o84p8vq_.bkp
[oracle@vsi08 ~]$ scp /opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/* vsi10.mydomain.it:/opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/
oracle@vsi10.mydomain.it's password: 
o1_mf_annnn_TAG20130328T105207_8o84p7o6_.bkp          100% 3584     3.5KB/s   00:00    
o1_mf_annnn_TAG20130328T105233_8o84q231_.bkp          100% 2560     2.5KB/s   00:00    
o1_mf_nnndf_TAG20130328T105208_8o84p8vq_.bkp          100%  726MB  40.3MB/s   00:18    
[oracle@vsi08 ~]$ ll /opt/app/oracle/flash_recovery_area/PROD/autobackup/2013_03_28/
total 9616
-rw-r----- 1 oracle oinstall 9830400 Mar 28 10:52 o1_mf_s_811248755_8o84q3cz_.bkp
[oracle@vsi08 ~]$ scp /opt/app/oracle/flash_recovery_area/PROD/autobackup/2013_03_28/* vsi10.mydomain.it:/opt/app/oracle/flash_recovery_area/PROD/autobackup/2013_03_28/
oracle@vsi10.mydomain.it's password: 
o1_mf_s_811248755_8o84q3cz_.bkp                       100% 9600KB   9.4MB/s   00:00
From the vsi10 machine I need to start the "next" duplicated PROD instance in NOMOUNT mode and with the previously copied pfile.
[oracle@vsi10 admin]$ export ORACLE_SID=PROD
[oracle@vsi10 admin]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 28 12:38:49 2013

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

Connected to an idle instance.
SQL> startup nomount pfile='/opt/app/oracle/admin/PROD/pfile/initPROD_20130328.txt'
ORACLE instance started.

Total System Global Area 1686925312 bytes
Fixed Size      2213976 bytes
Variable Size    989857704 bytes
Database Buffers   687865856 bytes
Redo Buffers      6987776 bytes
When the instance is started in NOMOUNT mode I can remotely connect RMAN to PROD database at vsi08 as target connection and to the "next" PROD database at the local server (vsi10) as auxiliary connection:
[oracle@vsi10 admin]$ rman target sys/oracle@PROD_AT_VSI08 auxiliary /

Recovery Manager: Release 11.2.0.1.0 - Production on Thu Mar 28 14:34:25 2013

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

connected to target database: PROD (DBID=223010867)
connected to auxiliary database: PROD (not mounted)
With the following duplicate command I want to restore all the datafiles located into the backup pieces and automatically start the new database on vsi10 server. At the end of the duplicate process I will have a complete copy of my production database with the same directory structures and even the same SID:
RMAN> duplicate target database to PROD nofilenamecheck;

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

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1686925312 bytes

Fixed Size                     2213976 bytes
Variable Size               1006634920 bytes
Database Buffers             671088640 bytes
Redo Buffers                   6987776 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name = 
 ''PROD'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name = 
 ''PROD'' 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

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area    1686925312 bytes

Fixed Size                     2213976 bytes
Variable Size               1006634920 bytes
Database Buffers             671088640 bytes
Redo Buffers                   6987776 bytes

Starting restore at 28-MAR-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=134 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /opt/app/oracle/flash_recovery_area/PROD/autobackup/2013_03_28/o1_mf_s_811248755_8o84q3cz_.bkp
channel ORA_AUX_DISK_1: piece handle=/opt/app/oracle/flash_recovery_area/PROD/autobackup/2013_03_28/o1_mf_s_811248755_8o84q3cz_.bkp tag=TAG20130328T105235
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output file name=/opt/app/oracle/oradata/PROD/control01.ctl
output file name=/opt/app/oracle/flash_recovery_area/PROD/control02.ctl
Finished restore at 28-MAR-13

database mounted

contents of Memory Script:
{
   set until scn  730305;
   set newname for datafile  1 to 
 "/opt/app/oracle/oradata/PROD/system01.dbf";
   set newname for datafile  2 to 
 "/opt/app/oracle/oradata/PROD/sysaux01.dbf";
   set newname for datafile  3 to 
 "/opt/app/oracle/oradata/PROD/undotbs01.dbf";
   set newname for datafile  4 to 
 "/opt/app/oracle/oradata/PROD/users01.dbf";
   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

Starting restore at 28-MAR-13
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /opt/app/oracle/oradata/PROD/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /opt/app/oracle/oradata/PROD/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /opt/app/oracle/oradata/PROD/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /opt/app/oracle/oradata/PROD/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_nnndf_TAG20130328T105208_8o84p8vq_.bkp
channel ORA_AUX_DISK_1: piece handle=/opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_nnndf_TAG20130328T105208_8o84p8vq_.bkp tag=TAG20130328T105208
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:55
Finished restore at 28-MAR-13

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

datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=811262217 file name=/opt/app/oracle/oradata/PROD/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=811262217 file name=/opt/app/oracle/oradata/PROD/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=811262217 file name=/opt/app/oracle/oradata/PROD/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=811262217 file name=/opt/app/oracle/oradata/PROD/users01.dbf

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

executing command: SET until clause

Starting recover at 28-MAR-13
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=51
channel ORA_AUX_DISK_1: reading from backup piece /opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_annnn_TAG20130328T105233_8o84q231_.bkp
channel ORA_AUX_DISK_1: piece handle=/opt/app/oracle/flash_recovery_area/PROD/backupset/2013_03_28/o1_mf_annnn_TAG20130328T105233_8o84q231_.bkp tag=TAG20130328T105233
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/opt/app/oracle/flash_recovery_area/PROD/archivelog/2013_03_28/o1_mf_1_51_8o8kvv94_.arc thread=1 sequence=51
channel clone_default: deleting archived log(s)
archived log file name=/opt/app/oracle/flash_recovery_area/PROD/archivelog/2013_03_28/o1_mf_1_51_8o8kvv94_.arc RECID=5 STAMP=811262219
media recovery complete, elapsed time: 00:00:00
Finished recover at 28-MAR-13

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
   sql clone "alter system set  db_name = 
 ''PROD'' 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

database dismounted
Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area    1686925312 bytes

Fixed Size                     2213976 bytes
Variable Size               1006634920 bytes
Database Buffers             671088640 bytes
Redo Buffers                   6987776 bytes

sql statement: alter system set  db_name =  ''PROD'' 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    1686925312 bytes

Fixed Size                     2213976 bytes
Variable Size               1006634920 bytes
Database Buffers             671088640 bytes
Redo Buffers                   6987776 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "PROD" RESETLOGS ARCHIVELOG 
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP  1  SIZE 50 M ,
  GROUP  2  SIZE 50 M ,
  GROUP  3  SIZE 50 M 
 DATAFILE
  '/opt/app/oracle/oradata/PROD/system01.dbf'
 CHARACTER SET WE8MSWIN1252


contents of Memory Script:
{
   set newname for tempfile  1 to 
 "/opt/app/oracle/oradata/PROD/temp01.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/opt/app/oracle/oradata/PROD/sysaux01.dbf", 
 "/opt/app/oracle/oradata/PROD/undotbs01.dbf", 
 "/opt/app/oracle/oradata/PROD/users01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /opt/app/oracle/oradata/PROD/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/opt/app/oracle/oradata/PROD/sysaux01.dbf RECID=1 STAMP=811262238
cataloged datafile copy
datafile copy file name=/opt/app/oracle/oradata/PROD/undotbs01.dbf RECID=2 STAMP=811262238
cataloged datafile copy
datafile copy file name=/opt/app/oracle/oradata/PROD/users01.dbf RECID=3 STAMP=811262238

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=811262238 file name=/opt/app/oracle/oradata/PROD/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=811262238 file name=/opt/app/oracle/oradata/PROD/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=811262238 file name=/opt/app/oracle/oradata/PROD/users01.dbf

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

database opened
Finished Duplicate Db at 28-MAR-13
That' all.

22 comments:

Anonymous said...

My partner and I stumbled over here by a different web address and thought I may as
well check things out. I like what I see so now i am following you.

Look forward to finding out about your web page yet again.


My blog: password crack

Anonymous said...

whoah this weblog is excellent i really like studying your articles.
Stay up the good work! You realize, many people are hunting round for this information,
you can help them greatly.

Feel free to surf to my homepage; all miscrits

Anonymous said...

I’m not that much of a online reader to be honest but your blogs really nice, keep it up!
I'll go ahead and bookmark your website to come back later on. Cheers

my page; No2 maximus facts

Anonymous said...

At this moment I am going away to do my breakfast, afterward having my breakfast coming over again to read
other news.

My homepage - http://adornablog.com

Anonymous said...

Hey There. I found your blog using msn. This is a very smartly written article.
I'll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I will certainly comeback.

My webpage: Authrntic green coffee review

Anonymous said...

Nice respond in return of this query with real arguments and telling all concerning that.


123 income academy reviews

Anonymous said...

Because the admin of this web site is working, no doubt very rapidly it will be
well-known, due to its feature contents.

My web page :: Natural Cleanse Diets

Anonymous said...

Hi there, of course this paragraph is actually nice and I
have learned lot of things from it about blogging. thanks.


Also visit my web-site ... Lift and glow pro

Anonymous said...

My brother recommended I might like this blog. He was once totally right.
This publish truly made my day. You can not consider just how much time I had spent for this info!

Thank you!

My weblog :: Muscle BUilding Supplement

Anonymous said...

What's up, this weekend is pleasant in support of me, for the reason that this point in time i am reading this wonderful informative article here at my home.

Also visit my web-site - sex games online

Anonymous said...

Useful info. Lucky me I found your site unintentionally, and I am shocked why this
coincidence didn't took place earlier! I bookmarked it.

My web blog :: castleville castle

Anonymous said...

I'm gone to inform my little brother, that he should also pay a quick visit this weblog on regular basis to get updated from hottest news update.

my webpage adfoc.us

Anonymous said...

This is the perfect site for anybody who really wants to find out about this topic.

You understand a whole lot its almost hard to argue with you (not that I really will need to…HaHa).

You definitely put a fresh spin on a subject that has been written about for many years.
Wonderful stuff, just excellent!

My blog: Sharecash Downloader

Anonymous said...

I'm really impressed with your writing skills as well as with the layout on your blog. Is this a paid theme or did you modify it yourself? Either way keep up the excellent quality writing, it is rare to see a nice blog like this one nowadays.

Also visit my site: cheat for castle ville

Anonymous said...

I like the valuable information you provide in your articles.
I'll bookmark your weblog and check again here regularly. I'm quite certain I'll learn plenty of new stuff right here! Best of luck for the next!

my weblog minecraft hack

Anonymous said...

Hurrah, that's what I was looking for, what a information! present here at this webpage, thanks admin of this website.

Feel free to surf to my website :: hack twitter account

Anonymous said...

Download All Recent Games, Movies, Apps, Mobile Stuff and everything else for free at http:
//www.rls-log.net

You can download from the following categories

Full Version Applications for Android, iOS, MAC,
Windows
Full Version Games for Linux, MAC, PC, PS3, Wii, Wii U,
XBOX360 and other systems
Full Movies And Cinema Movies BDRiP, Cam, DVDRiP, DVDRiP
Old, DVDSCR, HDRiP, R5, SCR, Staff Picks, Telecine, Telesync, Workprint
Full Music Album MP3s and Music Videos Music, Albums, iTunes, MViD, Singles/EPs
Full Version Ebooks eBook Magazines

Download all you want for free at http://www.rls-log.
net

My blog post - free games

Anonymous said...

If you want a Premium Minecraft Account check out this generator.
With it you can generate a unique Minecraft Premium Account which no one else has!
You can Download the Free Premium Minecraft Account Generator http:
//www.minecraftdownload2013.tk

Thanks in favor of sharing such a fastidious idea, article is nice, thats why i have read it
fully

Anonymous said...

If you want a Premium Minecraft Account check out this generator.
With it you can generate a unique Minecraft Premium Account which
no one else has! You can Download the Free Premium Minecraft
Account Generator http://www.free-minecraft-download.
tk

I wanted to thank you for this excellent read!! I definitely loved every bit of it.
I've got you bookmarked to look at new things you post…

Anonymous said...

I just could not depart your website before suggesting that I
extremely loved the standard info an individual supply to your visitors?
Is gonna be back incessantly to check out new posts

Feel free to surf to my web-site :: ps3 free

Anonymous said...

I need to to thank you for this excellent read!

! I definitely loved every bit of it. I have got you saved as
a favorite to look at new things you post…

Take a look at my page :: Free Minecraft download

Anonymous said...

Hello,

Unlike the people who commented before me, this article has helped me a lot on how to tackle the replication of our reports database during month end. It will reduce time consuming data pump method that I have been doing for the past 2 years. Thank you very much and keep up the good work.

Drew