Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Manjunath.

Asked: November 22, 2016 - 8:51 am UTC

Last updated: November 22, 2016 - 11:32 am UTC

Version: 11.2.0.1

Viewed 1000+ times

You Asked

Hello Tom,

Please let me know if we can store the history of a sql that we wish to, for example I would like to store the statistics like hash plan, execution, time elapsed etc for a given sqlid, this may not be a top 10 or top 100 sql.

and Chris said...

You mean store details in the AWR for statements that aren't a "highest consumer"?

If so you can call DBMS_WORKLOAD_REPOSITORY.ADD_COLORED_SQL to force Oracle to always record stats about a particular piece of SQL. Do this and it'll always be captured by AWR.

http://docs.oracle.com/database/121/ARPLS/d_workload_repos.htm#ARPLS69108

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Store performance history of SQL

Manjunath Parameswara, November 22, 2016 - 3:04 pm UTC

Thanks for the quick reply and thats what i was looking for..!!!

More to Explore

Performance

Get all the information about database performance in the Database Performance guide.