How to kill long running queries through Pro*C?
We are interacting with DB though Pro*C. We want to find out the queries which are taking the longest 开发者_如何学Gotime through Pro*C.
Is there a way to find out long running queries in Pro*C?
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.
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
oracle enterprise manager allows you to look at the running queries, and let's you look at the explain plan.
精彩评论