How to check the SQL Statement Plan?

When you do an explain plan, then the appropriate DBMS_XPLAN api is
DBMS_XPLAN.DISPLAY.
When you do an actual execution - i.e. not with explain plan - then
DBMS_XPLAN.DISPLAY_CURSOR is the appropriate api.

Troubleshooting for DBMS_XPLAN.DISPLAY_CURSOR
Error:-
NOTE: cannot fetch plan for SQL_ID: 3pb80q4uks11n, CHILD_NUMBER: 0
Please verify value of SQL_ID and CHILD_NUMBER;
It could also be that the plan is no longer in cursor cache (check v$sql_p
lan)

grant select ON v_$session TO &&1;
grant select on v_$sql_plan to &&1;
grant select on v_$sql to &&1;

set serverouput off;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s