看看當前某個使用者執行什麼

lfree發表於2006-03-10
SELECT r.name, s.sid, s.serial#, s.username, s.machine, t.status,
t.cr_get, t.phy_io, t.used_ublk, t.noundo,
substr(s.program, 1, 78) "COMMAND", s.USERNAME "DB User",
t.start_time, s.sql_address "Address", s.sql_hash_value "Sql Hash"
FROM sys.v_$session s, sys.v_$transaction t, sys.v_$rollname r
WHERE t.addr = s.taddr
AND t.xidusn = r.usn
ORDER BY t.start_time


SELECT sql_text
FROM V$sqltext_with_newlines
WHERE address = (
SELECT prev_sql_addr
FROM V$session
WHERE username = :uname
AND sid = :snum
)
ORDER BY piece

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-82822/,如需轉載,請註明出處,否則將追究法律責任。

相關文章