Professional Documents
Culture Documents
Duplicate database from non ASM to ASM (vise versa) to a different host
Doc ID: Note:382669.1
Last Revision Date: 17-FEB-2008
Type: HOWTO
Status: PUBLISHED
In this Document
Goal
Solution
Duplicate database from non ASM to ASM (vise versa) to a different host
Assumed database names:
Steps
1. Backup of the primary database.
2 Determine how much disk space will be required.
3. Ensuring you have enough space within your ASM instance.
4. Making the backup available for the duplicate process.
5. Creating the init.ora & administration directories for the duplicate database.
6. Ensuring SQL*NET connections to primary database and RMAN catalog are working.
7. Prepare RMAN duplicate script.
8. Execute the RMAN script.
Applies to:
Oracle Server - Enterprise Edition - Version: 10.1 to 10.2.0.3
Information in this document applies to any platform.
Goal
This note demonstrates how to duplicate database from host A to host B and at the same time
converting a database from a file system ASM or ASM to filesystem depending on the
requirements. The example in this document a catalog database is used however this task can
also be performed without a catalog.
Solution
Duplicate database from non ASM to ASM (vise versa) to a different host
Assumed database names:
Primary Database SID:
Duplicate Database SID:
RMAN Catalog SID:
PROD
AUX
RMAN
====================================================================
Steps
Figure 1a - This command will perform a full database backup including archivelogs and the
current controlfile. If backup pieces are on ASM, then a new backup to filesystem is required.
[oracle@linux] export ORACLE_SID=PROD
[oracle@linux] rman target=/ catalog=rman/rman@RMAN
RMAN> run {
allocate channel d1 type disk;
backup format '/backups/ORA102/df_t%t_s%s_p%p' tablespace SYSTEM,
SYSAUX, UNDO, USERS;
sql 'alter system archive log current';
backup format '/backups/ORA102/al_t%t_s%s_p%p' archivelog all;
release channel d1;
}
Figure 1b- This command will perform a tablespace backup (SYSTEM, SYSAUX, UNDO &
USERS) including archive logs
and the current controlfile.
DataFile Size Mb Redo Log Size Mb Control File Size Mb Total Size Mb
---------------- ---------------- -------------------- ------------900
150
20.34375
1070.34375
Figure 3a - Sample output showing the space available with the ASM diskgroup.
Compare the result received from this query with the output from 2a or 2b and ensure you have
enough disk space for your duplicate database.
If you do not have enough disk space within your ASM instance ensure you must add it prior to
continuing.
Keep in mind you may also be storing archive logs and/or the recovery area within the ASM
instance so ample room must be available.
If you are duplicating from ASM to a filesystem ensure you have enough disk space on the
source file system.
Figure 4a - A list backup showing the backup pieces that need to be copied across Host B
5. Creating the init.ora & administration directories for the duplicate database.
Host B(Target)
Create the pfile [initAUX.ora] parameter file in the $ORACLE_HOME/dbs directory for the
auxiliary database. An example is shown below (figure 5a) with bare minimum settings. Note
you may require to set parameters which are the same as your production database (refer to you
primary init.ora)
#
#
#
#
#
#
+----------------------------------------+
| FILE : initAUX.ora
|
| DATABASE NAME : AUX
|
+----------------------------------------+
Set the below to location of the clone Duplicate database / name of
clone database.
audit_file_dest =/apps/oracle/admin/AUX/adump
background_dump_dest =/apps/oracle/admin/AUX/bdump
core_dump_dest =/apps/oracle/admin/AUX/cdump
user_dump_dest =/apps/oracle/admin/AUX/udump
db_name ="AUX"
instance_name =AUX
# Set the below to the location of the duplicate clone control file.
control_files =+DGROUP1/control01.ctl
# Set the below for the from and to location for all data files / redo
# logs to be cloned. As you can the the ASM disk group is specified.
db_file_name_convert =("/u01/AUX/ORA102", "+DGROUP1")
log_file_name_convert =("/u01/AUX/ORA102", "+DGROUP1")
#Set the below to the same as the production target
### NOTE IF YOU ARE DUPLICATING FROM ASM TO FILE SYSTEM YOUR CONVERT
PARAMETER WOULD BE
### REVERSED.
## db_file_name_convert =("+DGROUP1","/u01/AUX/ORA102")
## log_file_name_convert =("+DGROUP1","/u01/AUX/ORA102")
undo_management =AUTO
undo_retention =10800
undo_tablespace =UNDOTBS1
db_block_size = 8192
compatible = 10.2.0.1.0
Keywords
ASM; DUPLICATE; HOST; NEW; RESTORE; RMAN;