Wednesday 14 February 2018

How to color (add) SQLs to the AWR reports?

I just found a very good blog explaining this:

http://oracleprof.blogspot.ca/2011/06/how-to-color-mark-sql-for-awr-snapshots.html


Sometimes, we have a problematic query which runs not that often or not that long to be included in the AWR reports, but we are still interested in see the statistics of this query. So the answer is to "color" this specific query, by providing the SQL_ID.

How to color the query:

exec dbms_workload_repository.add_colored_sql('6zfggtprazcvb');

How to check that it was added to the list:

select * from DBA_HIST_COLORED_SQL;

How to remove the query (uncolor):


exec dbms_workload_repository.remove_colored_sql('6zfggtprazcvb');