DB2 9.7.7及之后的版本,如何通过JDBC获取日志快照状态?
In DB2 9.7.7 and later, how do you obtain log snapshot status via JDBC?
当前手动过程:
从命令行工作,我使用这个:
第 1 步:在 DB2CMD 或 DB2CC 中获取 DB2 状态快照
get snapshot for database on mydb
第 2 步:解释 DB2 状态快照 - 使用数字
Appl id holding the oldest transaction = 22875 **
Log to be redone for recovery (Bytes) = 21777671554
Log accounted for by dirty pages (Bytes) = 544881
Node number = 0
File number of first active log = 20611 **
File number of last active log = 21276 **
File number of current active log = 21276 **
File number of log being archived = Not applicable
我的目标是用一个在我的 JEE 容器中运行的简单流程来代替这个手动流程。我想获取标有 ** 的图形以在程序中解释而不是手动解释。
您可以查询快照视图,大致如下:
SELECT
appl_id_oldest_xact,
first_active_log,
last_active_log,
current_active_log
FROM
sysibmadm.snapdb d ,
sysibmadm.snapdetaillog l
WHERE
l.dbpartitionnum = d.dbpartitionnum
当前手动过程: 从命令行工作,我使用这个:
第 1 步:在 DB2CMD 或 DB2CC 中获取 DB2 状态快照
get snapshot for database on mydb
第 2 步:解释 DB2 状态快照 - 使用数字
Appl id holding the oldest transaction = 22875 **
Log to be redone for recovery (Bytes) = 21777671554
Log accounted for by dirty pages (Bytes) = 544881
Node number = 0
File number of first active log = 20611 **
File number of last active log = 21276 **
File number of current active log = 21276 **
File number of log being archived = Not applicable
我的目标是用一个在我的 JEE 容器中运行的简单流程来代替这个手动流程。我想获取标有 ** 的图形以在程序中解释而不是手动解释。
您可以查询快照视图,大致如下:
SELECT
appl_id_oldest_xact,
first_active_log,
last_active_log,
current_active_log
FROM
sysibmadm.snapdb d ,
sysibmadm.snapdetaillog l
WHERE
l.dbpartitionnum = d.dbpartitionnum