Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    Karachi,pakistan
    Posts
    17

    Question Unanswered: DB2 query logs??

    Hi all,

    here is one very urgent query...the problem is that I would like to know is there any way to find out that so far what queries has been run on my DB2 database tables.I am not asking for the specific queries run from DB2 Command Center but from whatever-end...might be an application that run the queries or what so ever.

    Can anyone pls help how to get these logs??...

    I am on Win2003 and IBM DB2 UDB v8.1

    lots and lots of thanks in Advance
    -Aay Dee
    A.Dee

  2. #2
    Join Date
    Aug 2002
    Location
    Chennai, India
    Posts
    184
    You can do a snapshot on your database using the following command to collect the SQL fired against the database irrespective of the application...

    db2 get snapshot for dynamic sql on dbname

    Redirect the above to a file.

    HTH.

  3. #3
    Join Date
    Apr 2006
    Posts
    8
    also, you can using this SQL to query the sqls which is running on your db.
    SQL:
    SELECT * FROM TABLE( SNAPSHOT_DYN_SQL( 'SAMPLE', -1 )) as SNAPSHOT_DYN_SQL

    you code your db name instead of 'SAMPLE',BTW you must have dbm authority.
    Last edited by Daniel-D; 05-15-06 at 05:59.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •