Active database duplication create a copy of database to a new one from your current running database. This feature does not need any backup to be taken, nor needs any restore. It can occur on both the local box and over the network.
The following is the command for Active Database Duplication:
RMAN> DUPLICATE TARGET DATABASE TO <db_name> FROM ACTIVE DATABASE;
In this example, the following specification is used:
Goal: Clone the Target Database
Operating System: Enterprise Linux Enterprise Linux AS release 4 (October Update 8)
Database: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0
Target (Source) db_name: ORCL11G
Auxiliary (Destination) db_name: AUX11G
Target & Auxiliary Database Location: Local Box (Same Host)
Target Database Host: dgprim.localdomain
Auxiliary Database Host: dgstan.localdomain
Listener Name: LISTENER11G
Automatic Diagnostic Repository (ADR) Home (diagnostic_dest): /u01/app/oracle, the default is the value for {ORACLE_BASE}
- Prepare the Auxiliary Instance.
- From source database, query the current datafiles and online logs locations.
> [oracle@oracle11g dbs]$ . oraenv
> ORACLE_SID = [ORCL11G] ? ORCL11G
> SQL> select name from v$datafile;
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u02/oradata/ORCL11G/datafile/o1_mf_system_7mrxldmf_.dbf
/u02/oradata/ORCL11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf
/u02/oradata/ORCL11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf
/u02/oradata/ORCL11G/datafile/o1_mf_users_7mrxldsy_.dbf
/u02/oradata/ORCL11G/datafile/o1_mf_example_7mrxtcwj_.dbf
- On Auxiliary Database Machine, create the Oracle directory structures. From the above, we will have an idea what would be the structure for the auxiliary database. We need these values for DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT in our parameter files.SQL> select member, GROUP# from v$logfile;
MEMBER GROUP#
---------------------------------------------------------------------- ----------
/u02/oradata/ORCL11G/onlinelog/o1_mf_3_7mrxrl66_.log 3
/u02/flash_recovery_area/ORCL11G/onlinelog/o1_mf_3_7mrxrsp0_.log 3
/u02/oradata/ORCL11G/onlinelog/o1_mf_2_7mrxr2lz_.log 2
/u02/flash_recovery_area/ORCL11G/onlinelog/o1_mf_2_7mrxr68h_.log 2
/u02/oradata/ORCL11G/onlinelog/o1_mf_1_7mrxqvg8_.log 1
/u02/flash_recovery_area/ORCL11G/onlinelog/o1_mf_1_7mrxqxc0_.log 1
6 rows selected.
SQL>
> [oracle@oracle11g dbs]$ mkdir -p /u02/oradata/AUX11G/datafile
> [oracle@oracle11g dbs]$ mkdir -p /u02/oradata/AUX11G/onlinelog
> [oracle@oracle11g dbs]$ mkdir -p /u02/flash_recovery_area/AUX11G/onlinelog
- Create the audit_file_dest directory.
> [oracle@oracle11g dbs]$ mkdir -p /u01/app/oracle/admin/AUX11G/adump
- Create the Password File for the Auxiliary Instance
- Make sure that you have properly set your ORACLE_HOME and ORACLE_SID
> [ORCLA10 /home/oracle]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
> [ORCLA10 /home/oracle]$ export ORACLE_SID=AUX11G
- From the command prompt, create the password file for your auxiliary database.
> [oracle@oracle11g dbs]$ orapwd file=$ORACLE_HOME/dbs/orapwAUX11G password=oracle entries=5
- From Auxiliary Database Machine, configure listener.ora and tnsnames.ora for the Auxiliary Instance
> Add or edit the following lines: [oracle@oracle11g dbs]$ vi $ORACLE_HOME/network/admin/listener.ora
> Reload the listener. [oracle@oracle11g dbs]$ lsnrctl reload LISTENER11GLISTENER11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgstan.localdomain)(PORT = 1522))
)
SID_LIST_LISTENER11G =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = AUX11G)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME = AUX11G)
)
)
ADR_BASE_LISTENER11G = /u01/app/oracle
> Add or edit the following lines: [oracle@oracle11g dbs]$ vi $ORACLE_HOME/network/admin/tnsnames.ora
- From Target Database Machine, add or edit the following lines: [oracle@oracle11g dbs]$ vi $ORACLE_HOME/network/admin/tnsnames.oraAUX11G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgstan.localdomain)(PORT = 1522))
)
(CONNECT_DATA =
(SERVICE_NAME = AUX11G)
)
)
ORCL11G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgprim.localdomain)(PORT = 1522))
)
(CONNECT_DATA =
(SERVICE_NAME = ORCL11G)
)
)
- Test if you can now tnsping your Auxiliary Instance both in Target and Auxiliary Machine.AUX11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dgstan.localdomain)(PORT = 1522))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = AUX11G)
)
)
> [oracle@oracle11g dbs]$ tnsping AUX11G
> [oracle@oracle11g dbs]$ tnsping ORCL11G[oracle@oracle11g dbs]$ tnsping AUX11G
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 26-FEB-2012 01:23:24
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle11g.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = AUX11G)))
OK (10 msec)
- Create the Parameter File for the Auxiliary Instance[AUX11G /u02]$ tnsping ORCL11G
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 26-FEB-2012 14:48:27
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = dgprim.localdomain)(PORT = 1522))) (CONNECT_DATA = (SERVICE_NAME = ORCL11G)))
OK (0 msec)
[AUX11G /u02]$
> There are many different ways to do this. In this example, we will create pfile from spfile of the target database then edit some parameters to fit with our auxiliary database.
> On target database, create pfile from spfile.
> SQL> create pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initAUX11G.ora' from spfile;
- From Target Database Machine, copy the pfile to Auxiliary Database Machine.[oracle@oracle11g dbs]$ . oraenv
ORACLE_SID = [ORCL11G] ?
The Oracle base for ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_2 is /u01/app/oracle
[oracle@oracle11g dbs]$ sqlplus '/ as sysdba'
SQL*Plus: Release 11.2.0.1.0 Production on Sun Feb 26 01:02:19 2012
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initAUX11G.ora' from spfile;
File created.
SQL>
> [ORCL11G /home/oracle]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs
> [ORCL11G /u01/app/oracle/product/11.2.0/dbhome_1/dbs]$ scp -v initAUX11G.ora oracle@dgstan.localdomain:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/
- From Auxiliary Database Machine, edit and adjust your auxiliary instance pfile.[ORCL11G /u01/app/oracle/product/11.2.0/dbhome_1/dbs]$ scp -v initAUX11G.ora oracle@dgstan.localdomain:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/
Executing: program /usr/bin/ssh host dgstan.localdomain, user oracle, command scp -v -t /u01/app/oracle/product/11.2.0/dbhome_1/dbs/
OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to dgstan.localdomain [192.168.218.130] port 22.
debug1: Connection established.
debug1: identity file /home/oracle/.ssh/identity type -1
debug1: identity file /home/oracle/.ssh/id_rsa type -1
debug1: identity file /home/oracle/.ssh/id_dsa type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_3.9p1
debug1: match: OpenSSH_3.9p1 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'dgstan.localdomain' is known and matches the RSA host key.
debug1: Found key in /home/oracle/.ssh/known_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/oracle/.ssh/identity
debug1: Trying private key: /home/oracle/.ssh/id_rsa
debug1: Trying private key: /home/oracle/.ssh/id_dsa
debug1: Next authentication method: password
oracle@dgstan.localdomain's password:
debug1: Authentication succeeded (password).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: Sending command: scp -v -t /u01/app/oracle/product/11.2.0/dbhome_1/dbs/
Sending file modes: C0644 687 initAUX11G.ora
Sink: C0644 687 initAUX11G.ora
initAUX11G.ora 100% 687 0.7KB/s 00:00
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: channel 0: free: client-session, nchannels 1
debug1: fd 0 clearing O_NONBLOCK
debug1: fd 1 clearing O_NONBLOCK
debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 0.2 seconds
debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0
debug1: Exit status 0
> [oracle@oracle11g dbs]$ cd $ORACLE_HOME/dbs
> [oracle@oracle11g dbs]$ vi initAUX11G.ora
> Add the additional parameters:
*.DB_FILE_NAME_CONVERT = ("/u02/oradata/ORCL11G/datafile","/u02/oradata/AUX11G/datafile")
*.LOG_FILE_NAME_CONVERT = ("/u02/oradata/ORCL11G/onlinelog","/u02/oradata/AUX11G/onlinelog","/u02/flash_recovery_area/ORCL11G/onlinelog","/u02/flash_recovery_area/AUX11G/onlinelog")
> Remove the control_files line. This will be automatically recreated during duplication.
Note: In this case, the target database has only one datafiles location, /u02/oradata/ORCL11G/datafile. In database wherein there are more than one datafiles location, you will also need to specify the auxiliary directory locations. The syntax would be, DB_FILE_NAME_CONVERT = ("TARGET_DIR1","AUXILILARY_DIR1","TARGET_DIR2","AUXILILARY_DIR2"). The same is true with LOG_FILE_NAME_CONVERT
> The auxiliary instance parameter file would look like this:
- We are now ready to clone the database using RMAN Active Database Duplication.*.audit_file_dest='/u01/app/oracle/admin/AUX11G/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
#*.control_files='/u02/oradata/AUX11G/controlfile/o1_mf_7nm95z0v_.ctl','/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nm95z72_.ctl'
*.db_block_size=8192
*.db_create_file_dest='/u02/oradata'
*.db_domain=''
*.db_name='AUX11G'
*.db_recovery_file_dest='/u02/flash_recovery_area'
*.db_recovery_file_dest_size=4039114752
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
- Set proper ORACLE_HOME on Auxiliary Database Machine
> [oracle@oracle11g dbs]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
- Set ORACLE_SID to your Auxiliary Instance.
> [oracle@oracle11g dbs]$ export ORACLE_SID=AUX11G
- Startup nomount the auxiliary instance in preparation for duplication using the created pfile.
> SQL> startup nomount pfile=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initAUX11G.ora
- From Target Database Machine, connect to target and auxiliarty instances using RMAN. The auxiliary instance should be in nomount mode: connected to auxiliary database: AUX11G (not mounted)SQL> startup nomount pfile=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initAUX11G.ora
ORACLE instance started.
Total System Global Area 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
SQL>
> [oracle@oracle11g dbs]$ rman target sys/oracle@ORCL11G auxiliary sys/oracle@AUX11G
- Perform Active Database Duplication.[ORCL11G /home/oracle]$ rman target sys/oracle@ORCL11G auxiliary sys/oracle@AUX11G
Recovery Manager: Release 11.2.0.1.0 - Production on Sun Feb 26 14:53:38 2012
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORCL11G (DBID=883142655)
connected to auxiliary database: AUX11G (not mounted)
> RMAN> DUPLICATE TARGET DATABASE TO AUX11G FROM ACTIVE DATABASE;
- Add your auxiliary database to oratabRMAN> DUPLICATE TARGET DATABASE TO AUX11G FROM ACTIVE DATABASE;
Starting Duplicate Db at 26-FEB-12
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 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 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
contents of Memory Script:
{
sql clone "alter system set control_files =
''/u02/oradata/AUX11G/controlfile/o1_mf_7nmorqsv_.ctl'', ''/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nmorqtf_.ctl'' comment=
''Set by RMAN'' scope=spfile";
sql clone "alter system set db_name =
''ORCL11G'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''AUX11G'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/u02/oradata/AUX11G/controlfile/o1_mf_7nmorqvb_.ctl';
restore clone controlfile to '/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nmorqvk_.ctl' from
'/u02/oradata/AUX11G/controlfile/o1_mf_7nmorqvb_.ctl';
sql clone "alter system set control_files =
''/u02/oradata/AUX11G/controlfile/o1_mf_7nmorqvb_.ctl'', ''/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nmorqvk_.ctl'' comment=
''Set by RMAN'' scope=spfile";
shutdown clone immediate;
startup clone nomount;
alter clone database mount;
}
executing Memory Script
sql statement: alter system set control_files = ''/u02/oradata/AUX11G/controlfile/o1_mf_7nmorqsv_.ctl'', ''/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nmorqtf_.ctl'' comment= ''Set by RMAN'' scope=spfile
sql statement: alter system set db_name = ''ORCL11G'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''AUX11G'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
Starting backup at 26-FEB-12
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_ORCL11G.f tag=TAG20120226T145421 RECID=2 STAMP=776271264
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
Finished backup at 26-FEB-12
Starting restore at 26-FEB-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 26-FEB-12
sql statement: alter system set control_files = ''/u02/oradata/AUX11G/controlfile/o1_mf_7nmorqvb_.ctl'', ''/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nmorqvk_.ctl'' comment= ''Set by RMAN'' scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
database mounted
contents of Memory Script:
{
set newname for clone datafile 1 to new;
set newname for clone datafile 2 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 4 to new;
set newname for clone datafile 5 to new;
backup as copy reuse
datafile 1 auxiliary format new
datafile 2 auxiliary format new
datafile 3 auxiliary format new
datafile 4 auxiliary format new
datafile 5 auxiliary format new
;
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
Starting backup at 26-FEB-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u02/oradata/ORCL11G/datafile/o1_mf_system_7nm90q3r_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_system_02n49tdl_.dbf tag=TAG20120226T145445
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u02/oradata/ORCL11G/datafile/o1_mf_sysaux_7nm90qt3_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_sysaux_03n49tfo_.dbf tag=TAG20120226T145445
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:56
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u02/oradata/ORCL11G/datafile/o1_mf_example_7nm98zhm_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_example_04n49thh_.dbf tag=TAG20120226T145445
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u02/oradata/ORCL11G/datafile/o1_mf_undotbs1_7nm90qxb_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_05n49tho_.dbf tag=TAG20120226T145445
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u02/oradata/ORCL11G/datafile/o1_mf_users_7nm90r09_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_users_06n49thv_.dbf tag=TAG20120226T145445
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 26-FEB-12
sql statement: alter system archive log current
contents of Memory Script:
{
backup as copy reuse
archivelog like "/u02/flash_recovery_area/ORCL11G/archivelog/2012_02_26/o1_mf_1_4_7nmoy1w5_.arc" auxiliary format
"/u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_4_%u_.arc" ;
catalog clone recovery area;
switch clone datafile all;
}
executing Memory Script
Starting backup at 26-FEB-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=4 RECID=2 STAMP=776271426
output file name=/u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_4_07n49ti3_.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 26-FEB-12
searching for all files in the recovery area
List of Files Unknown to the Database
=====================================
File Name: /u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nmorqtf_.ctl
File Name: /u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_4_07n49ti3_.arc
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: /u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_4_07n49ti3_.arc
List of Files Which Where Not Cataloged
=======================================
File Name: /u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nmorqtf_.ctl
RMAN-07517: Reason: The file header is corrupted
datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=776271434 file name=/u02/oradata/AUX11G/datafile/o1_mf_system_02n49tdl_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=776271434 file name=/u02/oradata/AUX11G/datafile/o1_mf_sysaux_03n49tfo_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=776271434 file name=/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_05n49tho_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=776271434 file name=/u02/oradata/AUX11G/datafile/o1_mf_users_06n49thv_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=776271434 file name=/u02/oradata/AUX11G/datafile/o1_mf_example_04n49thh_.dbf
contents of Memory Script:
{
set until scn 830524;
recover
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 26-FEB-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 device type=DISK
starting media recovery
archived log for thread 1 with sequence 4 is already on disk as file /u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_4_07n49ti3_.arc
archived log file name=/u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_4_07n49ti3_.arc thread=1 sequence=4
media recovery complete, elapsed time: 00:00:06
Finished recover at 26-FEB-12
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
sql clone "alter system set db_name =
''AUX11G'' 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 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
sql statement: alter system set db_name = ''AUX11G'' 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 146472960 bytes
Fixed Size 1335080 bytes
Variable Size 92274904 bytes
Database Buffers 50331648 bytes
Redo Buffers 2531328 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "AUX11G" 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
'/u02/oradata/AUX11G/datafile/o1_mf_system_02n49tdl_.dbf'
CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
set newname for clone tempfile 1 to new;
switch clone tempfile all;
catalog clone datafilecopy "/u02/oradata/AUX11G/datafile/o1_mf_sysaux_03n49tfo_.dbf",
"/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_05n49tho_.dbf",
"/u02/oradata/AUX11G/datafile/o1_mf_users_06n49thv_.dbf",
"/u02/oradata/AUX11G/datafile/o1_mf_example_04n49thh_.dbf";
switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u02/oradata/AUX11G/datafile/o1_mf_temp_%u_.tmp in control file
cataloged datafile copy
datafile copy file name=/u02/oradata/AUX11G/datafile/o1_mf_sysaux_03n49tfo_.dbf RECID=1 STAMP=776271463
cataloged datafile copy
datafile copy file name=/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_05n49tho_.dbf RECID=2 STAMP=776271463
cataloged datafile copy
datafile copy file name=/u02/oradata/AUX11G/datafile/o1_mf_users_06n49thv_.dbf RECID=3 STAMP=776271463
cataloged datafile copy
datafile copy file name=/u02/oradata/AUX11G/datafile/o1_mf_example_04n49thh_.dbf RECID=4 STAMP=776271463
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=776271463 file name=/u02/oradata/AUX11G/datafile/o1_mf_sysaux_03n49tfo_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=776271463 file name=/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_05n49tho_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=776271463 file name=/u02/oradata/AUX11G/datafile/o1_mf_users_06n49thv_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=776271463 file name=/u02/oradata/AUX11G/datafile/o1_mf_example_04n49thh_.dbf
contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 26-FEB-12
RMAN>
> [oracle@oracle11g dbs]$ vi /etc/oratab
> Add the following line:
AUX11G:/u01/app/oracle/product/11.2.0/dbhome_1:N
- Verify that the auxiliary database is up: http://www.oracle-forums.com/check-orac ... us-t2.html
-- End of RMAN Active Database Duplication on Different Host --General Database Information
------------------------------------------------------------------------------------------------------------------------
Database Name : AUX11G
Open Mode : READ WRITE
Database SGA (Mb) : 140
Database Size (Mb): 1519
Hostname : dgstan.localdomain
Inst Name : AUX11G
Inst Status : ACTIVE and OPEN
Inst Started At : 26-FEB-2012 14:57:41
Appl Sessions : 0
Appl Processes : 0
Locked Objects : 0
Archiver : STARTED
Uptime : 0 days(s) 0 hour(s) 2 minute(s) 35 seconds
Version : CORE 11.2.0.1.0 Production
Version : NLSRTL Version 11.2.0.1.0 - Production
Version : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
Version : PL/SQL Release 11.2.0.1.0 - Production
Version : TNS for Linux: Version 11.2.0.1.0 - Production