在发生灾难时是否有任何测试场景/流程来验证 OpenEdge 复制?
任何证明复制过程可行性的文档/测试场景都会有所帮助。
首先,您需要知道您的复制已启动并正在运行。
复制不会取代备份 (如果用户从数据库中删除所有记录或删除表 - 该更改将被复制!)
一旦发生灾难并且您需要从源切换到目标,您应该在变成有效的主数据库之前对数据库进行一些验证。如果数据库中有任何大错误、事务未完成等,OpenEdge 很可能会抱怨。但只有您可以检查您的数据库是否包含它应该包含的内容。所有的崩溃都倾向于丢失一些东西——至少是尚未提交的事务。
再说一遍:复制不会取代备份
您可以通过不同方式验证正在运行的复制的状态:
虚拟系统表
您可以在 VST 中访问大量有用的数据。有关详细信息,请参阅产品文档
_数据库-功能
_Database-Feature VST 显示数据库中活动和/或启用的功能列表。
_Repl-服务器:
提供详细的 OpenEdge 复制服务器信息
_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)。查看下面的 OE 复制文档以获取更多信息。
资料来源: