Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Parsing giving different SQL ID from actually executing SQL?

Dropbear67Feb 13 2013 — edited Feb 14 2013
I think this is worth a thread on its own.
Env: 11.2.0.3 on HP-UX Itanium


Scenario:

1. parse a sql statement using the following
  c := dbms_sql.open_cursor;
  dbms_sql.parse(c, v_sql, dbms_sql.NATIVE);
  dbms_sql.close_cursor(c);
2. Row appears in v$SQL with expected SQL_ID and plan_hash_value of 0.
3. In Toad, actually execute the <sql statement>
3. Second row appears in V$SQL with different SQL_ID and plan_hash_value non 0.

What's going on? Why do we get two different SQL_IDs for the same sql text executed by the same user?

Edited by: Dropbear67 on Feb 13, 2013 6:23 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2013
Added on Feb 13 2013
11 comments
2,640 views