Sometimes we have to create a replica of production database to perform some test in it. we can create that replica using RMAN Duplicate command.
We can create this replica using Backups of production database as well as from Active production Database. RMAN Duplicate command gives us facility to create a replica of Production Database without backup.
We can do below mentioned things using RMAN Duplicate command :-
1. Duplicate a Production database on same host with different directory structure.
2. Duplicate a Production database on another host with same directory structure.
3. Duplicate a Production database on another host with different directory structure.
Duplicate of production database can be doe using below mention methods :-
1. Backup Based Duplication
2. Active Database Duplication
In this article I will show you how to do a Duplicate using Backup based duplication.
PFB steps to Duplicate a Production database on another host with different directory structure using Backup Based Duplication :-
We have Target database as 'TEST' . We are duplication it to 'AMIT'
1. Check that primary database is up and running in Archivelog mode :-
SQL> select name,open_mode,LOG_MODE from v$database;
NAME OPEN_MODE LOG_MODE
--------- -------------------- ------------
TEST READ WRITE ARCHIVELOG
2. Add the tns details of target and auxiliary in both server(Target, Auxiliary)
AMIT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.20.12)(PORT = 1523))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test.db.com)
)
)
AMIT_DUP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.20.14)(PORT = 1523))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = amit.db.com)
)
)
3. Add the static entry of Auxiliary instance in listener.ora file
(SID_DESC =
(GLOBAL_DBNAME = amit.db.com)
(SID_NAME = TEST)
(ORACLE_HOME = /opt/oracle/product/database/11.2.0.4)
)
4. On Target host create pfile for Auxiliary Database :-
*.audit_file_dest='/ora_backup/TEST/duplicate_test/AMIT/adump'
*.audit_trail='DB'
*.compatible='11.2.0.4.0'
*.control_files='/ora_backup/TEST/duplicate_test/AMIT/control01.ctl','/ora_backup/TEST/duplicate_test/AMIT/control02.ctl'
*.db_block_size=16384
*.db_file_name_convert='/ora_backup/TEST1/restore_test/TEST/DATA','/ora_backup/TEST/duplicate_test/AMIT/DATA/'
*.log_file_name_convert='/ora_backup/TEST1/restore_test/TEST/','/ora_backup/TEST/duplicate_test/AMIT/'
*.db_create_online_log_dest_1='/ora_backup/TEST/duplicate_test/AMIT/LOG/'
*.db_create_file_dest='/ora_backup/TEST/duplicate_test/AMIT/DATA/'
*.db_domain='mydb.domain'
*.db_name='AMIT'
*.db_recovery_file_dest='/ora_backup/TEST/duplicate_test/AMIT/FRA'
*.db_recovery_file_dest_size=65G
*.log_archive_dest_1='location=/ora_backup/TEST/duplicate_test/AMIT/FRA/'
*.diagnostic_dest='/ora_backup/TEST/duplicate_test/AMIT/diag'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=1061607680
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
Above parameters in Green has to be modified according to the auxiliary server.
5. Start the auxiliay Instance in nomount mode :-
We can create this replica using Backups of production database as well as from Active production Database. RMAN Duplicate command gives us facility to create a replica of Production Database without backup.
We can do below mentioned things using RMAN Duplicate command :-
1. Duplicate a Production database on same host with different directory structure.
2. Duplicate a Production database on another host with same directory structure.
3. Duplicate a Production database on another host with different directory structure.
Duplicate of production database can be doe using below mention methods :-
1. Backup Based Duplication
2. Active Database Duplication
In this article I will show you how to do a Duplicate using Backup based duplication.
PFB steps to Duplicate a Production database on another host with different directory structure using Backup Based Duplication :-
We have Target database as 'TEST' . We are duplication it to 'AMIT'
1. Check that primary database is up and running in Archivelog mode :-
SQL> select name,open_mode,LOG_MODE from v$database;
NAME OPEN_MODE LOG_MODE
--------- -------------------- ------------
TEST READ WRITE ARCHIVELOG
2. Add the tns details of target and auxiliary in both server(Target, Auxiliary)
AMIT =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.20.12)(PORT = 1523))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = test.db.com)
)
)
AMIT_DUP =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.20.14)(PORT = 1523))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = amit.db.com)
)
)
(SID_DESC =
(GLOBAL_DBNAME = amit.db.com)
(SID_NAME = TEST)
(ORACLE_HOME = /opt/oracle/product/database/11.2.0.4)
)
*.audit_file_dest='/ora_backup/TEST/duplicate_test/AMIT/adump'
*.audit_trail='DB'
*.compatible='11.2.0.4.0'
*.control_files='/ora_backup/TEST/duplicate_test/AMIT/control01.ctl','/ora_backup/TEST/duplicate_test/AMIT/control02.ctl'
*.db_block_size=16384
*.db_file_name_convert='/ora_backup/TEST1/restore_test/TEST/DATA','/ora_backup/TEST/duplicate_test/AMIT/DATA/'
*.log_file_name_convert='/ora_backup/TEST1/restore_test/TEST/','/ora_backup/TEST/duplicate_test/AMIT/'
*.db_create_online_log_dest_1='/ora_backup/TEST/duplicate_test/AMIT/LOG/'
*.db_create_file_dest='/ora_backup/TEST/duplicate_test/AMIT/DATA/'
*.db_domain='mydb.domain'
*.db_name='AMIT'
*.db_recovery_file_dest='/ora_backup/TEST/duplicate_test/AMIT/FRA'
*.db_recovery_file_dest_size=65G
*.log_archive_dest_1='location=/ora_backup/TEST/duplicate_test/AMIT/FRA/'
*.diagnostic_dest='/ora_backup/TEST/duplicate_test/AMIT/diag'
*.log_archive_format='%t_%s_%r.dbf'
*.memory_target=1061607680
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
Above parameters in Green has to be modified according to the auxiliary server.
5. Start the auxiliay Instance in nomount mode :-
==>sqlplus
SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 2 01:14:47 2014
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> startup force nomount pfile='/ora_backup/TEST/duplicate_test/initAMIT.ora'
ORACLE instance started.
Total System Global Area 1060585472 bytes
Fixed Size 2260000 bytes
Variable Size 633340896 bytes
Database Buffers 402653184 bytes
Redo Buffers 22331392 bytes
6. Create spfile from pfile and start it again using spfile :-
SQL> create spfile from pfile='/ora_backup/TEST/duplicate_test/initAMIT.ora';
File created.
SQL> startup force nomount
ORACLE instance started.
Total System Global Area 1060585472 bytes
Fixed Size 2260000 bytes
Variable Size 633340896 bytes
Database Buffers 402653184 bytes
Redo Buffers 22331392 bytes
7. Check the below parameters in auxiliary instance :-
SQL> show parameter control_files
SQL> show parameter db_file_name_convert
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string /ora_backup/TEST1/restore_test/TEST/DATA, /ora_backup/TEST/duplicate_test/AMIT/DATA/
SQL> show parameter log_file
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_file_name_convert string /ora_backup/TEST1/restore_test/TEST/, /ora_backup/TEST/duplicate_test/AMIT/
We have to set above parameter when we do a duplicate database on another host with different file structure.
8. Take a backup of Target database :-
RMAN> backup as backupset database plus archivelog;
Starting backup at 2014-12-05 07:00:17
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
10. Start the RMAN duplicate command. If you are using a SPFILE for auxiliary instance then copy the SPFILE at the default location ($ORACLE_HOME/dbs) as while doing a duplicate RMAN will shut down the Auxiliary instance and start it again using SPFILE.
If you want to use a pfile then mention Pfile parameter in Duplicate command(optional) :-
pfile=/ora_backup/TEST/duplicate_test/initAMIT.ora;
If we have to duplicate database on same host then we have to follow the same above process. One thing we have to keep in mind while duplicating on same host , DB name of Auxiliary instance has to be different from target.
PFB link to Duplicate database with same file structure on another host.
Please click on link for Duplicating database using Active Database Duplication.
I hope this article helped you.
Regards,
Amit Rath
SQL> create spfile from pfile='/ora_backup/TEST/duplicate_test/initAMIT.ora';
File created.
SQL> startup force nomount
ORACLE instance started.
Total System Global Area 1060585472 bytes
Fixed Size 2260000 bytes
Variable Size 633340896 bytes
Database Buffers 402653184 bytes
Redo Buffers 22331392 bytes
7. Check the below parameters in auxiliary instance :-
SQL> show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string /ora_backup/TEST/duplicate_test/AMIT/control01.ctl, /ora_ba
ckup/TEST/duplicate_test/AMIT/control02.ctl
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_name_convert string /ora_backup/TEST1/restore_test/TEST/DATA, /ora_backup/TEST/duplicate_test/AMIT/DATA/
SQL> show parameter log_file
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_file_name_convert string /ora_backup/TEST1/restore_test/TEST/, /ora_backup/TEST/duplicate_test/AMIT/
We have to set above parameter when we do a duplicate database on another host with different file structure.
8. Take a backup of Target database :-
RMAN> backup as backupset database plus archivelog;
Starting backup at 2014-12-05 07:00:17
current log archived
using channel ORA_DISK_1
using channel ORA_DISK_2
using channel ORA_DISK_3
using channel ORA_DISK_4
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
.
.
.
Starting Control File and SPFILE Autobackup at 2014-12-05 07:03:36
piece handle=/ora_backup/TEST1/restore_test/TEST/FRA/TEST/autobackup/2014_12_05
Finished Control File and SPFILE Autobackup at 2014-12-05 07:05:08
RMAN>
9. Move these backups to Auxiliary server
If you want to use a pfile then mention Pfile parameter in Duplicate command(optional) :-
pfile=/ora_backup/TEST/duplicate_test/initAMIT.ora;
RMAN> run
2> {
3> allocate auxiliary channel ch1 type disk;
######## optional if target database backups configured in Tape, then mention this#######
4> duplicate database to 'AMIT'
5> backup location
'/ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05';
6> }
allocated channel: ch1
channel ch1: SID=145 device type=DISK
Starting Duplicate Db at 2014-12-09 05:40:06
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 1060585472 bytes
Fixed
Size
2260000 bytes
Variable
Size
637535200 bytes
Database
Buffers
398458880 bytes
Redo
Buffers
22331392 bytes
allocated channel: ch1
channel ch1: SID=139 device type=DISK
contents of Memory Script:
{
sql clone "alter system set db_name =
''TEST'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name
=
''AMIT'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
restore clone primary controlfile from
'/ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_s_865494230_b837sqmr_.bkp';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''TEST''
comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name =
''AMIT'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 1060585472 bytes
Fixed
Size
2260000 bytes
Variable
Size
637535200 bytes
Database
Buffers
398458880 bytes
Redo
Buffers
22331392 bytes
allocated channel: ch1
channel ch1: SID=145 device type=DISK
Starting restore at 2014-12-09 05:43:21
channel ch1: restoring control file
channel ch1: restore complete, elapsed time: 00:00:08
output file name=/ora_backup/TEST/duplicate_test/AMIT/control01.ctl
output file name=/ora_backup/TEST/duplicate_test/AMIT/control02.ctl
Finished restore at 2014-12-09 05:43:29
database mounted
contents of Memory Script:
{
set until scn 5071278;
set newname for datafile 1 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//system01.dbf";
set newname for datafile 2 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//sysaux01.dbf";
set newname for datafile 3 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//undotbs1.dbf";
set newname for datafile 4 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//undotbs2.dbf";
set newname for datafile 5 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//users_1.dbf";
set newname for datafile 6 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//ts_aud01.dbf";
set newname for datafile 7 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//DATA_data01.dbf";
set newname for datafile 8 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//DATA_idx01.dbf";
set newname for datafile 9 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//DATA_arch01.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
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 2014-12-09 05:44:20
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00005 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//users_1.dbf
channel ch1: restoring datafile 00006 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//ts_aud01.dbf
channel ch1: restoring datafile 00009 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//DATA_arch01.dbf
channel ch1: reading from backup piece /ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_nnndf_TAG20141205T070140_b837o5wj_.bkp
channel ch1: piece
handle=/ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_nnndf_TAG20141205T070140_b837o5wj_.bkp
tag=TAG20141205T070140
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:02:45
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00001 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//system01.dbf
channel ch1: restoring datafile 00003 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//undotbs1.dbf
channel ch1: restoring datafile 00008 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//DATA_idx01.dbf
channel ch1: reading from backup piece /ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_nnndf_TAG20141205T070140_b837o7sj_.bkp
channel ch1: piece
handle=/ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_nnndf_TAG20141205T070140_b837o7sj_.bkp
tag=TAG20141205T070140
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:01:36
channel ch1: starting datafile backup set restore
channel ch1: specifying datafile(s) to restore from backup set
channel ch1: restoring datafile 00002 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//sysaux01.dbf
channel ch1: restoring datafile 00004 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//undotbs2.dbf
channel ch1: restoring datafile 00007 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//DATA_data01.dbf
channel ch1: reading from backup piece
/ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_nnndf_TAG20141205T070140_b837oc9d_.bkp
channel ch1: piece
handle=/ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_nnndf_TAG20141205T070140_b837oc9d_.bkp
tag=TAG20141205T070140
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:01:25
Finished restore at 2014-12-09 05:50:11
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=10 STAMP=865835412 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=11 STAMP=865835413 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=12 STAMP=865835414 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/undotbs1.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=13 STAMP=865835415 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/undotbs2.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=14 STAMP=865835415 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/users_1.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=15 STAMP=865835417 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/ts_aud01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=16 STAMP=865835418 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_data01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=17 STAMP=865835419 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_idx01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=18 STAMP=865835420 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_arch01.dbf
contents of Memory Script:
{
set until scn 5071278;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 2014-12-09 05:50:31
starting media recovery
channel ch1: starting archived log restore to default destination
channel ch1: restoring archived log
archived log thread=1 sequence=10
channel ch1: reading from backup piece
/ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_annnn_TAG20141205T070313_b837r28m_.bkp
channel ch1: piece
handle=/ora_backup/TEST/duplicate_test/AMIT/FRA/2014_12_05/o1_mf_annnn_TAG20141205T070313_b837r28m_.bkp
tag=TAG20141205T070313
channel ch1: restored backup piece 1
channel ch1: restore complete, elapsed time: 00:00:02
archived log file
name=/ora_backup/TEST/duplicate_test/AMIT/FRA/1_10_864800713.dbf thread=1
sequence=10
channel clone_default: deleting archived log(s)
archived log file
name=/ora_backup/TEST/duplicate_test/AMIT/FRA/1_10_864800713.dbf RECID=1
STAMP=865835516
media recovery complete, elapsed time: 00:00:08
Finished recover at 2014-12-09 05:52:04
Oracle instance started
Total System Global Area 1060585472 bytes
Fixed
Size
2260000 bytes
Variable
Size
637535200 bytes
Database
Buffers
398458880 bytes
Redo
Buffers
22331392 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''AMIT'' 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 = ''AMIT''
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 1060585472 bytes
Fixed
Size
2260000 bytes
Variable
Size
637535200 bytes
Database
Buffers
398458880 bytes
Redo
Buffers
22331392 bytes
allocated channel: ch1
channel ch1: SID=145 device type=DISK
sql statement: CREATE CONTROLFILE REUSE SET DATABASE
"AMIT" RESETLOGS ARCHIVELOG
MAXLOGFILES 192
MAXLOGMEMBERS 3
MAXDATAFILES 1024
MAXINSTANCES 32
MAXLOGHISTORY 4672
LOGFILE
GROUP 1 (
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_1.283.859503479',
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_1.1335.859503481' ) SIZE 256
M REUSE,
GROUP 2 (
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_2.1429.859503481',
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_2.284.859503481' ) SIZE 256
M REUSE,
GROUP 10 (
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_10.1258.859929365',
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_10.298.859929363' ) SIZE 256
M REUSE
DATAFILE
'/ora_backup/TEST/duplicate_test/AMIT/DATA/system01.dbf'
CHARACTER SET AL32UTF8
sql statement: ALTER DATABASE ADD LOGFILE
INSTANCE 'i2'
GROUP 3 (
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_3.291.859504009',
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_3.1303.859504009' ) SIZE 256
M REUSE,
GROUP 4 (
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_4.1246.859504011',
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_4.292.859504011' ) SIZE 256
M REUSE,
GROUP 20 (
'/ora_backup/TEST/duplicate_test/AMIT/DATA/group_20.858.859929393', '/ora_backup/TEST/duplicate_test/AMIT/DATA/group_20.299.859929393'
) SIZE 256 M REUSE
contents of Memory Script:
{
set newname for tempfile 1 to
"/ora_backup/TEST/duplicate_test/AMIT/DATA//AMIT/datafile/o1_mf_temp_b446vnwf_.tmp";
switch clone tempfile all;
catalog clone datafilecopy
"/ora_backup/TEST/duplicate_test/AMIT/DATA/sysaux01.dbf",
"/ora_backup/TEST/duplicate_test/AMIT/DATA/undotbs1.dbf",
"/ora_backup/TEST/duplicate_test/AMIT/DATA/undotbs2.dbf",
"/ora_backup/TEST/duplicate_test/AMIT/DATA/users_1.dbf",
"/ora_backup/TEST/duplicate_test/AMIT/DATA/ts_aud01.dbf",
"/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_data01.dbf",
"/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_idx01.dbf",
"/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_arch01.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to
/ora_backup/TEST/duplicate_test/AMIT/DATA//AMIT/datafile/o1_mf_temp_b446vnwf_.tmp
in control file
cataloged datafile copy
datafile copy file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/sysaux01.dbf RECID=1
STAMP=865836027
cataloged datafile copy
datafile copy file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/undotbs1.dbf RECID=2
STAMP=865836028
cataloged datafile copy
datafile copy file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/undotbs2.dbf RECID=3
STAMP=865836028
cataloged datafile copy
datafile copy file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/users_1.dbf RECID=4
STAMP=865836029
cataloged datafile copy
datafile copy file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/ts_aud01.dbf RECID=5
STAMP=865836029
cataloged datafile copy
datafile copy file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_data01.dbf RECID=6
STAMP=865836030
cataloged datafile copy
datafile copy file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_idx01.dbf RECID=7
STAMP=865836030
cataloged datafile copy
datafile copy file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_arch01.dbf RECID=8
STAMP=865836031
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=865836027 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=865836028 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/undotbs1.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=865836028 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/undotbs2.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=865836029 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/users_1.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=865836029 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/ts_aud01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=865836030 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_data01.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=865836030 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_idx01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=8 STAMP=865836031 file
name=/ora_backup/TEST/duplicate_test/AMIT/DATA/DATA_arch01.dbf
Reenabling controlfile options for auxiliary database
Executing: alter database force logging
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 2014-12-09 06:03:30
released channel: ch1
Database Duplicated using Backup Based Duplication on another host with different file structure .
If we have to duplicate database on same host then we have to follow the same above process. One thing we have to keep in mind while duplicating on same host , DB name of Auxiliary instance has to be different from target.
PFB link to Duplicate database with same file structure on another host.
Please click on link for Duplicating database using Active Database Duplication.
I hope this article helped you.
Regards,
Amit Rath
No comments:
Post a Comment