-------------------------------------------------------------------------------------------------------------------------------- ----------------------- -------------------- ---------------------- --------------------- --------------
DSS 8.97 4631824 46955050 16655013 0
非常清楚一目了然吧,对于监控事物日志使用情况,及早发现事务日志空间满问题很有帮助。
b.还有一种方法,就是查看快照视图:
select int(total_log_used/1024/1024) as "Log Used (Mb)",int(total_log_available/1024/1024) as "Log Space Free(Mb)",
int((float(total_log_used)/float(total_log_used+total_log_available))*100) as "Pct Used",int(tot_log_used_top/1024/1024) as "Max Log Used (Mb)",
int(sec_log_used_top/1024/1024) as "Max Sec. Used (Mb)",int(sec_logs_allocated) as "Secondaries" from sysibmadm.snapdb;
Log Used (Mb) Log Space Free(Mb) Pct Used Max Log Used (Mb) Max Sec. Used (Mb) Secondaries
------------- ------------------ ----------- ----------------- ------------------ -----------
4544 45833 9 16264 12532 5
1 record(s) selected.
其实还有一种通过表函数的方法,不过需要带入参数:
select DB_NAME,TOTAL_LOG_AVAILABLE,TOTAL_LOG_USED,SEC_LOG_USED_TOP,SEC_LOGS_ALLOCATED from table(SNAP_GET_DB('SAMPLE',0))
DB_NAME TOTAL_LOG_AVAILABLE TOTAL_LOG_USED SEC_LOG_USED_TOP SEC_LOGS_ALLOCATED
-------------------------------------------------------------------------------------------------------------------------------- -------------------- -------------------- -------------------- --------------------
SAMPLE 48045192251 4779767749 13141773417 5
1 record(s) selected
看吧,DB2查看日志空间的方法真的很多,不能不说提供了强大的用户接口,就看大家怎么用了。
推荐阅读: