Solved

how to get SQL stament in database auditing?

Posted on 2011-03-17
4
392 Views
Last Modified: 2012-05-11
Hi,

I recently enabled auditing on my database.i audit all DDL,DML.its working fine.when i query SQL> select username, owner, obj_name, action_name,
  2          decode(returncode, '0','Success',returncode) decode,
  3          to_char(timestamp,'DD-MON-YYYY HH24:MI') login
  4          from dba_audit_object;

USERNAME     OWNER           OBJ_NAME   ACTION_NAM DECODE     LOGIN            
------------ --------------- ---------- ---------- ---------- ---------------  
REFERENCE_ST REFERENCE_STAGE MEMBERS    INSERT     Success    10-MAR-2011 05:  
AGE                                                           27                
                                                                               
REFERENCE_ST REFERENCE_STAGE MEMBERS    INSERT     Success    10-MAR-2011 05:  
AGE                                                           27                
                                                                               
REFERENCE_ST REFERENCE_STAGE MEMBERS    INSERT     Success    10-MAR-2011 05:  
AGE                                                           27                
                                                                               
REFERENCE_ST REFERENCE_STAGE MEMBERS    INSERT     Success    10-MAR-2011 05:  

i am getting the results like this.but i want to get  user changed SQL STAMENT(like select * from emp where empno='20').

can anybody tell how to get that .THQ
0
Comment
Question by:Cha1tu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:Piloute
ID: 35157452
Hi,

What's your db version ? I can't quite understand your question but guessing :

In 11.1, dba_audit_object contains a field called SQL_TEXT that actually contains the user's request.

Is this what you want ?

Cheers,
P
0
 
LVL 2

Author Comment

by:Cha1tu
ID: 35157615
@Piloute:  Thanks for your quick response.i am unsing 11g only,but when i qery this
SQL> select username, os_username, userhost, SQL_TEXT,priv_used from dba_audit_object where username = 'TEST';

USERNAME   OS_USERNAM   USERHOST  SQL_TEXT   PRIV_USED                              
-------- -             ---------           --------        ----------        ----------                              
TEST              HHKI\ABC          HHK\DEC                                                    
                                                           
                                                                               
TEST              HHKI\ABC          HHK\DEC                                                  
     


i am getting result like this.SQL_TEXT column is blank....its not displaying sql stament              
0
 
LVL 7

Accepted Solution

by:
Piloute earned 500 total points
ID: 35159288
Aha... In this case, either your entries were not SQL, OR you missed something in the configuration... What is your AUDIT_TRAIL parameter ?

SQL_BIND & SQL_TEXT need the parameter AUDIT_TRAIL to be one of the following : db,extended or xml,extended. Otherwise they are not populated.

P
0
 
LVL 2

Author Comment

by:Cha1tu
ID: 35207685
I set the parameters like this

SQL> show parameter audit;

NAME                                        TYPE                VALUE
----------------------------------- ----------- ------------------------------
audit_file_dest                      string         F:\ORACLE_11G\RDBMS\AUDIT
audit_sys_operations          boolean      TRUE
audit_trail                             string          DB, EXTENDED


but still i am not getting SQL_TEXT..please help me


SQL> select username, os_username, userhost, SQL_TEXT,priv_used from dba_audit_object where username = 'TEST';

USERNAME   OS_USERNAM   USERHOST  SQL_TEXT   PRIV_USED                              
-------- -             ---------           --------        ----------        ----------                              
TEST              HHKI\ABC          HHK\DEC                                                    
                                                           
                                                                               
TEST              HHKI\ABC          HHK\DEC                                                  

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
update using pipeline function 3 46
Excess Redo 3 48
SQL Syntax Question 9 56
Deleting multiple child tables from parent in one SQL statement 20 55
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question