□DB2監査機能使用方法


DB2の監査

実行手順
1. db2audit configure scope all
2. db2audit start
3. 対象となるDB2の操作

 例)
   db2
   db2=> connect to sample user db2admin using db2admin
   db2=> select * from ima -- yanagi test
   db2=> terminate

4. db2audit extract file xxxxx.log ← このファイルに監査ログをファイルへ抽出します。
5. db2audit stop
6. db2audit configure reset

xxxxx.logに、3.で操作したログが出力されます。実行したSQL文も得られる為、有用です。

(ログファイルから抜粋)

timestamp=2005-11-29-18.39.48.171000;category=CONTEXT;audit event=DESCRIBE;
 event correlator=5;
 database=SAMPLE;userid=db2admin;authid=DB2ADMIN;
 origin node=0;coordinator node=0;
 application id=*LOCAL.DB2.051129093932;application name=db2bp.exe;
 package schema=NULLID;package name=SQLC2E06;
 package section=201;text=select * from ima -- yanagi test;  ← コメントが入ってます。



SQL文だけなら、scopeはcontextで良いらしい。
最終更新:2006年09月19日 19:31