Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Audit by access VS by session

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

ENV

[oracle@daidai ~] $uname-aLinux daidai.com 2.6.18-194.el5 # 1 SMP Tue Mar 16 21:52:39 EDT 2010 x86 "64 GNU/Linux [oracle@daidai ~] $lsb_release-aLSB Version:: core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarchDistributor ID: RedHatEnterpriseServerDescription: RedHatEnterprise Linux Server release 5.5 (Tikanga) Release: 5.5Codename: TikangaSQL > select * from v$version BANNER----Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit ProductionPL/SQL Release 11.2.0.4.0-Production

Audit by access

SQL > show parameter auditNAME TYPE VALUE -audit_file_dest string / u01/oracle/admin/ocp11g/adumpaudit_sys_operations boolean TRUEaudit_syslog_level stringaudit_trail string DB EXTENDEDSQL > audit select on daidai.t by access Audit succeeded.SQL > select * from DBA_OBJ_AUDIT_OPTS OWNER OBJECT_NAME OBJECT_TYPE ALT AUD COM DEL GRA IND INS LOC REN SEL -UPD REF EXE CRE REA WRI FBK-- -DAIDAI T TABLE-/-A SQL A-/-- /-/-SQL > select * from t -- conn daidai user, execute select * from dba_common_audit_trail where object_schema='DAIDAI' and object_name='T' and audit_type='Standard Audit' order by extended_timestamp desc twice

Audit by access produces two records.

Audit by Session

SQL > audit select on daidai.t by session;Audit succeeded.SQL > select * from DBA_OBJ_AUDIT_OPTS OWNER OBJECT_NAME OBJECT_TYPE ALT AUD COM DEL GRA IND INS LOC REN SEL -UPD REF EXE CRE REA WRI FBK-- -DAIDAI T TABLE-/-Squre Splink-/-SQL > truncate table aud$ -- sys userTable truncated.SQL > select * from t;-- conn daidai user, execute select * from dba_common_audit_trail where object_schema='DAIDAI' and object_name='T' and audit_type='Standard Audit' order by extended_timestamp desc twice

Similarly, audit by session produces two records.

Audit default

SQL > select * from dba_obj_audit_opts;no rows selectedSQL > audit select on daidai.t;Audit succeeded.SQL > select * from dba_obj_audit_opts OWNER OBJECT_NAME OBJECT_TYPE ALT AUD COM DEL GRA IND INS LOC REN SEL -UPD REF EXE CRE REA WRI FBK-- -DAIDAI T TABLE-/-- Squre Splink-- /-

Audit defaults to by session

To sum up, Access & Session will produce multiple records for the same SQL in the same SESSION, and audit defaults to by session.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report