Oracle queries executed by a session

后端 未结 3 1399
有刺的猬
有刺的猬 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:00

    According to oracle documentation

    SQL_ADDRESS -Used with SQL_HASH_VALUE to identify the SQL statement that is currently being  executed 
    
    SQL_HASH_VALUE - Used with SQL_ADDRESS to identify the SQL statement that is currently being executed 
    

    Please find the below link for reference

    SQL_ADDRESS and HASH VALUE

    Kindly modify the SQL below

        SELECT S.MODULE, SQL_TEXT, SN.OSUSER, SN.MACHINE, S.EXECUTIONS
          FROM SYS.V_$SQL S, SYS.ALL_USERS U, V$SESSION SN
         WHERE S.PARSING_USER_ID = U.USER_ID
           AND UPPER(U.USERNAME) IN ('USERNAME')
           AND (UPPER(S.MODULE) = 'APP.EXE')
           AND SN.sql_hash_value = S.hash_value
           AND SN.sql_address = S.address
         ORDER BY S.LAST_LOAD_TIME
    

提交回复
热议问题