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