Top 10 queries from v$active_session_history

Cyrille Modiano

OCP Oracle DBA in Montreal at DBSoft

Latest posts by Cyrille Modiano (see all)

Description

This query returns the top 10 queries by resource consumption (CPU+IO+WAIT) in the last hour from v$active_session_history.
Be careful, this view is part of the diagnostic pack, you should not query this view if you don’t have license for it.

top 10 queries from v$active_session_history

This query return top queries by resources consumed, you can easily return the top I/O, WAITS or CPU queries by changing the order by clause.

You can see my other post about how to build a graph from the v$active_session_history view here

WordPress database error: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE AND comment_parent IN (13923) ORDER BY comment_date_gmt ASC, comment_ID ' at line 1]
SELECT rkq_comments.comment_ID, rkq_comments.comment_parent WHERE AND comment_parent IN (13923) ORDER BY comment_date_gmt ASC, comment_ID ASC

One thought on “Top 10 queries from v$active_session_history

  1. I noticed this morning the Oracle tables from a specific schema got dropped in production yesterday evening. We don’t have audit in place. Can I capture information from history and other database views from which machine the delete came and at what time?

Leave a Reply