Question & Answer
Question
トランザクション・ログ・フル (SQL0964C) の兆候を監視するため、長時間コミットしていないアプリケーションや、ログ・スペースを大量に消費しているアプリケーションを判別する方法はありますか。
Cause
mon_get_unit_of_work 表関数と mon_get_connection 表関数を使うと、長時間コミットしていないアプリケーションや、ログ・スペースを大量に消費しているアプリケーションを一覧できます。
Answer
- 以下のような SQL を記録したファイル (mon_transactions.sql) を作成します。
SELECT con.application_handle, con.application_id, con.application_name, con.client_pid, uow.uow_start_time, uow.uow_log_space_used FROM table(mon_get_connection(cast(null as bigint), -1)) as con, table(mon_get_unit_of_work(null, -1)) as uow WHERE con.application_handle = uow.application_handle and uow.uow_log_space_used != 0 ORDER BY uow.uow_start_time ;
- データベース管理者 (DBADM) で監視対象のデータベースに接続します。
db2 connect to <データベース名>
- 監視用 SQL を実行します。
db2 -tvf mon_transactions.sql
実行例APPLICATION_HANDLE APPLICATION_ID APPLICATION_NAME CLIENT_PID UOW_START_TIME UOW_LOG_SPACE_USED ------------------ ------------------------------ ---------------- ---------- -------------------------- ------------------ 20136 192.168.1.1.49538.181224175700 db2bp 10648 2018-12-25-09.59.43.450650 15593 20201 *LOCAL.db2inst1.181214145300 db2bp 8948 2018-12-25-10.27.51.465542 15436 2 record(s) selected.
UOW_START_TIME が最も古いものはログ・フルの原因になる可能性があります。また、UOW_LOG_SPACE_USED が増え続けているものもログ・フルの原因になる可能性があります。
運用上の考慮点
- データベース構成パラメーター mon_req_metrics が BASE (デフォルト) 以上の場合に MON_GET_UNIT_OF_WORK と MON_GET_CONNECTION 表関数は必要な情報を収集できます。
データベース構成パラメーターは以下のコマンドで確認できます。db2 get db cfg for <データベース名>
関連情報
[{"Type":"MASTER","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PmcAAE","label":"Recovery-\u003ELogging"}],"ARM Case Number":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"10.1.0;10.5.0;11.1.0;11.5.0;9.7.0"}]
Was this topic helpful?
Document Information
Modified date:
15 August 2023
UID
ibm10869636