Link to home
Start Free TrialLog in
Avatar of sakthikumar
sakthikumar

asked on

Resource consuming queries.

Dear Experts,

I want to know the resource consuming queries in the database. Is there an easy way to get this.

Thanks.
Avatar of Sean Stuber
Sean Stuber

select * from v$sqlstats
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sakthikumar

ASKER

This is good. But how to get Sql in the second query.
use the sql_id  from v$session in the query above


then  

select * from v$sql where sql_id = 'xxxxxxxxx';      where xxxxxxx is whatever sql_id you got from the first query


that will only give you the query that is running right now.

if you have a session running lots and lots of small queries this might not be helpful, because no one query is consuming much, but in total, they are expensive.