DUPLICATE (Backup based) DATABASE from non ASM to ASM to different host_382669.1
DUPLICATE (Backup based) DATABASE from non ASM to ASM (vice versa) to different host (Doc ID 382669.1)
In this Document
Applies to:Oracle Database - Enterprise Edition - Version 10.1.0.2 to 11.2.0.4 [Release 10.1 to 11.2]Information in this document applies to any platform. ***Checked for relevance on 15-Apr-2014*** 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 to ASM or ASM to filesystem depending on the requirements. The example in this document uses catalog database, however this task can also be performed without a catalog.
This note assumes that the original database is in ARCHIVELOG mode. If in NOARCHIVELOG mode you must take an OFFLINE backup in MOUNT mode.
SolutionAssumed database names:
Primary Database SID: PROD Steps
1. Backup the primary database. 1. Backup of the primary database.
[oracle@linux] export ORACLE_SID=PROD
%rman target=/ catalog=rman/rman@RMAN RMAN> run { allocate channel d1 type disk; backup format '/backups/ORA102/df_t%t_s%s_p%p' database; sql 'alter system archive log current'; backup format '/backups/ORA102/al_t%t_s%s_p%p' archivelog all; release channel d1; }
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 2 Determine how much disk space will be required.
Host A(Target)
SQL> select DF.TOTAL/1048576 "DataFile Size Mb",
LOG.TOTAL/1048576 "Redo Log Size Mb", CONTROL.TOTAL/1048576 "Control File Size Mb", (DF.TOTAL + LOG.TOTAL + CONTROL.TOTAL)/1048576 "Total Size Mb" from dual, (select sum(a.bytes) TOTAL from dba_data_files a) DF, (select sum(b.bytes) TOTAL from v$log b) LOG, (select sum((cffsz+1)*cfbsz) TOTAL from x$kcccf c) CONTROL;
Figure 2a - Calculate total space for all datafiles within database.
SQL> select DF.TOTAL/1048576 "DataFile Size Mb",
LOG.TOTAL/1048576 "Redo Log Size Mb", CONTROL.TOTAL/1048576 "Control File Size Mb", (DF.TOTAL + LOG.TOTAL + CONTROL.TOTAL)/1048576 "Total Size Mb" from dual, (select sum(a.bytes) TOTAL from dba_data_files a where tablespace_name in ('SYSTEM','SYSAUX','UNDO','USERS')) DF, (select sum(b.bytes) TOTAL from v$log b) LOG, (select sum((cffsz+1)*cfbsz) TOTAL from x$kcccf c) CONTROL;
Figure 2b - Calculate space for list of datafiles within primary database. DataFile Size Mb Redo Log Size Mb Control File Size Mb Total Size Mb ---------------- ---------------- -------------------- ------------- 900 150 20.34375 1070.34375
Figure 2c - Sample output of space calculation. 3. Ensuring you have enough space within your ASM instance.
Host B (AUX)
% export ORACLE_SID=+ASM
SQL> select NAME, STATE, TOTAL_MB, FREE_MB from v$asm_diskgroup; NAME STATE TOTAL_MB FREE_MB ------------------------------ ----------- ---------- ---------- DGROUP2 MOUNTED 976 3 DGROUP3 MOUNTED 4882 4830
Figure 3a - Sample output showing the space available with the ASM diskgroup. 4. Making the backup available for the duplicate process.
If your backup resides on disk you will need to copy this back up from Host A to Host B. Ensure you place it in the same directory as where it was created. In the example below (figure 4a) the backup piece resides in ???/backups/ORA102??? these files need to be copied into the same directory on host B.
RMAN> list backup;
BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ ------------------- 22 Full 529M DISK 00:00:51 2006/05/16 11:12:54 BP Key: 22 Status: AVAILABLE Compressed: NO Tag: TAG20060516T111203 Piece Name: /backups/PROD/df_t590584323_s23_p1 List of Datafiles in backup set 22 File LV Type Ckp SCN Ckp Time Name ---- -- ---- ---------- ------------------- ---- 1 Full 1393845 2006/05/16 11:12:03 /oradata/PROD/system01.dbf 2 Full 1393845 2006/05/16 11:12:03 /oradata/PROD/undotbs01.dbf 3 Full 1393845 2006/05/16 11:12:03 /oradata/PROD/sysaux01.dbf 4 Full 1393845 2006/05/16 11:12:03 /oradata/PROD/users01.dbf BS Key Size Device Type Elapsed Time Completion Time ------- ---------- ----------- ------------ ------------------- 24 48M DISK 00:00:06 2006/05/16 11:13:07 BP Key: 24 Status: AVAILABLE Compressed: NO Tag: TAG20060516T111301 Piece Name: /backups/PROD/al_t590584381_s25_p1 List of Archived Logs in backup set 24 Thrd Seq Low SCN Low Time Next SCN Next Time ---- ------- ---------- ------------------- ---------- --------- 1 78 1344750 2006/05/15 04:55:34 1353208 2006/05/15 10:00:19 1 79 1353208 2006/05/15 10:00:19 1353213 2006/05/15 10:00:20 1 80 1353213 2006/05/15 10:00:20 1371564 2006/05/15 22:00:11 1 81 1371564 2006/05/15 22:00:11 1373291 2006/05/15 22:00:59 1 82 1373291 2006/05/15 22:00:59 1381066 2006/05/16 03:00:05 1 83 1381066 2006/05/16 03:00:05 1390685 2006/05/16 09:03:00 1 84 1390685 2006/05/16 09:03:00 1393870 2006/05/16 11:13:00 1 85 1393870 2006/05/16 11:13:00 1393929 2006/05/16 11:13:00 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)
# +----------------------------------------+
# | 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. ## control_files =/u01/AUX/ORA102/control01.ctl ## 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
Figure 5a - Sample initAUX.ora with minimal settings
[oracle@linux]export ORACLE_SID=AUX
[oracle@linux] sqlplus '/as sysdba' SQLPLUS> startup nomount;
Figure 5b - startup nomount the AUX instance. 6. Ensuring SQL*NET connections to primary database and RMAN catalog are working.
Host B(Target)
[oracle@linux]% sqlplus ???sys/oracle@PROD as sysdba???
[oracle@linux]% sqlplus rman/rman@RMAN Figure 6a - SQL*NET connections 7. Prepare RMAN duplicate script.
In a working directory on Host B create an RMAN script file cr_duplicate.rcv. The example below (figure 7a) shows the command for a partial duplicate.
RUN {
allocate auxiliary channel C1 device type disk; duplicate target database to AUX; } Figure 7a - Sample standby creation command. 8. Execute the RMAN script.
Start RMAN, connect to the production target, the catalog instance and also the auxiliary clone. Run the RMAN duplicate script as shown below. Before doing this ensure that the Oracle SID environment variable is set to the duplicate clone database.
export ORACLE_SID=AUX
%rman target sys/sys@PROD catalog rman/rman@rman auxiliary / RMAN> @cr_duplicate.rcv
Figure 8a - Execute the RMAN duplicate script. ReferencesNOTE:275480.1 - How to Duplicate a Database in NOARCHIVELOG mode |
|
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1263459/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Duplicate database from non ASM to ASM to a different host [ID 382669.1]DatabaseASM
- Duplicate database from non ASM to ASM (vise versa) to a different host-382669.1DatabaseASM
- Duplicate Database from ASM to Non- ASM Database Using RMANDatabaseASM
- RMAN Duplicate Database From RAC ASM To RAC ASM [ID 461479.1]DatabaseASM
- 單例項的duplicate(non ASM)單例ASM
- How to move ASM database files from one diskgroup to anotherASMDatabase
- Performing duplicate database with ASM/OMF/RMAN (Doc ID 340848.1)ORMDatabaseASM
- How to restore ASM based OCRRESTASM
- Using FTP Transferring Non-ASM Datafiles to ASM diskgroupFTPASM
- Oracle 11GR2 Duplicate from BackupOracle
- Unable To Open Database After ASM Upgrade From Release 11.1 To Release 11.2DatabaseASM
- Move datafile:From File System to ASMASM
- Move datafile:From ASM to File SystemASM
- Oracle11g RMAN Duplicate from Active DatabaseOracleDatabase
- solaris10_oracle10g_asm_non_asm遷移資料庫測試OracleASM資料庫
- Oracle 12C Transport a Database to a Different Platform Using Backup SetsOracleDatabasePlatform
- 11g rman新特性 duplicate target database for standby from active databaseDatabase
- How to move ASM spfile to a different disk group [ID 1082943.1]ASM
- How to restore and recover a database from an RMAN backup_881395.1RESTDatabase
- RMAN duplicate from active database 複製資料庫Database資料庫
- Creating a physical standby from ASM primaryASM
- Create Physical stdby Using RMAN Duplicate In ASM File... For ASM Prim-837102.1ASM
- Step By Step Guide On Creating Physical Standby Using RMAN Duplicate In ASM Filesystem For ASM PrimaGUIIDEASM
- Oracle 11g Data Guard 使用 duplicate from active database 建立 standby databaseOracleDatabase
- Oracle 11g Data Guard 使用duplicate from active database 建立 standby databaseOracleDatabase
- [WK-T]ORACLE RAC +ASM Backup and Recovery(四)OracleASM
- [WK-T]ORACLE RAC +ASM Backup and Recovery(三)OracleASM
- 安裝ORACLE 11.2.0.3 ASM for AIX HA (Non-RAC)OracleASMAI
- Oracle 11g Data Guard 使用duplicate from active databaseOracleDatabase
- 搭建11g data guard(duplicate from active database方式)Database
- How to restore ASM based OCR after complete loss of the CRS diskgroupRESTASM
- asm files,asm directories,asm templatesASM
- Creating a Physical Standby using RMAN DUPLICATE FROM ACTIVE DATABASEDatabase
- 11g asm md_backup md_restoreASMREST
- duplicate databaseDatabase
- How to copy a datafile from ASM to a file system not using RMANASM
- How To Upgrade ASM from 10.2 to 11.1 (RAC)ASM
- ASM例項使用CREATE PFILE FROM MEMORY的bugASM