Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL Query to find top sql's & how many times it executes in session.

VIRUOct 24 2011 — edited Oct 24 2011
Hi,
I am using ORACLE 11gR2 and LINUX 5.

I want a query which will give me output as :- The sql/plsql query which is consuming most resources or else which is taking the most time to execute. Also if i can specify time in query then can it give me that in this particular time how many times a same query got executed ???

For an Example : -
My query should be like .....
SELECT <MACHINE_NAME>,<OS_USERNAME>,<SQL_FULLTEXT>,<columns specifying the recources used by SQL>,
<how many times the sql got executed in the perticular time>,from <data dictionary tablename>               -- I assume we can get columns as specified.
Where <TIME> bewteen <from> and <to>;
So the basic need is that i should be able to view the SQL which consumes heavy resources and the no. of. times that SQL gets executed in that particular time frame or session.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2011
Added on Oct 24 2011
2 comments
320 views