Could someone tell me how I can I spend the sql_id/plan_hash_value and corresponding implementation plans?

Hi experts,

I want to know, how to get the past (like a week older) sql_id/plan_jash_values and corresponding implementation plans.

I am aware that v$ session contains these last sql_id/hash_value, distinguished by a sql statement that is executed and we can get the plan_hash_value from v$ sql using the following query.

Select sql_id, hash_value, plan_hash_value from v$ sql where sql_id = & sql_id;

Once you leave this session, session $ v clears the session information, subsequently sql_id will be also deleted.

I want to know,

1 how long v$ sql holds the plan_hash_value, is there a retention period?

2. when we issue ' select * table ((dbms_xplan.display_cursor ('& sql_id')) ", when the execution plan is read since?").

3. I need to compare the implementation plans for a perticular query last week one, what are my options?

Please help me with my questions, experts.

Kind regards

Ravi K

Yes, the AWR repository is accessible by SQL queries on the DBA_HIST views.  (these are the same!)

Thus, the AWR retention period applies to data in views DBA_HIST.

A SQL query that is not reported by a snapshot of the CWA would not be in the views DBA_HIST.

Hemant K Collette

Tags: Database

Similar Questions

Maybe you are looking for