sql_text in dba_audit_trail is not populating [message #164453] |
Thu, 23 March 2006 09:03 |
pzlj6x
Messages: 107 Registered: May 2005 Location: Louisville
|
Senior Member |
|
|
I have oracle 10g installed. I have turned on the audit_trail to 'DB'. I see all or most values in dba_audit_trail view. However, I don't see anything in sql_text field, which is what I am looking for.
I am trying to find the SQLs run by the user anytime in the past days. I do have SQL written to find the current SQLs run by the user while they are in current session.
My objective is to find the SQLs run by users in the past. How do I do that. I thought, by turing on the audit_trail feature would give me the SQL_TEXT, but nada...
Can anyone help me please.
thanks in Advance.
R.
|
|
|
|
Re: sql_text in dba_audit_trail is not populating [message #164708 is a reply to message #164453] |
Fri, 24 March 2006 19:46 |
pzlj6x
Messages: 107 Registered: May 2005 Location: Louisville
|
Senior Member |
|
|
Audit by every activity that the user is doing.
Example, My manager wants to know what kind of SQL the user has run in the past days.
I wrote the query to find out the current SQL that the user is running. The below SQL gives the information of the sql_text in the current session.
==========
SELECT a.username, a.sid, a.serial#, a.osuser, b.tablespace, b.blocks, c.sql_text
FROM v$session a, v$tempseg_usage b, v$sqlarea c
WHERE a.saddr = b.session_addr
AND c.address= a.sql_address
AND c.hash_value = a.sql_hash_value
ORDER BY b.tablespace, b.blocks;
========
While reading the manual, I found the values for audit_trail. The allowed values are 'DB', 'DB_EXTENDED'. The DB_EXTENDED setting should give the sql_text field. I set the same and bounced back the database.
Still I am unable to get the result. I think, as you said, I need to set 'audit level' (by session, transaction) or so, which I do not know and don't have an idea.
Please help as this gets critical to our need.
Thanks
R.
|
|
|
|
|
|
|