Documente Academic
Documente Profesional
Documente Cultură
RMAN 'Duplicate Database' Feature in 11G [ID 452868.1] Modified 14-MAY-2010 In this Document Purpose Scope and Application RMAN 'Duplicate Database' Feature in 11G Basic Steps to ACTIVE database duplication : References Type BULLETIN Status PUBLISHED
Applies to:
Oracle Server - Enterprise Edition - Version: 11.1.0.6 and later [Release: 11.1 and later ] Information in this document applies to any platform.
Purpose
The scope of this bulletin is to discuss the different type of RMAN 'duplicate database' feature in Oracle 11G. This note is only applicable for oracle 11g only.
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=BULLETIN&id=452...
initTEST.ora -----------DB_NAME=TEST diagnostic_dest='E:\oracle' DB_FILE_name_CONVERT=('I:\app\apadhi\oradata\amar','E:\oracle\oradata\test') LOG_FILE_NAME_CONVERT=( 'I:\app\apadhi\oradata\amar','E:\oracle\oradata\test') SGA_TARGET=262144000 CONTROL_FILES='E:\oracle\oradata\TEST\control01.dbf' COMPATIBLE= 11.1.0.0.0
2. Create the database service ( only for windows ) and password file . Look at the example :
% % % % set ORACLE_SID=TEST set ORACLE_HOME=E:\oracle\product\11.1.0\db_1 oradim -NEW -SID TEST orapwd FILE=E:\oracle\product\11.1.0\db_1\database\PWDTEST.ora PASSWORD=sys
For unix/Linux no need to create the service. Rest other steps are same.
4. Create the necessary oracle NET connectivity in the listener.ora and the tnsnames.ora file. Look at the example :
Listener.ora -----------SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = TEST) (ORACLE_HOME = E:\oracle\product\11.1.0\db_1) (SID_NAME = TEST) ) )
LISTENER = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = apadhi-idc)(PORT = 1521)) ) tnsname.ora ----------## For the Auxiliary database TEST ## TEST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = apadhi-idc)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TEST) ) ) ## For the target database AMAR ## AMAR = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 152.69.210.76)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = AMAR) ) ) ## Similary add entry for the catalog database ( Optional)
Confirm the connection to both the target and the auxiliary instance using sqlplus. In this example we are creating the duplicate database from the Auxiliary server.
2. Start RMAN and Connect to the Database Instances Start RMAN and connect to the source database as TARGET, the duplicate database instance as AUXILIARY, and, if applicable, the recovery catalog database.You can start the RMAN client on any host so long as it can connect to all of the database instances. If the auxiliary instance requires a text-based initialization parameter file, then this file must exist on the same host that runs the RMAN client application. .In this bulletin we are doing duplicate database from the auxiliary server.Look at the example :
% rman
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=BULLETIN&id=452...
Recovery Manager: Release 11.1.0.6.0 - Production on Wed Aug 1 21:06:49 2007 Copyright (c) 1982, 2007, Oracle. All rights reserved. RMAN> connect TARGET sys / sys @ AMAR; ## Target database ## connected to target database: AMAR (DBID=1450838187) RMAN> connect AUXILIARY sys / sys @ TEST ; ## Auxiliary database ## connected to auxiliary database: TEST (not mounted) RMAN> connect CATALOG rman / rman @ CAT ; ## Catalog database .Optional ## connected to recovery catalog database
3. Run the DUPLICATE database command : The simplest case is to use active database duplication to duplicate the database to a different host and use the different directory structure.Look at the example : This example assumes This example assumes the following: * Using a recovery catalog. * The target database is on host1 and contains 4 datafiles. * Duplicate the target to database TEST on the different host having different file structure. * Tablespace USERS in target is read-only tablespace. * Running duplicate database from the Auxiliary site.
RMAN>DUPLICATE TARGET DATABASE TO 'TEST' FROM ACTIVE DATABASE DB_FILE_NAME_CONVERT 'I:\app\apadhi\oradata\amar','E:\oracle\oradata\test';
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=BULLETIN&id=452...
{ backup as copy reuse archivelog like "I:\APP\APADHI\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001" auxiliary format "E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001" archivelog like "I:\APP\APADHI\FLASH_RECOVERY_AREA\AMAR\ARCHIVELOG\2007_08_02\O1_MF_1_42_3C2YJNP7_.ARC" auxiliary format "E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001" ; catalog clone archivelog "E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001"; catalog clone archivelog "E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001"; switch clone datafile all; } executing Memory Script Starting backup at 02-AUG-07 using channel ORA_DISK_1 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=42 RECID=35 STAMP=629553646 output file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 RECID=0 STAMP=0 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01 channel ORA_DISK_1: starting archived log copy input archived log thread=1 sequence=42 RECID=36 STAMP=629553646 output file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 RECID=0 STAMP=0 channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01 Finished backup at 02-AUG-07 cataloged archived log archived log file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 RECID=1 STAMP=629553800 cataloged archived log archived log file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 RECID=2 STAMP=629553800 datafile 2 switched input datafile copy datafile 3 switched input datafile copy to datafile copy RECID=1 STAMP=629553800 file name=E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF to datafile copy RECID=2 STAMP=629553801 file name=E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF
contents of Memory Script: { set until scn 833606; recover clone database delete archivelog ; } executing Memory Script executing command: SET until clause Starting recover at 02-AUG-07 using channel ORA_AUX_DISK_1 datafile 4 not processed because file is read-only starting media recovery archived log for thread 1 with sequence 42 is already on disk as file E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 archived log file name=E:\ORACLE\PRODUCT\11.1.0\DB_1\RDBMS\ARC00042_0629061547.001 thread=1 sequence=42 media recovery complete, elapsed time: 00:00:01 Finished recover at 02-AUG-07 contents of Memory Script: { 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 263639040 bytes
Fixed Size 1332544 bytes Variable Size 83888832 bytes Database Buffers 171966464 bytes Redo Buffers 6451200 bytes sql statement: CREATE CONTROLFILE REUSE SET DATABASE "TEST" RESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 ( 'E:\ORACLE\ORADATA\TEST\REDO01.LOG' ) SIZE 50 M REUSE, GROUP 2 ( 'E:\ORACLE\ORADATA\TEST\REDO02.LOG' ) SIZE 50 M REUSE, GROUP 3 ( 'E:\ORACLE\ORADATA\TEST\REDO03.LOG' ) SIZE 50 M REUSE DATAFILE 'E:\ORACLE\ORADATA\TEST\SYSTEM01.DBF' CHARACTER SET AL32UTF8
contents of Memory Script: { set newname for tempfile 1 to "E:\ORACLE\ORADATA\TEST\TEMP01.DBF"; switch clone tempfile all; catalog clone datafilecopy "E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF"; catalog clone datafilecopy "E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF"; switch clone datafile all; } executing Memory Script executing command: SET NEWNAME renamed tempfile 1 to E:\ORACLE\ORADATA\TEST\TEMP01.DBF in control file cataloged datafile copy datafile copy file name=E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF RECID=1 STAMP=629553825 cataloged datafile copy
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=BULLETIN&id=452...
datafile copy file name=E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF RECID=2 STAMP=629553826 datafile 2 switched input datafile copy datafile 3 switched input datafile copy to datafile copy RECID=1 STAMP=629553825 file name=E:\ORACLE\ORADATA\TEST\SYSAUX01.DBF to datafile copy RECID=2 STAMP=629553826 file name=E:\ORACLE\ORADATA\TEST\UNDOTBS01.DBF
contents of Memory Script: { Alter clone database open resetlogs; } executing Memory Script database opened contents of Memory Script: { catalog clone datafilecopy "E:\ORACLE\ORADATA\TEST\USERS01.DBF"; switch clone datafile 4 to datafilecopy "E:\ORACLE\ORADATA\TEST\USERS01.DBF"; #online the readonly tablespace sql clone "alter tablespace USERS online"; } executing Memory Script cataloged datafile copy datafile copy file name=E:\ORACLE\ORADATA\TEST\USERS01.DBF RECID=3 STAMP=629553870 datafile 4 switched to datafile copy input datafile copy RECID=3 STAMP=629553870 file name=E:\ORACLE\ORADATA\TEST\USERS01.DBF sql statement: alter tablespace USERS online Finished Duplicate Db at 02-AUG-07
References
Chapter 23 Backup and Recovery User's Guide ( 11g Release 1 (11.1))
Related
Products Oracle Database Products > Oracle Database > Oracle Database > Oracle Server - Enterprise Edition Keywords CATALOG DATABASE; DUPLICATE DATABASE; CLONING DATABASE; AUXILIARY
Back to top
https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&doctype=BULLETIN&id=452...