11g rman新特性 duplicate target database for standby from active database
Oracle版本:11.1.0.6 for Linux x86_64
首先dcba建立了2個庫,一個prdb,一個pstdb,這樣省去建立standby資料庫資料夾和密碼檔案的步驟。這當中還碰到個小問題,建立完資料庫遲遲看不到監聽註冊2個例項。於是一看listener.log,只發現了一些Subscription for node down event still pending資訊,這個是老毛病了,在listener.ora里加上SUBSCRIBE_FOR_NODE_DOWN_EVENT_
接下來開始修改主庫歸檔模式和一些引數,發現了11g中STANDBY_ARCHIVE_DEST引數已經被廢棄。其實10g的時候隨著unique_db_name和log_config等引數加入就覺得這個引數估計活不長了- -果然現在被拿掉了。
alter system set log_archive_dest_1='location=/u02/arch/prdb valid_for=(all_logfiles,all_roles) db_unique_name=prdb' scope=both;
alter system set fal_client='prdb' scope=both;
alter system set fal_server='pstdb' scope=both;
alter system set db_file_name_convert='pstdb','prdb' scope=spfile;
alter system set log_file_name_convert='pstdb','prdb' scope=spfile;
alter system set standby_file_management=auto scope=both;
alter system set db_unique_name='prdb' scope=spfile;
alter system set log_archive_dest_2='service=pstdb reopen=120 lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=prdb' scope=both;
修改完重啟主庫
備庫麼直接startup nomount就可以了
這裡有一個問題:duplicate target database for standby from active database是需要使用net service name連線的,如果使用SID連線會報下面的錯誤:
ORACLE_SID=pstdb
rman target auxiliary /
RMAN-06217: not connected to auxiliary database with a net service name
但問題是,instance在mount/nomount階段,net service name是blocked的,直接使用net service name連線又會發生別的錯誤:
rman target auxiliary
RMAN-04006: error from auxiliary database
ORA-12528: TNS:listener: all appropriate instances are blocking new connections
那麼如何解決呢,其實只要修改監聽的配置檔案listener.ora,加一個靜態註冊就可以了:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = pstdb)
(ORACLE_HOME = /u01/app/product/11g/db_1)
(SID_NAME = pstdb)
)
)
另外tnsname.ora裡修改成:
pstdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = pstdb)(UR=A)
)
)
也可以連線mount狀態的instance,包括ASM的例項哦
做好這些工作以後,接下來的工作很方便了
在standby端:
rman target auxiliary
連線後執行下面的指令碼,RMAN會自動完成建立控制檔案,引數檔案,複製資料檔案的工作。
run {
allocate channel prmy1 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'prdb','pstdb'
set db_unique_name='pstdb'
set db_file_name_convert='/prdb/','/pstdb/'
set log_file_name_convert='/prdb/','/pstdb/'
set control_files='/u02/oradata/pstdb/control01.ctl'
set fal_client='pstdb'
set fal_server='prdb'
set standby_file_management='AUTO'
set log_archive_dest_1='location=/u02/arch/pstdb valid_for=(all_logfiles,all_roles) db_unique_name=prdb'
set log_archive_dest_2='service=prdb ASYNC valid_for=(ONLINE_LOGFILE,PRIMARY_ROLE) db_unique_name=prdb'
;
}
執行完畢後,新增Real-time query需要的standby redo log:
alter database add standby logfile '/u02/oradata/pstdb/stdbyredo01.log' size 50m;
alter database add standby logfile '/u02/oradata/pstdb/stdbyredo02.log' size 50m;
alter database add standby logfile '/u02/oradata/pstdb/stdbyredo03.log' size 50m;
alter database recover managed standby database disconnect from session;
alter database recover managed standby database cancel;
ALTER DATABASE OPEN;
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;
dataguard就開始Real-time Apply了,驗證資料就自己來吧
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-672521/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用oracle 11g rman新特性 duplicate target database for standby from active database 建立物理dataguard並開啟RealOracleDatabase
- 11g 新特性—— Active Database Duplication for A standby databaseDatabase
- Oracle 11g Data Guard 使用 duplicate from active database 建立 standby databaseOracleDatabase
- Oracle 11g Data Guard 使用duplicate from active database 建立 standby databaseOracleDatabase
- 11g RMAN新特性 active database duplication createing standbyDatabase
- Creating a Physical Standby using RMAN DUPLICATE FROM ACTIVE DATABASEDatabase
- 11g RMAN新特性active database duplicate 資料庫異構Database資料庫
- Oracle 11g Rman Active database duplicateOracleDatabase
- Oracle11g RMAN Duplicate from Active DatabaseOracleDatabase
- RMAN duplicate from active database 複製資料庫Database資料庫
- Oracle 11g Data Guard 使用duplicate from active databaseOracleDatabase
- 搭建11g data guard(duplicate from active database方式)Database
- 11g 新特性—— Active Database DuplicationDatabase
- Step by Step Guide on Creating Physical Standby Using RMAN DUPLICATE...FROM ACTIVE DATABASE WithoutGUIIDEDatabase
- 11g RMAN新特性 active database duplication 複製資料庫Database資料庫
- Duplicate Database from ASM to Non- ASM Database Using RMANDatabaseASM
- 使用RMAN DUPLICATE...FROM ACTIVE DATABASE命令來建立DataGuard物理備庫Database
- oracle 11g duplicate from active database 複製資料庫(四)OracleDatabase資料庫
- oracle 11g duplicate from active database 複製資料庫(三)OracleDatabase資料庫
- oracle 11g duplicate from active database 複製資料庫(二)OracleDatabase資料庫
- oracle 11g duplicate from active database 複製資料庫(一)OracleDatabase資料庫
- RMAN duplicate databaseDatabase
- Oracle 11gR2 使用 RMAN duplicate from active database 複製資料庫OracleDatabase資料庫
- 使用 RMAN DUPLICATE...FROM ACTIVE DATABASE 建立物理備用資料庫的分步指南Database資料庫
- oracle 10g rman duplicate target database for standby會自動新增臨時檔案Oracle 10gDatabase
- RMAN Duplicate Database From RAC ASM To RAC ASM [ID 461479.1]DatabaseASM
- Rman backup standby databaseDatabase
- 11g Active Standby Database Automatic Block Corruption RepairDatabaseBloCAI
- RMAN 'Duplicate Database' Feature in 11G [ID 452868.1]Database
- 通過rman duplicate database!Database
- 11gR2中使用duplicate建立physical standby (從rman備份或從active database)Database
- 【DataGuard】Oracle 11g DataGuard 新特性之 Snapshot Standby DatabaseOracleDatabase
- RMAN duplicate database到新主機Database
- Oracle 11G Duplicate DatabaseOracleDatabase
- RMAN Duplicate FROM ACTIVE DATABASE 建物理DG還原檔案期間報錯ORA-17629處理Database
- rman 建 Standby Database 筆記Database筆記
- rman duplicate target database RMAN-03002 RMAN-03015 RMAN-06136Database
- Duplicate Active Database Failing with: RMAN-03009, ORA-17628DatabaseAI