creating oracle10g data guard using rman(physical db)
1,對主庫進行一個全庫備份(利用rman)
backup as copy incremental level 0 database format '/oracle/rmanbak/%Ubak' tag 'test rman standby db';
2,根據主庫生成備庫pfile(且根據備庫實際情況修正相關引數)
adding db_unique_name
create pfile='/oracle/rmanbak/initrman.ora' from spfile;
3,啟動主庫到mount,利用rman生成備庫控制檔案,且之後進行歸檔操作
startup force mount
backup current controlfile format '/oracle/rmanbak/%D_u_rmancontrolbak';
sql 'alter database open';
sql 'alter system archive log curent';
sql 'alter system switch logfile';
backup archivelog all format '/oracle/rmanbak/%d_%u_archivebak';
4,把以上諸步生成的rman備份,利用scp傳到備庫對應目錄(為了簡易,我主備庫目錄結構完全一致,請根據pfile,依次構建dump及db_recovery_dest,儲存rman的目錄.
5,在備庫上,利用rman進行生成備庫
注:先用以上生成的pfile,把備庫啟到nomount
startup nomount pfile
然後
rman target sys/system@centos auxiliary sys/system
最後貼上我真正開工的指令碼,供後記
-bash-3.1$ rman target sys/system@centos auxiliary sys/system
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Jan 30 23:51:31 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: CENTOS (DBID=3005679176)
connected to auxiliary database: CENTOS (not mounted)
RMAN> duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 30-JAN-10
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK
contents of Memory Script.:
{
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 30-JAN-10
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /oracle/rmanbak/CENTOS_standbyctl.bak
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/oracle/rmanbak/CENTOS_standbyctl.bak tag=TAG20100201T124043
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/oracle/oradata/centos/centos/control01.ctl
output filename=/oracle/oradata/centos/centos/control02.ctl
output filename=/oracle/oradata/centos/centos/control03.ctl
Finished restore at 30-JAN-10
sql statement: alter database mount standby database
released channel: ORA_AUX_DISK_1
contents of Memory Script.:
{
set newname for datafile 1 to
"/oracle/oradata/centos/centos/system01.dbf";
set newname for datafile 2 to
"/oracle/oradata/centos/centos/undotbs01.dbf";
set newname for datafile 3 to
"/oracle/oradata/centos/centos/sysaux01.dbf";
set newname for datafile 4 to
"/oracle/oradata/centos/centos/users01.dbf";
set newname for datafile 9 to
"/oracle/oradata/centos/centos/another1.dbf";
restore
check readonly
clone database
;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 30-JAN-10
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK
channel ORA_AUX_DISK_1: restoring datafile 00001
input datafile copy recid=1 stamp=709821048 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-SYSTEM_FNO-1_0hl4u0j2bak
destination for restore of datafile 00001: /oracle/oradata/centos/centos/system01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00001
output filename=/oracle/oradata/centos/centos/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002
input datafile copy recid=3 stamp=709821083 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-UNDOTBS1_FNO-2_0jl4u0kkbak
destination for restore of datafile 00002: /oracle/oradata/centos/centos/undotbs01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00002
output filename=/oracle/oradata/centos/centos/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003
input datafile copy recid=2 stamp=709821064 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-SYSAUX_FNO-3_0il4u0jrbak
destination for restore of datafile 00003: /oracle/oradata/centos/centos/sysaux01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00003
output filename=/oracle/oradata/centos/centos/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004
input datafile copy recid=4 stamp=709821089 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-USERS_FNO-4_0kl4u0l0bak
destination for restore of datafile 00004: /oracle/oradata/centos/centos/users01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00004
output filename=/oracle/oradata/centos/centos/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009
input datafile copy recid=5 stamp=709821090 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-ANOTHER_FNO-9_0ll4u0l2bak
destination for restore of datafile 00009: /oracle/oradata/centos/centos/another1.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00009
output filename=/oracle/oradata/centos/centos/another1.dbf
Finished restore at 30-JAN-10
contents of Memory Script.:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy recid=6 stamp=709689206 filename=/oracle/oradata/centos/centos/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=7 stamp=709689206 filename=/oracle/oradata/centos/centos/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=8 stamp=709689206 filename=/oracle/oradata/centos/centos/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=9 stamp=709689206 filename=/oracle/oradata/centos/centos/users01.dbf
datafile 9 switched to datafile copy
input datafile copy recid=10 stamp=709689206 filename=/oracle/oradata/centos/centos/another1.dbf
Finished Duplicate Db at 30-JAN-10
RMAN>
6,在新生成的備庫上,變更standby_file_management=auto,從主庫進行相關dml,檢視備庫是否正常,其它操作同以前,不再多述
backup as copy incremental level 0 database format '/oracle/rmanbak/%Ubak' tag 'test rman standby db';
2,根據主庫生成備庫pfile(且根據備庫實際情況修正相關引數)
adding db_unique_name
create pfile='/oracle/rmanbak/initrman.ora' from spfile;
3,啟動主庫到mount,利用rman生成備庫控制檔案,且之後進行歸檔操作
startup force mount
backup current controlfile format '/oracle/rmanbak/%D_u_rmancontrolbak';
sql 'alter database open';
sql 'alter system archive log curent';
sql 'alter system switch logfile';
backup archivelog all format '/oracle/rmanbak/%d_%u_archivebak';
4,把以上諸步生成的rman備份,利用scp傳到備庫對應目錄(為了簡易,我主備庫目錄結構完全一致,請根據pfile,依次構建dump及db_recovery_dest,儲存rman的目錄.
5,在備庫上,利用rman進行生成備庫
注:先用以上生成的pfile,把備庫啟到nomount
startup nomount pfile
然後
rman target sys/system@centos auxiliary sys/system
最後貼上我真正開工的指令碼,供後記
-bash-3.1$ rman target sys/system@centos auxiliary sys/system
Recovery Manager: Release 10.2.0.4.0 - Production on Sat Jan 30 23:51:31 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: CENTOS (DBID=3005679176)
connected to auxiliary database: CENTOS (not mounted)
RMAN> duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 30-JAN-10
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK
contents of Memory Script.:
{
restore clone standby controlfile;
sql clone 'alter database mount standby database';
}
executing Memory Script
Starting restore at 30-JAN-10
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /oracle/rmanbak/CENTOS_standbyctl.bak
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/oracle/rmanbak/CENTOS_standbyctl.bak tag=TAG20100201T124043
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
output filename=/oracle/oradata/centos/centos/control01.ctl
output filename=/oracle/oradata/centos/centos/control02.ctl
output filename=/oracle/oradata/centos/centos/control03.ctl
Finished restore at 30-JAN-10
sql statement: alter database mount standby database
released channel: ORA_AUX_DISK_1
contents of Memory Script.:
{
set newname for datafile 1 to
"/oracle/oradata/centos/centos/system01.dbf";
set newname for datafile 2 to
"/oracle/oradata/centos/centos/undotbs01.dbf";
set newname for datafile 3 to
"/oracle/oradata/centos/centos/sysaux01.dbf";
set newname for datafile 4 to
"/oracle/oradata/centos/centos/users01.dbf";
set newname for datafile 9 to
"/oracle/oradata/centos/centos/another1.dbf";
restore
check readonly
clone database
;
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 30-JAN-10
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK
channel ORA_AUX_DISK_1: restoring datafile 00001
input datafile copy recid=1 stamp=709821048 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-SYSTEM_FNO-1_0hl4u0j2bak
destination for restore of datafile 00001: /oracle/oradata/centos/centos/system01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00001
output filename=/oracle/oradata/centos/centos/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002
input datafile copy recid=3 stamp=709821083 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-UNDOTBS1_FNO-2_0jl4u0kkbak
destination for restore of datafile 00002: /oracle/oradata/centos/centos/undotbs01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00002
output filename=/oracle/oradata/centos/centos/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003
input datafile copy recid=2 stamp=709821064 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-SYSAUX_FNO-3_0il4u0jrbak
destination for restore of datafile 00003: /oracle/oradata/centos/centos/sysaux01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00003
output filename=/oracle/oradata/centos/centos/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004
input datafile copy recid=4 stamp=709821089 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-USERS_FNO-4_0kl4u0l0bak
destination for restore of datafile 00004: /oracle/oradata/centos/centos/users01.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00004
output filename=/oracle/oradata/centos/centos/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009
input datafile copy recid=5 stamp=709821090 filename=/oracle/rmanbak/data_D-CENTOS_I-3005679176_TS-ANOTHER_FNO-9_0ll4u0l2bak
destination for restore of datafile 00009: /oracle/oradata/centos/centos/another1.dbf
channel ORA_AUX_DISK_1: copied datafile copy of datafile 00009
output filename=/oracle/oradata/centos/centos/another1.dbf
Finished restore at 30-JAN-10
contents of Memory Script.:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy recid=6 stamp=709689206 filename=/oracle/oradata/centos/centos/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=7 stamp=709689206 filename=/oracle/oradata/centos/centos/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=8 stamp=709689206 filename=/oracle/oradata/centos/centos/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=9 stamp=709689206 filename=/oracle/oradata/centos/centos/users01.dbf
datafile 9 switched to datafile copy
input datafile copy recid=10 stamp=709689206 filename=/oracle/oradata/centos/centos/another1.dbf
Finished Duplicate Db at 30-JAN-10
RMAN>
6,在新生成的備庫上,變更standby_file_management=auto,從主庫進行相關dml,檢視備庫是否正常,其它操作同以前,不再多述
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-626535/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- using rman to creat oracle10g data guard standby db_with recoveryOracle
- Creating a Data Guard Database with RMAN using Duplicate Command [ID 183570.1]Database
- Creating a Physical Standby using RMAN DUPLICATE FROM ACTIVE DATABASEDatabase
- oracle10g data guard(dg)__flashback_physical databaseOracleDatabase
- physical data guard 的原理
- Creating Physical Standby using RMAN Duplicate Without Shutting Primary_789370.1
- 【DG】Data Guard搭建(physical standby)
- physical data guard 的原理 (zt)
- Creating a 10gr2 Data Guard Physical Standby database with Real-Time applyDatabaseAPP
- Creating Physical Standby using RMAN Duplicate Without Shutting down The Primary [ID 789370.1]
- Step By Step Guide On Creating Physical Standby Using RMAN Duplicate In ASM Filesystem For ASM PrimaGUIIDEASM
- oracle10g data guard role transition_physical_logical_switchover_failoverOracleAI
- Step by Step Guide on Creating Physical Standby Using RMAN DUPLICATE...FROM ACTIVE DATABASE WithoutGUIIDEDatabase
- [Data Guard]Oracle10g Data Guard學習筆記(一)Oracle筆記
- [Data Guard]Oracle10g Data Guard學習筆記(二)Oracle筆記
- [Data Guard]Oracle10g Data Guard學習筆記(三)Oracle筆記
- Script to Collect Data Guard Physical and Active Standby Diagnostic InformationORM
- oracle10g data guard redo transport serviceOracle
- Using RMAN Incremental Backups to Roll Forward a Physical Standby DatabaseREMForwardDatabase
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項OracleLinux
- Oracle 11g Data Guard (physical standby - active dataguard) [final]Oracle
- (轉) DB 遷移到Data Guard 實施方案
- Creating a Physical Standby DatabaseDatabase
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項-3OracleLinux
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項 -2OracleLinux
- Oracle Data Guard Linux 平臺 Physical Standby 搭建例項 -1OracleLinux
- Step By Step Guide To Create Physical Standby Database Using RMAN [ID 469493.1]GUIIDEDatabase
- Oracle10g Data Guard (Standby) 理論與實踐Oracle
- Data Guard只支援同平臺同版本的DB
- Creating a Standby Database using RMAN (Recovery Manager) [ID 118409.1]Database
- Data Guard 之RMAN備份線上搭建物理standby
- Creating a physical standby from ASM primaryASM
- Oracle10g Data Guard (Standby) 理論與實踐 2Oracle
- DATA GUARD部署模式——DATA GUARD概念和管理模式
- oracle10g data guard(dg)__歸檔日誌備份刪除相關策略_rman_configureOracle
- 利用RMAN 建立Oracle9i RAC Data GuardOracle
- 利用RMAN建立10GRAC資料庫的DATA GUARD資料庫
- oracle10g data guard建立物理standby資料庫的例子Oracle資料庫