Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2010
    Posts
    19

    Unanswered: how to find sql queries executed by a user

    hello

    i need to find way to list the sql code of queries executed by an unser.
    Is there some audit tool like DBMS_FGA

    i use db2 express -c
    when i try to use snapshot:
    get snapshot for dynamic sql on RDB
    i get the error:
    An exception occurred
    Message: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "snapshot" was found following "get ". Expected tokens may include: "JOIN <joined_table>". SQLSTATE=42601
    SQL: get snapshot for dynamic sql on RDB
    Method: TDB2DirQuery.Execute
    (0,436 sec)

  2. #2
    Join Date
    Aug 2010
    Posts
    19
    i saw IBM How can db2audit capture SQL statements in DB2 V9.5? - United States
    and whne i try to execute
    db2 select * from EXECUTE
    the systems tells me that table EXECUTE do not exists ...
    please help

  3. #3
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    whne i try to execute
    db2 select * from EXECUTE
    Did you complete steps 1 through 4 before trying step 5?

  4. #4
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Quote Originally Posted by josemourinho View Post
    when i try to use snapshot:
    get snapshot for dynamic sql on RDB
    i get the error:
    GET SNAPSHOT is not an SQL statement and therefore does not make sense in the SQL context. Try using one of the monitor views available in your DB2 version, e.g.
    Code:
    select activity_type, activity_state, stmt_text 
    from sysibmadm.mon_current_sql

  5. #5
    Join Date
    Aug 2010
    Posts
    19
    yes i execute the first 4 steps
    i need to se the executed staments by executing some kind of sql statement ... reading from file is not good way for my application

  6. #6
    Join Date
    Aug 2010
    Posts
    19
    if i use monitoring tool writed in IBM How can db2audit capture SQL statements in DB2 V9.5? - United States
    will i have to stop auditing when i want to see the executed statements

Posting Permissions

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