Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Is there any way I can monitor all the queries running on an Oracle instance and report which queries are using PARTITION LIST (ALL)?

What I'm essentially asking for is a way to automatically EXPLAIN PLAN on every query, then search the plan results for queries that are not eliminating partitions properly.

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

I would write a job procedure which would get all running queries:

SELECT sql_id, sql_child_number FROM V$SESSION WHERE SQL_ID IS NOT NULL AND TYPE='USER';

and then loop through that cursor and get explain plan

select * from table(dbms_xplan.display_cursor(v_sql_id, v_sql_child_number));
share|improve this answer
    
Thanks. I could also use V$SQL for the outer loop if I wanted to monitor SQL that may not be currently running as well. –  wrschneider99 Jul 15 '13 at 20:10
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.