1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

DB2 SQLステートメントログ取得

Last updated at Posted at 2015-02-05

#目的
データベースに接続したアプリケーション情報の取得
##手順
 接続は管理者レベルで行う。
###イベントモニターの一覧を表示
SELECT EVMONNAME, TARGET_TYPE, TARGET FROM SYSCAT.EVENTMONITORS

###イベントモニターの開始
CONNECT TO [DBNAME] USER [USERID] USING
CREATE EVENT MONITOR [イベントモニター名] FOR STATEMENTS WRITE TO FILE '/XXX'
SET EVENT MONITOR [イベントモニター名] STATE 1

###SQLステートメントログ取得
DB2EVMON -DB [DBNAME] -EVM [イベントモニター名]

####イベントモニター終了・削除
CONNECT TO [DBNAME] USER [USERID] USING
FLUSH EVENT MONITOR [イベントモニター名]
SET EVENT MONITOR [イベントモニター名] STATE 0
DROP EVENT MONITOR [イベントモニター名]

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?