哈哈哈,分数拿来
desc v$open_cursor
名称 空? 类型
----------------------------------------- -------- ------------
SADDR RAW(4)
SID NUMBER
USER_NAME VARCHAR2(30)
ADDRESS RAW(4)
HASH_VALUE NUMBER
SQL_TEXT VARCHAR2(60) //这就是了哦
select * from v$open_cursor;
然后如果要查正在运行的sql的话
select user_name,sql_text
from v$open_cursor
where sid in (select sid from (select sid,serial#,username,program
from v$session
where status='ACTIVE'))
子查询
select sid from (select sid,serial#,username,program
from v$session
where status='ACTIVE')
就是查出正在Active的session的sid啦