select sql_text, hash_value, parsing_user_id, optimizer_mode from v$sql
SQL>
SQL> select * from dual;
D
-
X
SQL>
SQL> select sql_text, hash_value, parsing_user_id
2 from v$sql
3 where upper(sql_text) = 'SELECT * FROM DUAL';
SQL_TEXT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HASH_VALUE PARSING_USER_ID
---------- ---------------
select * from DUAL
3649189949 0
select * from dual
942515969 0
SQL_TEXT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HASH_VALUE PARSING_USER_ID
---------- ---------------
select * from dual
942515969 0
3 rows selected.
SQL>
SQL> select sql_text, hash_value, parsing_user_id, optimizer_mode
2 from v$sql
3 where upper(sql_text) = 'SELECT * FROM DUAL';
SQL_TEXT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HASH_VALUE PARSING_USER_ID OPTIMIZER_
---------- --------------- ----------
select * from DUAL
3649189949 0 RULE
select * from dual
942515969 0 RULE
SQL_TEXT
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
HASH_VALUE PARSING_USER_ID OPTIMIZER_
---------- --------------- ----------
select * from dual
942515969 0 FIRST_ROWS
3 rows selected.
SQL>
Related examples in the same category