xplain plan of sql_id from cursor - Oracle Database Script. --- First get the child number of the sql_id .One sql_id can have multiple child number( one for each plan_hash_value) SQL> select sql_id,child_number,plan_hash_value from gv$sql where sql_id='9n2a2c8pvu6bm'; SQL_ID CHILD_NUMBER PLAN_HASH_VALUE ------------- ------------ --------------- 9n2a2c8pvu6bm 1 13761463 --- Now get the explain plan for cursor: SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('&sqlid',&child_number));
--- First get the child number of the sql_id .One sql_id can have multiple child number( one for each plan_hash_value) SQL> select sql_id,child_number,plan_hash_value from gv$sql where sql_id='9n2a2c8pvu6bm'; SQL_ID CHILD_NUMBER PLAN_HASH_VALUE ------------- ------------ --------------- 9n2a2c8pvu6bm 1 13761463 --- Now get the explain plan for cursor: SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('&sqlid',&child_number));