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 > Kill Long-running Query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-12-04, 01:30
sivram_k sivram_k is offline
Registered User
 
Join Date: Aug 2003
Posts: 8
Kill Long-running Query

Hello,

How can we kill a long running query in DB2? In the front end, we have one cancel button.When the user clicks cancel button, the query should stop processing.

Regards,
Siva
Reply With Quote
  #2 (permalink)  
Old 05-12-04, 02:43
cgprakash cgprakash is offline
Registered User
 
Join Date: Feb 2002
Posts: 96
What is your OS???

If it is UNIX, you can kill it from backend by using "db2 force application (agentid)". But for this you should be a member of 'sysadm or sysctrl'.
Reply With Quote
  #3 (permalink)  
Old 05-13-04, 02:00
sivram_k sivram_k is offline
Registered User
 
Join Date: Aug 2003
Posts: 8
Kill long-Running Query

Hello,

Our Operating system is AIX (Production). rightnow the development is going on in Windows 2000 Server.We are using DB2 UDB v8.1

we have one web application and this application has one archiving process.When the user clicks start button in the page, the archiving process will start running. We will be having one cancel button also in the page, and if the user clicks the cancel button or close the web page, we have to kill the archiving process(It has both insert and select). In this case, how can we kill the whole process from the front end?

Please help........

regards,
Siva
Reply With Quote
  #4 (permalink)  
Old 05-13-04, 02:33
cgprakash cgprakash is offline
Registered User
 
Join Date: Feb 2002
Posts: 96
Since you are developing your own front-end, may be you can write a code "force application (agentid)" to force/kill that application when you click cancel button. Your program/code should capture the particular 'agentid'.

If you are not developing front-end web application, (eg, vedor supplied application), even if you press cancel button, sometime(not always) the application will not be forced/killed. So you have to call your DBA to terminate that connection.
Reply With Quote
  #5 (permalink)  
Old 05-13-04, 09:53
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
I guess you could close the connection that is running the query, and the query will eventually be cancelled. It won't work though if you use some kind of connection pooling in your application server.
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