AuditbyaccessVSbysession-创新互联
ENV
专业领域包括做网站、网站建设、商城网站制作、微信营销、系统平台开发, 与其他网站设计及系统开发公司不同,创新互联公司的整合解决方案结合了帮做网络品牌建设经验和互联网整合营销的理念,并将策略和执行紧密结合,为客户提供全网互联网整合方案。[oracle@daidai ~]$ uname -a Linux daidai.com 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux [oracle@daidai ~]$ lsb_release -a LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID: RedHatEnterpriseServer Description: Red Hat Enterprise Linux Server release 5.5 (Tikanga) Release: 5.5 Codename: Tikanga SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production PL/SQL Release 11.2.0.4.0 - Production
Audit by access
SQL> show parameter audit NAME TYPE VALUE ------------------------------------ ------------------------------ ------------------------------ audit_file_dest string /u01/oracle/admin/ocp11g/adump audit_sys_operations boolean TRUE audit_syslog_level string audit_trail string DB, EXTENDED SQL> 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/A -/- -/- -/- -/- -/- -/- -/- SQL> select * from t; --conn daidai user,执行两次
select * from dba_common_audit_trail where object_schema='DAIDAI' and object_name='T' and audit_type='Standard Audit' order by extended_timestamp desc;
audit by access产生两条记录。
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 -/- -/- -/- -/- -/- -/- -/- -/- -/- S/S -/- -/- -/- -/- -/- -/- -/- SQL> truncate table aud$; --sys user Table truncated.SQL> select * from t; --conn daidai user,执行两次 select * from dba_common_audit_trail where object_schema='DAIDAI' and object_name='T' and audit_type='Standard Audit' order by extended_timestamp desc;同样audit by session产生两条记录。
Audit 缺省情况
SQL> select * from dba_obj_audit_opts; no rows selected SQL> 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 -/- -/- -/- -/- -/- -/- -/- -/- -/- S/S -/- -/- -/- -/- -/- -/- -/-Audit 缺省是by session
综上,针对同一SQL在同一SESSION中,Access & Session都会产生多条记录,并且audit缺省是by session。
另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。
新闻名称:AuditbyaccessVSbysession-创新互联
文章出自:http://myzitong.com/article/gsics.html