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.
I want to know the resource consuming queries in the database. Is there an easy way to get this.
Thanks.
select * from v$sqlstats
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.