Oracle queries executed by a session

后端 未结 3 1401
有刺的猬
有刺的猬 2021-01-15 09:23

I am trying to trace the SQL statements executed against a particular database user. I don\'t have AUDITING enabled and I am using Oracle 11g.

I have the following q

3条回答
  •  终归单人心
    2021-01-15 10:04

    Try this

    SELECT l.Sql_Id
    FROM v$session s
    JOIN v$session_longops l 
        ON l.sid = s.Sid 
        AND l.Serial# = s.Serial# 
        AND l.Start_Time >= s.Logon_Time
    WHERE s.Audsid = Sys_Context('USERENV', 'SESSIONID')
    

    I assume you are interested only in log running sql's?

提交回复
热议问题