If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > how to find sql queries executed by a user

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-10, 05:17
josemourinho josemourinho is offline
Registered User
 
Join Date: Aug 2010
Posts: 19
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)
Reply With Quote
  #2 (permalink)  
Old 10-20-10, 06:55
josemourinho josemourinho is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 10-20-10, 07:45
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
Quote:
whne i try to execute
db2 select * from EXECUTE
Did you complete steps 1 through 4 before trying step 5?
Reply With Quote
  #4 (permalink)  
Old 10-20-10, 07:53
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
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
Reply With Quote
  #5 (permalink)  
Old 10-20-10, 08:57
josemourinho josemourinho is offline
Registered User
 
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
Reply With Quote
  #6 (permalink)  
Old 10-24-10, 13:09
josemourinho josemourinho is offline
Registered User
 
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On