Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Kill SQL Query

Status
Not open for further replies.

gk4u

Programmer
Jul 2, 2002
21
IN
Hi SQL Gurus,
I have a sql query which is taking too long to execute becasue of millions of data in database. I would like to identify and kill this sql query if it is taking more then 2 mins to execute.
Yes, we can identify the session and kill the session. But I dont want to kill session. I want to kill the particular SQL query in Oracle 9i.

Thanks in Advance.

Thanks
GK
 
GK,

As you have discovered, Oracle has an atrocius (i.e., virtually non-existent) interrupt mechanism for in-flight queries. (I'm looking forward to discovering what tricks Ken has up his sleeve on this topic.[smile])

What I do when testing a query that may run "forever", is I first do a "count(*)" to get a feel for how many records are involved, and if I predict that the time involved may run too long, I throw into the WHERE statement (at the correct logical location) a "WHERE...rownum <= <some small value>" to cut down logically the "millions of data in database" that may exist.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Hi Ken,
The database is on UNIX SUN 5.8 box and I am firing query through .NET program.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top