如何确定DB2中当前事务日志的大小?

voase2hg  于 2022-11-07  发布在  DB2
关注(0)|答案(3)|浏览(332)

如何确定当前事务日志的大小?是否可以通过使用SQL查询某些系统表来实现?如果能确定事务日志的最大大小,也会很有意思。
是从文件系统中查找它的唯一选项吗?

3qpi33ja

3qpi33ja1#

GET DATABASE CONFIGURATION命令将为您提供有关数据库的所有配置信息。
它包括有关日志文件大小、主日志文件和辅助日志文件数量等的信息。输出示例如下。

Log file size (4KB)                         (LOGFILSIZ) = 1024
Number of primary log files                (LOGPRIMARY) = 13
Number of secondary log files               (LOGSECOND) = 4
Changed path to log files                  (NEWLOGPATH) =
Path to log files                                       = D:\DB2\NODE0000\SQL00003\SQLOGDIR\
Overflow log path                     (OVERFLOWLOGPATH) =
Mirror log path                         (MIRRORLOGPATH) =
First active log file                                   =
Block log on disk full                (BLK_LOG_DSK_FUL) = NO
Block non logged operations            (BLOCKNONLOGGED) = NO
Percent max primary log space by transaction  (MAX_LOG) = 0
Num. of active log files for 1 active UOW(NUM_LOG_SPAN) = 0
huus2vyu

huus2vyu2#

是的,您可以从表SYSIBMADM.DBCFG中获取此数据
例如-我必须检查数据库日志参数,所以我使用查询:

SELECT * FROM SYSIBMADM.DBCFG
WHERE
    NAME IN ('logfilsiz','logprimary','logsecond')
mgdq6dx1

mgdq6dx13#

也许这是最好的选择-如果有人还在寻找:

$ db2 "select * from sysibmadm.MON_TRANSACTION_LOG_UTILIZATION"

LOG_UTILIZATION_PERCENT TOTAL_LOG_USED_KB    TOTAL_LOG_AVAILABLE_KB TOTAL_LOG_USED_TOP_KB MEMBER
----------------------- -------------------- ---------------------- --------------------- ------
                   0.20                18102                8745297                146156      0

  1 record(s) selected.

相关问题