Thanks for the question, ivan.
Asked: July 31, 2019 - 6:37 am UTC
Last updated: August 01, 2019 - 8:59 am UTC
Version: 12.1
Viewed 1000+ times
You Asked
We are using AWR repository for monitoring SQL in database, but information is not saved for all database sql, for many reasons.
How we can store information in AWR repository about current interested select ?
For example, if i see something strange sql in producation database and I want store information about this sql in AWR repository for later investigation, how I can do this ?
and Connor said...
To ensure a particular SQL is always captured, you can "color" it. Hence you would do:
exec dbms_workload_repository.add_colored_sql('nnnnn');
where nnn is the SQL_ID of the SQL.
You can see what you have colored by querying DBA_HIST_COLORED_SQL, and if needed, remove it at a later date via
exec dbms_workload_repository.remove_colored_sql('nnnnn');
Is this answer out of date? If it is, please let us know via a Comment