如何在備用數據庫上啟動 DB2 10.5 HADR
我正在嘗試設置 HADR 以在我的 DB2 10.5 DB2 伺服器上執行。我相信我已正確執行了這些步驟,但出現以下錯誤:
[db2insh1@rslvm20 OneView]$ db2 restore database onevwhad DB20000I The RESTORE DATABASE command completed successfully. [db2insh1@rslvm20 OneView]$ db2 -vtf update_config_HADR_Secondary.sql UPDATE DB CFG FOR ONEVWHAD USING HADR_LOCAL_HOST rslvm20.dub.usoh.ibm.com HADR_LOCAL_SVC DB2_db2insh1_hadr HADR_SYNCMODE NEARSYNC HADR_REMOTE_HOST rslvm19.dub.usoh.ibm.com HADR_REMOTE_SVC DB2_db2insh1_hadr HADR_REMOTE_INST db2insh1 DB20000I The UPDATE DATABASE CONFIGURATION command completed successfully. [db2insh1@rslvm20 OneView]$ db2 start hadr on db onevwhad as standby SQL1767N Start HADR cannot complete. Reason code = "1".
知識中心說這個錯誤:
Start HADR cannot complete. The explanation corresponding to the reason code is: 1: The database was not in roll forward-pending or roll forward-in-progress state when the START HADR AS STANDBY command was issued. The user response corresponding to the reason code is: 1: Initialize the standby database from a backup image or a split mirror of the primary database, then reissue the START HADR AS STANDBY command.
但是我在更新 HADR 配置之前恢復了數據庫,然後嘗試啟動 HADR。沒有中間步驟,所以我很困惑。我相當確定我必須在恢復數據庫和啟動 HADR 之間更新配置。知道我做錯了什麼嗎?
==========================================================================================
‘LOGARCHMETH1’ 選項設置為’OFF’。
以下是 db2diag.log 中的適用內容。除了 -1767 錯誤程式碼之外,它沒有告訴我(以我有限的知識)。
2014-12-04-11.46.29.565620-300 I228560E692 LEVEL: Event PID : 32654 TID : 140560786515712 PROC : db2sysc 0 INSTANCE: db2insh1 NODE : 000 DB : ONEVWHAD APPHDL : 0-200 APPID: *LOCAL.db2insh1.141204164629 AUTHID : DB2INSH1 HOSTNAME: rslvm20.dub.usoh.ibm.com EDUID : 22 EDUNAME: db2agent (ONEVWHAD) 0 FUNCTION: DB2 UDB, base sys utilities, sqleCalculateDbHeaps, probe:70 MESSAGE : RLMS - DB Memory Set for Resident Member DATA #1 : String, 10 bytes totalBytes DATA #2 : unsigned integer, 8 bytes 236519424 DATA #3 : String, 11 bytes dbHeapBytes DATA #4 : unsigned integer, 8 bytes 164298752 2014-12-04-11.46.29.594451-300 I229253E673 LEVEL: Error PID : 32654 TID : 140560786515712 PROC : db2sysc 0 INSTANCE: db2insh1 NODE : 000 DB : ONEVWHAD APPHDL : 0-200 APPID: *LOCAL.db2insh1.141204164629 AUTHID : DB2INSH1 HOSTNAME: rslvm20.dub.usoh.ibm.com EDUID : 22 EDUNAME: db2agent (ONEVWHAD) 0 FUNCTION: DB2 UDB, data protection services, sqlpPrepareAndValidateEnvForHadr, probe:540 MESSAGE : ZRC=0x8010006D=-2146434963=SQLP_RC_CA_BUILT "SQLCA has been built and saved in component specific control block." DATA #1 : Sqlcode, PD_TYPE_SQLCODE, 4 bytes -1767 2014-12-04-11.46.29.594815-300 I229927E600 LEVEL: Error PID : 32654 TID : 140560786515712 PROC : db2sysc 0 INSTANCE: db2insh1 NODE : 000 DB : ONEVWHAD APPHDL : 0-200 APPID: *LOCAL.db2insh1.141204164629 AUTHID : DB2INSH1 HOSTNAME: rslvm20.dub.usoh.ibm.com EDUID : 22 EDUNAME: db2agent (ONEVWHAD) 0 FUNCTION: DB2 UDB, data protection services, sqlpinit, probe:1050 MESSAGE : ZRC=0x8010006D=-2146434963=SQLP_RC_CA_BUILT "SQLCA has been built and saved in component specific control block." 2014-12-04-11.46.29.595098-300 I230528E936 LEVEL: Severe PID : 32654 TID : 140560786515712 PROC : db2sysc 0 INSTANCE: db2insh1 NODE : 000 DB : ONEVWHAD APPHDL : 0-200 APPID: *LOCAL.db2insh1.141204164629 AUTHID : DB2INSH1 HOSTNAME: rslvm20.dub.usoh.ibm.com EDUID : 22 EDUNAME: db2agent (ONEVWHAD) 0 FUNCTION: DB2 UDB, base sys utilities, sqeLocalDatabase::FirstConnect, probe:9831 DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes sqlcaid : SQLCA sqlcabc: 136 sqlcode: -1767 sqlerrml: 1 sqlerrmc: 1 sqlerrp : sqlpPrep sqlerrd : (1) 0x00000000 (2) 0x00000000 (3) 0x00000000 (4) 0x00000000 (5) 0x00000000 (6) 0x00000000 sqlwarn : (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) sqlstate: DATA #2 : Boolean, 1 bytes false
以下是我的備用伺服器上 HADR 的配置值,如果它們重要的話:
UPDATE DB CFG FOR ONEVWHAD USING HADR_LOCAL_HOST rslvm20.dub.usoh.ibm.com HADR_LOCAL_SVC DB2_db2insh1_hadr HADR_SYNCMODE NEARSYNC HADR_REMOTE_HOST rslvm19.dub.usoh.ibm.com HADR_REMOTE_SVC DB2_db2insh1_hadr HADR_REMOTE_INST db2insh1
在初級:
UPDATE DB CFG FOR ONEVWHAD USING HADR_LOCAL_HOST rslvm19.dub.usoh.ibm.com HADR_LOCAL_SVC DB2_db2insh1_hadr HADR_SYNCMODE NEARSYNC HADR_REMOTE_HOST rslvm20.dub.usoh.ibm.com HADR_REMOTE_SVC DB2_db2insh1_hadr HADR_REMOTE_INST db2insh1
順便說一句,我認為恢復工作正常,因為我可以在備用數據庫的表中看到來自主數據庫的數據。
我在 db2diag.log 中得到了完全相同的錯誤消息和日誌,我解決此問題的方法是在還原後不進行前滾,必須將還原的數據庫保持在前滾掛起狀態,然後您可以啟動 HADR它。
在主 system1 中傳遞此命令是 logarchive 問題。1. db2 update db cfg 使用 LOGARCHMETH1 LOGRETAIN
它將啟用數據庫以進行日誌歸檔並將日誌保存在同一活動日誌目錄中。這也將使數據庫處於備份掛起狀態。
- 進行離線備份。db2“備份數據庫”
- 在主數據庫上設置 HADR cfg 參數。
db2 update db cfg 使用 HADR_LOCAL_HOST db2 update db cfg 使用 HADR_LOCAL_SVC db2 update db cfg 使用 HADR_REMOTE_HOST db2 update db cfg 使用 HADR_REMOTE_SVC db2 update db cfg 使用 HADR_REMOTE_INST db2 update db cfg 使用 LOGINDEXBUILD ON 4. 進行離線備份以用於設置 HADR。
db2“備份數據庫”