How to kill long running queries through Pro*C?

257 views Asked by At

We are interacting with DB though Pro*C. We want to find out the queries which are taking the longest time through Pro*C.

Is there a way to find out long running queries in Pro*C?

3

There are 3 answers

1
Gary Myers On

The Pro*C programs should be readily identifiable in V$SESSION through the PROGRAM column. I'd go further and explicitly set MODULE through DBMS_APPLICATION_INFO, which will allow you to track down individual SQLs in V$SQL.

Once you instrument your code, it becomes much easier to use the diagnostic facilities such as trace or any extras you may have paid for with the Diagnostics or Tuning packs

0
Patrick Schlüter On

By testing the queries outside of C, with toad for instance? Or by counting the time they take with the normal C functions for timers?

Your question is too vague to give a specific answer.

0
EvilTeach On

oracle enterprise manager allows you to look at the running queries, and let's you look at the explain plan.