Oracle Version :-11g
Target Database : prim
Target Database Server : server1.soumya.com
IP: 192.168.2.102
Oracle Version :-11g
Auxiliary Database : stand
Auxiliary Database Server : server3.soumya.com
IP:192.168.2.12
Step 1:
Take the incremental level 0 backup of the Target database using RMAN.
In my case, I had the backup of my target database (prim) taken at the location '/u01/bkp'
[oracle@server1 bkp]$ pwd
/u01/bkp
[oracle@server1 bkp]$ ls -ltrh
total 1.1G
-rw-r-----. 1 oracle oinstall 9.4M Feb 17 15:06 o1_mf_ncsnf_TAG20150217T150631_bg62x0o8_.bkp
-rw-r-----. 1 oracle oinstall 13M Feb 17 15:08 o1_mf_annnn_TAG20150217T150811_bg63043x_.bkp
-rw-r-----. 1 oracle oinstall 1.1G Feb 17 15:09 o1_mf_nnndf_TAG20150217T150813_bg6305j3_.bkp
-rw-r-----. 1 oracle oinstall 9.4M Feb 17 15:09 o1_mf_ncsnf_TAG20150217T150813_bg632lxo_.bkp
-rw-r-----. 1 oracle oinstall 8.0K Feb 17 15:09 o1_mf_annnn_TAG20150217T150932_bg632nml_.bkp
Step 2:
Copy these backup pieces from the Target server (location /u01/bkp) to the auxiliary server (location /u01/bkp)
Also, copy the pfile (initprim.ora) of the Target database to the Auxiliary server.
[oracle@server1 ]$ cd /u01/app/oracle/product/11.2.0/db_1/dbs
[oracle@server1 ]$ cp initprim.ora /u01/bkp/
[oracle@server1 $ scp -r *.* oracle@192.168.2.12:/u01/
oracle@192.168.2.12's password:
initprim.ora 100% 912Kb 0.9KB/s 00:00 100% 911KB 9.0MB/s 00.00
o1_mf_ncsnf_TAG20150217T150631_bg62x0o8_.bkp 100% 9600KB 9.4MB/s 00:00
o1_mf_annnn_TAG20150217T150932_bg632nml_.bkp 100% 8192 8.0KB/s 00:00
o1_mf_nnndf_TAG20150217T150813_bg6305j3_.bkp 100% 1060MB 20.0MB/s 00:53
o1_mf_annnn_TAG20150217T150811_bg63043x_.bkp 100% 12MB 12.2MB/s 00:00
o1_mf_ncsnf_TAG20150217T150813_bg632lxo_.bkp 100% 9600KB 9.4MB/s 00:00
Step 3:
On the Auxiliary server, edit the pfile that was copied earlier to the desired entries (dump locations, control file location, datafile locations,
if using ASM then specify the desired disk group) and rename it to the desired instance name file (init<SID>.ora). Below is the sample I had it done.
vi initprim.ora
stand.__db_cache_size=16777216
stand.__java_pool_size=20971520
stand.__large_pool_size=4194304
stand.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
stand.__pga_aggregate_target=142606336
stand.__sga_target=272629760
stand.__shared_io_pool_size=0
stand.__shared_pool_size=213909504
stand.__streams_pool_size=8388608
*.audit_file_dest='/u01/app/oracle/admin/stand/adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='/u01/app/oracle/oradata/stand/control01.ctl','/u01/app/oracle/flash_recovery_area/stand/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='stand'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=primXDB)'
*.memory_target=415236096
*.open_cursors=300
*.processes=1000
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.db_file_name_convert='/u01/app/oracle/oradata/prim/','/u01/app/oracle/oradata/stand/'
*.log_file_name_convert='/u01/app/oracle/oradata/prim/','/u01/app/oracle/oradata/stand/'
:wq
Make sure db_file_name_convert and log_file_name_convert parameters are present in pfile else it would
throw error while creating auxiliary database .
Once changes are done rename the pfile with your instance sid and copy it inside ORACLE_HOME/dbs
[oracle@server3] mv initprim.ora initstand.ora
[oracle@server3] cp initstand.ora $ORACLE_HOME/dbs
Step 4:
Create a password file for the Auxiliary Database using the ORAPWD utility.
orapwd file=/u01/app/oracle/product/11.2.0/db_1/dbs/orapwstand password=redhat
Step 5:
Start the auxiliary instance using the modified by pfile(initstand.ora)
[oracle@uat ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
[oracle@uat ~]$ export ORACLE_SID=stand
Keep in mind that the auxiliary instance doesnt have any instance running on, only oracle binaries are installed on this.
Step 6 :-
Create the required directory structures are mentioned in pfile.
oracle@server3 ~]$ mkdir -p /u01/app/oracle/admin/stand/adump
[oracle@server3 ~]$ mkdir -p /u01/app/oracle/oradata/stand/
[oracle@server3 ]$ mkdir -p /u01/app/oracle/flash_recovery_area/stand/
SQL> startup nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initstand.ora'
ORACLE instance started.
Total System Global Area 754974720 bytes
Fixed Size 2928968 bytes
Variable Size 637537976 bytes
Database Buffers 109051904 bytes
Redo Buffers 5455872 bytes
Step 6:
Connect the auxiliary instance through RMAN and start the duplication.
The duplication is done by specifying the location of the backup pieces. The command to be used is
DUPLICATE DATABASE TO '<auxiliary dbname>' BACKUP LOCATION '<location of the backup pieces on the auxiliary server>'
[oracle@server3 dbs]$ rman auxiliary /
Recovery Manager: Release 12.1.0.2.0 - Production on Sat Jul 11 18:04:20 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to auxiliary database: stand (not mounted)
RMAN> duplicate database to 'stand' backup location '/u01/bkp' NOFILENAMECHECK;
Starting Duplicate Db at 08-JAN-15
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 413372416 bytes
Fixed Size 2213896 bytes
Variable Size 394266616 bytes
Database Buffers 12582912 bytes
Redo Buffers 4308992 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''PRIM'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''STAND'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile from '/u01/2015_02_17/o1_mf_ncsnf_TAG20150217T150813_bg632lxo_.bkp';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''PRIM'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''STAND'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 413372416 bytes
Fixed Size 2213896 bytes
Variable Size 394266616 bytes
Database Buffers 12582912 bytes
Redo Buffers 4308992 bytes
Starting restore at 08-JAN-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/stand/control01.ctl
output file name=/u01/app/oracle/flash_recovery_area/stand/control02.ctl
Finished restore at 08-JAN-15
database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
contents of Memory Script:
{
set until scn 58614791;
set newname for datafile 1 to
"/u01/app/oracle/oradata/stand/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/stand/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/stand/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/stand/users01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/stand/example01.dbf";
set newname for datafile 6 to
"/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf";
set newname for datafile 7 to
"/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.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
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 08-JAN-15
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 /u01/app/oracle/oradata/stand/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/stand/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/stand/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/stand/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/stand/example01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/2015_02_17/o1_mf_nnndf_TAG20150217T150813_bg6305j3_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/2015_02_17/o1_mf_nnndf_TAG20150217T150813_bg6305j3_.bkp tag=TAG20150217T150813
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:07
Finished restore at 08-JAN-15
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=14 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf
contents of Memory Script:
{
set until scn 58614791;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 08-JAN-15
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=16
channel ORA_AUX_DISK_1: reading from backup piece /u01/2015_02_17/o1_mf_annnn_TAG20150217T150932_bg632nml_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/2015_02_17/o1_mf_annnn_TAG20150217T150932_bg632nml_.bkp tag=TAG20150217T150932
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=/u01/app/oracle/flash_recovery_area/STAND/archivelog/2015_01_08/o1_mf_1_16_bbxko71g_.arc thread=1 sequence=16
channel clone_default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/STAND/archivelog/2015_01_08/o1_mf_1_16_bbxko71g_.arc RECID=1 STAMP=868491263
media recovery complete, elapsed time: 00:00:00
Finished recover at 08-JAN-15
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''STAND'' 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 413372416 bytes
Fixed Size 2213896 bytes
Variable Size 394266616 bytes
Database Buffers 12582912 bytes
Redo Buffers 4308992 bytes
sql statement: alter system set db_name = ''STAND'' 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 413372416 bytes
Fixed Size 2213896 bytes
Variable Size 394266616 bytes
Database Buffers 12582912 bytes
Redo Buffers 4308992 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "STAND" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/app/oracle/oradata/stand/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u01/app/oracle/oradata/stand/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u01/app/oracle/oradata/stand/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/u01/app/oracle/oradata/stand/system01.dbf'
CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/stand/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/stand/sysaux01.dbf",
"/u01/app/oracle/oradata/stand/undotbs01.dbf",
"/u01/app/oracle/oradata/stand/users01.dbf",
"/u01/app/oracle/oradata/stand/example01.dbf",
"/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf",
"/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/stand/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/sysaux01.dbf RECID=1 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/undotbs01.dbf RECID=2 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/users01.dbf RECID=3 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/example01.dbf RECID=4 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf RECID=5 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf RECID=6 STAMP=868491274
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 08-JAN-15
RMAN>
SQL> select name from v$database;
NAME
---------
STAND
Done..!!!
Please share your ideas and opinions about this topic.
If you like this post, then please share with others.
Please subscribe on email for every updates on mail.
Target Database : prim
Target Database Server : server1.soumya.com
IP: 192.168.2.102
Oracle Version :-11g
Auxiliary Database : stand
Auxiliary Database Server : server3.soumya.com
IP:192.168.2.12
Step 1:
Take the incremental level 0 backup of the Target database using RMAN.
In my case, I had the backup of my target database (prim) taken at the location '/u01/bkp'
[oracle@server1 bkp]$ pwd
/u01/bkp
[oracle@server1 bkp]$ ls -ltrh
total 1.1G
-rw-r-----. 1 oracle oinstall 9.4M Feb 17 15:06 o1_mf_ncsnf_TAG20150217T150631_bg62x0o8_.bkp
-rw-r-----. 1 oracle oinstall 13M Feb 17 15:08 o1_mf_annnn_TAG20150217T150811_bg63043x_.bkp
-rw-r-----. 1 oracle oinstall 1.1G Feb 17 15:09 o1_mf_nnndf_TAG20150217T150813_bg6305j3_.bkp
-rw-r-----. 1 oracle oinstall 9.4M Feb 17 15:09 o1_mf_ncsnf_TAG20150217T150813_bg632lxo_.bkp
-rw-r-----. 1 oracle oinstall 8.0K Feb 17 15:09 o1_mf_annnn_TAG20150217T150932_bg632nml_.bkp
Step 2:
Copy these backup pieces from the Target server (location /u01/bkp) to the auxiliary server (location /u01/bkp)
Also, copy the pfile (initprim.ora) of the Target database to the Auxiliary server.
[oracle@server1 ]$ cd /u01/app/oracle/product/11.2.0/db_1/dbs
[oracle@server1 ]$ cp initprim.ora /u01/bkp/
[oracle@server1 $ scp -r *.* oracle@192.168.2.12:/u01/
oracle@192.168.2.12's password:
initprim.ora 100% 912Kb 0.9KB/s 00:00 100% 911KB 9.0MB/s 00.00
o1_mf_ncsnf_TAG20150217T150631_bg62x0o8_.bkp 100% 9600KB 9.4MB/s 00:00
o1_mf_annnn_TAG20150217T150932_bg632nml_.bkp 100% 8192 8.0KB/s 00:00
o1_mf_nnndf_TAG20150217T150813_bg6305j3_.bkp 100% 1060MB 20.0MB/s 00:53
o1_mf_annnn_TAG20150217T150811_bg63043x_.bkp 100% 12MB 12.2MB/s 00:00
o1_mf_ncsnf_TAG20150217T150813_bg632lxo_.bkp 100% 9600KB 9.4MB/s 00:00
Step 3:
On the Auxiliary server, edit the pfile that was copied earlier to the desired entries (dump locations, control file location, datafile locations,
if using ASM then specify the desired disk group) and rename it to the desired instance name file (init<SID>.ora). Below is the sample I had it done.
vi initprim.ora
stand.__db_cache_size=16777216
stand.__java_pool_size=20971520
stand.__large_pool_size=4194304
stand.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
stand.__pga_aggregate_target=142606336
stand.__sga_target=272629760
stand.__shared_io_pool_size=0
stand.__shared_pool_size=213909504
stand.__streams_pool_size=8388608
*.audit_file_dest='/u01/app/oracle/admin/stand/adump'
*.audit_trail='db'
*.compatible='12.1.0.2.0'
*.control_files='/u01/app/oracle/oradata/stand/control01.ctl','/u01/app/oracle/flash_recovery_area/stand/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='stand'
*.db_recovery_file_dest='/u01/app/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=4070572032
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=primXDB)'
*.memory_target=415236096
*.open_cursors=300
*.processes=1000
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
*.db_file_name_convert='/u01/app/oracle/oradata/prim/','/u01/app/oracle/oradata/stand/'
*.log_file_name_convert='/u01/app/oracle/oradata/prim/','/u01/app/oracle/oradata/stand/'
:wq
Make sure db_file_name_convert and log_file_name_convert parameters are present in pfile else it would
throw error while creating auxiliary database .
Once changes are done rename the pfile with your instance sid and copy it inside ORACLE_HOME/dbs
[oracle@server3] mv initprim.ora initstand.ora
[oracle@server3] cp initstand.ora $ORACLE_HOME/dbs
Step 4:
Create a password file for the Auxiliary Database using the ORAPWD utility.
orapwd file=/u01/app/oracle/product/11.2.0/db_1/dbs/orapwstand password=redhat
Step 5:
Start the auxiliary instance using the modified by pfile(initstand.ora)
[oracle@uat ~]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
[oracle@uat ~]$ export ORACLE_SID=stand
Keep in mind that the auxiliary instance doesnt have any instance running on, only oracle binaries are installed on this.
Step 6 :-
Create the required directory structures are mentioned in pfile.
oracle@server3 ~]$ mkdir -p /u01/app/oracle/admin/stand/adump
[oracle@server3 ~]$ mkdir -p /u01/app/oracle/oradata/stand/
[oracle@server3 ]$ mkdir -p /u01/app/oracle/flash_recovery_area/stand/
SQL> startup nomount pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initstand.ora'
ORACLE instance started.
Total System Global Area 754974720 bytes
Fixed Size 2928968 bytes
Variable Size 637537976 bytes
Database Buffers 109051904 bytes
Redo Buffers 5455872 bytes
Step 6:
Connect the auxiliary instance through RMAN and start the duplication.
The duplication is done by specifying the location of the backup pieces. The command to be used is
DUPLICATE DATABASE TO '<auxiliary dbname>' BACKUP LOCATION '<location of the backup pieces on the auxiliary server>'
[oracle@server3 dbs]$ rman auxiliary /
Recovery Manager: Release 12.1.0.2.0 - Production on Sat Jul 11 18:04:20 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to auxiliary database: stand (not mounted)
RMAN> duplicate database to 'stand' backup location '/u01/bkp' NOFILENAMECHECK;
Starting Duplicate Db at 08-JAN-15
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 413372416 bytes
Fixed Size 2213896 bytes
Variable Size 394266616 bytes
Database Buffers 12582912 bytes
Redo Buffers 4308992 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''PRIM'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''STAND'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile from '/u01/2015_02_17/o1_mf_ncsnf_TAG20150217T150813_bg632lxo_.bkp';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''PRIM'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''STAND'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 413372416 bytes
Fixed Size 2213896 bytes
Variable Size 394266616 bytes
Database Buffers 12582912 bytes
Redo Buffers 4308992 bytes
Starting restore at 08-JAN-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/stand/control01.ctl
output file name=/u01/app/oracle/flash_recovery_area/stand/control02.ctl
Finished restore at 08-JAN-15
database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
contents of Memory Script:
{
set until scn 58614791;
set newname for datafile 1 to
"/u01/app/oracle/oradata/stand/system01.dbf";
set newname for datafile 2 to
"/u01/app/oracle/oradata/stand/sysaux01.dbf";
set newname for datafile 3 to
"/u01/app/oracle/oradata/stand/undotbs01.dbf";
set newname for datafile 4 to
"/u01/app/oracle/oradata/stand/users01.dbf";
set newname for datafile 5 to
"/u01/app/oracle/oradata/stand/example01.dbf";
set newname for datafile 6 to
"/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf";
set newname for datafile 7 to
"/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.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
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 08-JAN-15
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 /u01/app/oracle/oradata/stand/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/stand/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/stand/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/stand/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/stand/example01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u01/2015_02_17/o1_mf_nnndf_TAG20150217T150813_bg6305j3_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/2015_02_17/o1_mf_nnndf_TAG20150217T150813_bg6305j3_.bkp tag=TAG20150217T150813
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:07
Finished restore at 08-JAN-15
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=8 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=9 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=10 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=11 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=12 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=13 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=14 STAMP=868491262 file name=/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf
contents of Memory Script:
{
set until scn 58614791;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 08-JAN-15
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=16
channel ORA_AUX_DISK_1: reading from backup piece /u01/2015_02_17/o1_mf_annnn_TAG20150217T150932_bg632nml_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/2015_02_17/o1_mf_annnn_TAG20150217T150932_bg632nml_.bkp tag=TAG20150217T150932
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=/u01/app/oracle/flash_recovery_area/STAND/archivelog/2015_01_08/o1_mf_1_16_bbxko71g_.arc thread=1 sequence=16
channel clone_default: deleting archived log(s)
archived log file name=/u01/app/oracle/flash_recovery_area/STAND/archivelog/2015_01_08/o1_mf_1_16_bbxko71g_.arc RECID=1 STAMP=868491263
media recovery complete, elapsed time: 00:00:00
Finished recover at 08-JAN-15
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''STAND'' 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 413372416 bytes
Fixed Size 2213896 bytes
Variable Size 394266616 bytes
Database Buffers 12582912 bytes
Redo Buffers 4308992 bytes
sql statement: alter system set db_name = ''STAND'' 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 413372416 bytes
Fixed Size 2213896 bytes
Variable Size 394266616 bytes
Database Buffers 12582912 bytes
Redo Buffers 4308992 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "STAND" RESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1 ( '/u01/app/oracle/oradata/stand/redo01.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u01/app/oracle/oradata/stand/redo02.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u01/app/oracle/oradata/stand/redo03.log' ) SIZE 50 M REUSE
DATAFILE
'/u01/app/oracle/oradata/stand/system01.dbf'
CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
set newname for tempfile 1 to
"/u01/app/oracle/oradata/stand/temp01.dbf";
switch clone tempfile all;
catalog clone datafilecopy "/u01/app/oracle/oradata/stand/sysaux01.dbf",
"/u01/app/oracle/oradata/stand/undotbs01.dbf",
"/u01/app/oracle/oradata/stand/users01.dbf",
"/u01/app/oracle/oradata/stand/example01.dbf",
"/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf",
"/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/stand/temp01.dbf in control file
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/sysaux01.dbf RECID=1 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/undotbs01.dbf RECID=2 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/users01.dbf RECID=3 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/example01.dbf RECID=4 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf RECID=5 STAMP=868491274
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf RECID=6 STAMP=868491274
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/GHHSTORE_DATA_TBS.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=868491274 file name=/u01/app/oracle/oradata/stand/GHHSTORE_IDX_TBS.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 08-JAN-15
RMAN>
SQL> select name from v$database;
NAME
---------
STAND
Done..!!!
Please share your ideas and opinions about this topic.
If you like this post, then please share with others.
Please subscribe on email for every updates on mail.
Nenhum comentário:
Postar um comentário