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 > Statement text in LONG_RUNNING_SQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-30-11, 06:41
db2cap db2cap is offline
Registered User
 
Join Date: May 2010
Posts: 87
Statement text in LONG_RUNNING_SQL

Hi,
DB2 Version: 9.1
OS: AIX 5.3

I am trying to find the longest running query in my database using SYSIBMADM.LONG_RUNNING_SQL view but it is not displaying the statement text.

$ db2 "SELECT SUBSTR(STMT_TEXT, 1, 10) AS STMT_TEXT, AGENT_ID, APPL_STATUS FROM SYSIBMADM.LONG_RUNNING_SQL"

STMT_TEXT AGENT_ID APPL_STATUS
---------- -------------------- ----------------------
- 1388 UOWEXEC
- 926 UOWWAIT


I have also tried by enabling the monitor switch for statement but it did not help
Reply With Quote
  #2 (permalink)  
Old 06-30-11, 09:01
nvk@vhv nvk@vhv is offline
Registered User
 
Join Date: Jan 2010
Posts: 294
If the switch was not activated before, you won't get the data afterwards...
In Addition the monitor switch is not enough. You need to activate DFT_MON_STMT.

Quote:
All snapshot monitoring administrative views and associated table functions use a separate instance connection, which is different from the connection the current session uses. Therefore, an implicit instance attachment can be established, and only default database manager monitor switches are effective. Ineffective monitor switches include any that are turned on or off dynamically from the current session or application.
http://publib.boulder.ibm.com/infoce.../r0006117.html

Last edited by nvk@vhv; 06-30-11 at 09:16.
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