RMAN Active Database Duplication

Information on Oracle-preferred method for efficiently backing up and recovering an Oracle Database which is RMAN
Post Reply
User avatar
jimb
Site Admin
Posts: 6146
Joined: Thu Jan 19, 2012 1:10 pm
Location: New Delhi, India
Contact:

RMAN Active Database Duplication

Post by jimb »

RMAN Active Database Duplication is a feature in Oracle Database 11g. With this, you do not need a current RMAN backup to duplicate your database, and you do not have to move copies of your backups to clone a database using RMAN.

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)
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
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>
- 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.
> [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
- 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

- Configure listener.ora and tnsnames.ora for the Auxiliary Instance
> [oracle@oracle11g dbs]$ vi $ORACLE_HOME/network/admin/listener.ora
LISTENER11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle11g.localdomain)(PORT = 1521))
)

SID_LIST_LISTENER11G =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = AUX11G)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_2)
(SID_NAME = AUX11G)
)
(SID_DESC =
(GLOBAL_DBNAME = ORCL11G)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_2)
(SID_NAME = ORCL11G)
)
)

ADR_BASE_LISTENER11G = /u01/app/oracle
> Reload the listener. [oracle@oracle11g dbs]$ lsnrctl reload LISTENER11G
> [oracle@oracle11g dbs]$ vi $ORACLE_HOME/network/admin/tnsnames.ora
ORCL11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle11g.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCL11G)
)
)

AUX11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracle11g.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = AUX11G)
)
)
> Test whether you can now tnsping your Auxiliary Instance. [oracle@oracle11g dbs]$ tnsping AUX11G
[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
> 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_2/dbs/initAUX11G.ora' from spfile;
[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_2/dbs/initAUX11G.ora' from spfile;

File created.

SQL>
- Edit and adjust your auxiliary instance pfile.
> [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:
*.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_7mrxqr1d_.ctl','/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7mrxqrdy_.ctl'
*.db_block_size=8192
*.db_create_file_dest='/u02/oradata'
*.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")
*.db_domain=''
*.db_name='AUX11G'
*.db_recovery_file_dest='/u02/flash_recovery_area'
*.db_recovery_file_dest_size=4039114752
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=AUX11GXDB)'
*.log_archive_format='%t_%s_%r.dbf'
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
- We are now ready to clone the database using RMAN Active Database Duplication.
- 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_2/dbs/initAUX11G.ora
SQL> startup nomount pfile=/u01/app/oracle/product/11.2.0/dbhome_2/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>
- Using RMAN, connect to target and auxiliarty instances. The auxiliary instance should be in nomount mode: connected to auxiliary database: AUX11G (not mounted)
> [oracle@oracle11g dbs]$
rman target sys/oracle@ORCL11G auxiliary sys/oracle@AUX11G
[oracle@oracle11g dbs]$ rman target sys/oracle@ORCL11G auxiliary sys/oracle@AUX11G

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Feb 26 01:32:13 2012

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

connected to target database: ORCL11G (DBID=882278968)
connected to auxiliary database: AUX11G (not mounted)

RMAN>
- Perform Active Database Duplication.
> RMAN> DUPLICATE TARGET DATABASE TO AUX11G FROM ACTIVE DATABASE;
RMAN> 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_7nl6xdfz_.ctl'', ''/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nl6xdgl_.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_7nl6xdgz_.ctl';
restore clone controlfile to '/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nl6xdh8_.ctl' from
'/u02/oradata/AUX11G/controlfile/o1_mf_7nl6xdgz_.ctl';
sql clone "alter system set control_files =
''/u02/oradata/AUX11G/controlfile/o1_mf_7nl6xdgz_.ctl'', ''/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nl6xdh8_.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_7nl6xdfz_.ctl'', ''/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nl6xdgl_.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=43 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_2/dbs/snapcf_ORCL11G.f tag=TAG20120226T013443 RECID=19 STAMP=776223285
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
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_7nl6xdgz_.ctl'', ''/u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nl6xdh8_.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 datafile 1 to
"/u02/oradata/AUX11G/datafile/o1_mf_system_7mrxldmf_.dbf";
set newname for datafile 2 to
"/u02/oradata/AUX11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf";
set newname for datafile 3 to
"/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf";
set newname for datafile 4 to
"/u02/oradata/AUX11G/datafile/o1_mf_users_7mrxldsy_.dbf";
set newname for datafile 5 to
"/u02/oradata/AUX11G/datafile/o1_mf_example_7mrxtcwj_.dbf";
backup as copy reuse
datafile 1 auxiliary format
"/u02/oradata/AUX11G/datafile/o1_mf_system_7mrxldmf_.dbf" datafile
2 auxiliary format
"/u02/oradata/AUX11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf" datafile
3 auxiliary format
"/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf" datafile
4 auxiliary format
"/u02/oradata/AUX11G/datafile/o1_mf_users_7mrxldsy_.dbf" datafile
5 auxiliary format
"/u02/oradata/AUX11G/datafile/o1_mf_example_7mrxtcwj_.dbf" ;
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_7mrxldmf_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_system_7mrxldmf_.dbf tag=TAG20120226T013501
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:01:06
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u02/oradata/ORCL11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf tag=TAG20120226T013501
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:46
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u02/oradata/ORCL11G/datafile/o1_mf_example_7mrxtcwj_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_example_7mrxtcwj_.dbf tag=TAG20120226T013501
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u02/oradata/ORCL11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf tag=TAG20120226T013501
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u02/oradata/ORCL11G/datafile/o1_mf_users_7mrxldsy_.dbf
output file name=/u02/oradata/AUX11G/datafile/o1_mf_users_7mrxldsy_.dbf tag=TAG20120226T013501
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_15_7nl729r6_.arc" auxiliary format
"/u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_15_%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=15 RECID=13 STAMP=776223434
output file name=/u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_15_2en48emd_.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_7nl6xdgl_.ctl
File Name: /u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_15_2en48emd_.arc
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_15_2en48emd_.arc

List of Files Which Where Not Cataloged
=======================================
File Name: /u02/flash_recovery_area/AUX11G/controlfile/o1_mf_7nl6xdgl_.ctl
RMAN-07517: Reason: The file header is corrupted

datafile 1 switched to datafile copy
input datafile copy RECID=19 STAMP=776223439 file name=/u02/oradata/AUX11G/datafile/o1_mf_system_7mrxldmf_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=20 STAMP=776223439 file name=/u02/oradata/AUX11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=21 STAMP=776223439 file name=/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=22 STAMP=776223439 file name=/u02/oradata/AUX11G/datafile/o1_mf_users_7mrxldsy_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=23 STAMP=776223439 file name=/u02/oradata/AUX11G/datafile/o1_mf_example_7mrxtcwj_.dbf

contents of Memory Script:
{
set until scn 995113;
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 15 is already on disk as file /u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_15_2en48emd_.arc
archived log file name=/u02/flash_recovery_area/AUX11G/archivelog/2012_02_26/o1_mf_1_15_2en48emd_.arc thread=1 sequence=15
media recovery complete, elapsed time: 00:00:01
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 ( '/u02/oradata/AUX11G/onlinelog/o1_mf_1_7mrxqvg8_.log', '/u02/flash_recovery_area/AUX11G/onlinelog/o1_mf_1_7mrxqxc0_.log' ) SIZE 50 M REUSE,
GROUP 2 ( '/u02/oradata/AUX11G/onlinelog/o1_mf_2_7mrxr2lz_.log', '/u02/flash_recovery_area/AUX11G/onlinelog/o1_mf_2_7mrxr68h_.log' ) SIZE 50 M REUSE,
GROUP 3 ( '/u02/oradata/AUX11G/onlinelog/o1_mf_3_7mrxrl66_.log', '/u02/flash_recovery_area/AUX11G/onlinelog/o1_mf_3_7mrxrsp0_.log' ) SIZE 50 M REUSE
DATAFILE
'/u02/oradata/AUX11G/datafile/o1_mf_system_7mrxldmf_.dbf'
CHARACTER SET WE8MSWIN1252


contents of Memory Script:
{
set newname for tempfile 1 to
"/u02/oradata/AUX11G/datafile/o1_mf_temp_7mrxsqv8_.tmp";
switch clone tempfile all;
catalog clone datafilecopy "/u02/oradata/AUX11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf",
"/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf",
"/u02/oradata/AUX11G/datafile/o1_mf_users_7mrxldsy_.dbf",
"/u02/oradata/AUX11G/datafile/o1_mf_example_7mrxtcwj_.dbf";
switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u02/oradata/AUX11G/datafile/o1_mf_temp_7mrxsqv8_.tmp in control file

cataloged datafile copy
datafile copy file name=/u02/oradata/AUX11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf RECID=1 STAMP=776223463
cataloged datafile copy
datafile copy file name=/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf RECID=2 STAMP=776223463
cataloged datafile copy
datafile copy file name=/u02/oradata/AUX11G/datafile/o1_mf_users_7mrxldsy_.dbf RECID=3 STAMP=776223463
cataloged datafile copy
datafile copy file name=/u02/oradata/AUX11G/datafile/o1_mf_example_7mrxtcwj_.dbf RECID=4 STAMP=776223463

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=776223463 file name=/u02/oradata/AUX11G/datafile/o1_mf_sysaux_7mrxldr0_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=776223463 file name=/u02/oradata/AUX11G/datafile/o1_mf_undotbs1_7mrxldrp_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=776223463 file name=/u02/oradata/AUX11G/datafile/o1_mf_users_7mrxldsy_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=776223463 file name=/u02/oradata/AUX11G/datafile/o1_mf_example_7mrxtcwj_.dbf

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

database opened
Finished Duplicate Db at 26-FEB-12

RMAN>
- Add your auxiliary database to oratab
> [oracle@oracle11g dbs]$ vi /etc/oratab
> Add the following line:
AUX11G:/u01/app/oracle/product/11.2.0/dbhome_2:N

-- End of RMAN Active Database Duplication --
Oracle Database Administration Forums
http://www.oracle-forums.com/
Post Reply