SQL> set linesize 200
SQL> set pagesize 200
SQL> select * from v$mystat where rownum<2;
SID STATISTIC# VALUE
---------- ---------- ----------
1175 0 0
SQL> select * from (select * from TLYH order by owner) where rownum<20;
正在执行SQL:
SQL> select sid,
serial#,
username,
sql_hash_value,
sql_address,
prev_hash_value,
sql_hash_value
from v$session
where sid = 1175 2 3 4 5 6 7 8 9 ;
SID SERIAL# USERNAME SQL_HASH_VALUE SQL_ADDRESS PREV_HASH_VALUE SQL_HASH_VALUE
---------- ---------- ------------------------------ -------------- ---------------- --------------- --------------
1175 31583 VXSPACE 2226292732 000000007E67DF50 3237839783 2226292732
执行完后;
SQL> select sid,
serial#,
username,
sql_hash_value,
sql_address,
prev_hash_value,
prev_sql_addr
from v$session
where sid = 1175 2 3 4 5 6 7 8 9 ;
SID SERIAL# USERNAME SQL_HASH_VALUE SQL_ADDRESS PREV_HASH_VALUE PREV_SQL_ADDR
---------- ---------- ------------------------------ -------------- ---------------- --------------- ----------------
1175 31583 VXSPACE 0 00 2226292732 000000007E67DF50
SQL> select sql_text
from v$sqlarea
where (address, hash_value) in
(select /*+unnest*/
DECODE(sql_hash_value, 0, prev_sql_addr, sql_address),
DECODE(sql_hash_value, 0, prev_hash_value, sql_hash_value)
from v$session
where sid = 1175) 2 3 4 5 6 7 8 ;
SQL_TEXT
--------------------------------------------------------------------------------
select * from (select * from TLYH order by owner) where rownum<20
再次运行SQL
SQL> /
SQL_TEXT
--------------------------------------------------------------------------------
select 'aaa' from dual