2014-10-07 43 views

回答

1

首先您需要知道您的複製已啓動並正在運行。

複製不能取代備份 (如果用戶刪除所有記錄或下降從數據庫表 - 這種變化將被複制)

一旦災難發生,你需要從源切換對於目標,您應該在轉換爲有效的主數據庫之前對數據庫進行一些驗證。如果數據庫中有任何大的錯誤,事務沒有完成等,OpenEdge很可能會投訴。但是隻有您可以檢查數據庫是否包含它應該包含的內容。所有崩潰往往會失去一些東西 - 至少還沒有交付。

還是那句話:複製不能取代備份

驗證複製

您可以驗證以不同的方式運行復制的狀態:

虛擬系統表

你可以訪問VST中的大量有用數據。詳情參見

_Database特徵

的_Database特徵VST顯示的是活性和/或 數據庫內啓用的特徵列表中的產品文檔。

_Repl-服務器:

提供了詳細的OpenEdge Replication Server的信息

_Repl-AgentControl:

提供有關OpenEdge複製代理此OpenEdge複製服務器的詳細信息正在控制

_Repl代理

提供了詳細的OpenEdge複製代理信息

示例代碼:

FIND FIRST _Database-Feature NO-LOCK WHERE _database-Feature._dbFeature_name = "Openedge Replication" no-error. 

IF AVAILABLE _Database-Feature THEN DO: 
    DISPLAY 
     _Database-Feature._DBFeature_Enabled = "1" LABEL "Repl enabled" 
     _Database-Feature._DBFeature_Active = "1" LABEL "Repl running" 
     WITH FRAME frame1 SIDE-LABELS 1 COLUMN TITLE "Replication". 


END. 


FIND FIRST _Repl-Server NO-LOCK. 
IF AVAILABLE _Repl-Server THEN DO: 
    DISPLAY 
     _Repl-Server._ReplSrv-AgentCount  LABEL "# Agents" 
     _Repl-Server._ReplSrv-BlocksSent  LABEL "Blocks sent" 
     _Repl-Server._ReplSrv-StartTime  LABEL "Started at" 
     _Repl-Server._ReplSrv-LastBlockSentAt LABEL "Last block sent" 
     WITH FRAME frame2 SIDE-LABELS 1 COLUMN TITLE "Repl Server". 
END. 

/* To access _Repl-AgentControl you need to connect a soure/master db and not a target/slave db*/ 
FIND FIRST _Repl-AgentControl NO-LOCK NO-ERROR. 
IF AVAILABLE _Repl-AgentControl THEN DO: 
    DISPLAY 
     _Repl-AgentControl._ReplAgtCtl-ConnectTime  LABEL "Connected at" 
     _Repl-AgentControl._ReplAgtCtl-RemoteDBName  LABEL "Remote DB" FORMAT "x(20)" 
     _Repl-AgentControl._ReplAgtCtl-RemoteHost  LABEL "Remote Host" FORMAT "x(20)" 
     _Repl-AgentControl._ReplAgtCtl-LastBlockSentAt LABEL "Last block sent" 
     _Repl-AgentControl._ReplAgtCtl-Method   LABEL "Method" 
     (_Repl-AgentControl._ReplAgtCtl-Status = 3049) LABEL "Normal Status" 
     (_Repl-AgentControl._ReplAgtCtl-CommStatus = 1) LABEL "Connected" 
     WITH FRAME frame3 SIDE-LABELS 1 COLUMN TITLE "Repl Agent Control" WIDTH 80. 
END. 
ELSE DO: 
    DISPLAY "Not a source". 
END. 

/* To access _Repl-Agent you need to connect a target/slave db and not a source ...*/ 
FIND FIRST _Repl-Agent NO-LOCK NO-ERROR. 
IF AVAILABLE _Repl-Agent THEN DO: 
    DISPLAY 
     (_Repl-Agent._ReplAgt-Status = 3049) LABEL "Normal Status" 
     (_ReplAgt-CommStatus = 1)   LABEL "Connected" 
     WITH FRAME frame4 SIDE-LABELS 1 COLUMN TITLE "Repl Agent". 
END. 
ELSE DO: 
    DISP "Not a slave db..". 
END. 

命令行

您可以使用命令行工具dsrutil訪問有關複製的信息。

例子:

這會給你一個交互提示用於檢查各種事情:

dsrutil db -C monitor 

您也可以使用其他選項(參見手冊)的腳本。

例子:

dsrutil db -C status detail 

簡單地寫入6021(返回OK的OS),如果一切正常。查看下面的OE複製文檔以獲取更多信息。

來源:

OE 11.4 Replication Documentation

OE 11.4 Database Management - Chapter 28

+0

感謝jnescd。它需要學習的大量信息。 – user3715001 2014-10-07 16:16:08