TimesTen手動主備切換(ASP模式)[TimesTen運維基礎]

tangyunoracle發表於2014-05-31
      TimesTen在ASP模式下,主備切換是日常運維中比較經常需要實施的操作,雖然我們可以配置HACMP自動切換,但是手動切換也是難免的,無論是配置自動切換還是手動切換。具體的操作步驟基本一致。
1、切換前注意事項:
a、檢查主備同步狀態,如若有日誌複製堆積,則需要等其日誌追平。
b、主備切換需要將主備節點上承載的業務全部停止,切換後,必須檢查主備角色狀況,及主備節點複製狀況,保證主備關係正常。

2、手動主備切換步驟

--註釋定時指令碼
#crontab -e
#:%s/^/#/g

--主節點檢視主備複製日誌堆積情況
ttrepadmin -log
ttisql -connstr   -v 1 -e "call ttbookmark;bye;"

--複製日誌無堆積,通知開發商停業務,必須停止所有的業務程式.

--檢查ckpt狀態,若正處於ckpt執行狀態,需等待其執行完成(Completed 狀態),才可進行主備切換.
ttisql -connstr   -v 1  -e "call ttckpthistory;bye;"

--停止當前主節點Cache Agent程式:
ttadmin -cacheStop

ttisql -connstr   -v 1  -e "call ttcachestop;bye;"

--主備事務保持一致(主節點執行)
ttisql -connstr   -v 1  -e "call ttRepSubscriberWait(,,,,-1);bye;"

--停止主節點複製程式
ttadmin -repStop

ttisql -connstr   -v 1  -e "call ttrepstop;bye;"

--將原主節點的狀態置為 idle狀態
ttisql -connstr   -v 1  -e "call ttRepDeactivate;call ttrepstateget;bye;"

--將備機的狀態置為 active 狀態
ttisql -connstr   -v 1  -e "call ttrepstateset('ACTIVE');call ttrepstateget;bye;"

--啟動新主節點複製程式
ttadmin -repStart

ttisql -connstr   -v 1  -e "call ttrepstart;bye;"

--啟動新主節點Cache Agent程式
ttadmin -cacheStart

ttisql -connstr   -v 1  -e "call ttcachestart;bye;"

--檢查主備節點角色情況
ttisql  -connstr   -v 1 -e "call ttrepstateget;bye;"

--檢查主備複製及Cache Group重新整理狀態:
ttisql  -connstr   -v 1 -e "call ttbookmark;bye;"
ttisql  -connstr   -v 1 -e "select 'PERM' type,
           to_char(round(perm_allocated_size/1024)),
           to_char(round(perm_in_use_size/1024)),
           to_char(round(perm_in_use_high_water/1024)),
           to_char(round(perm_in_use_size*100/perm_allocated_size,2))
      from sys.monitor
    union all
    select 'TEMP' type,
           to_char(round(temp_allocated_size/1024)),
           to_char(round(temp_in_use_size/1024)),
           to_char(round(temp_in_use_high_water/1024)),
           to_char(round(temp_in_use_size*100/temp_allocated_size,2))
      from sys.monitor;
    call ttBlockInfo;bye;"

--檢查操作日誌
--檢查Data Store狀態
--檢查錯誤日誌
--通知開發商啟動應用
--啟動定時任務
=========================End===========================================================

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24930246/viewspace-1173726/,如需轉載,請註明出處,否則將追究法律責任。

相關文章