Oracle Database SQL Audit

Source: Internet
Author: User

In our daily work, some security-demanding databases need to increase audit operations and which users do what when.

1. Open the audit of the database

alter system set audit_sys_operations=TRUE scope=spfile;  //审计管理用户alter system set audit_trail=db,extended scope=spfile;  //将sql语句写入审计表中

2. Restart the database and view

重启数据库shutdown immediate;startup;show parameter audit;

3. Increase the audit strategy
We need to audit all operations of CAIWU users of the database

// 审计用户caiwu所有成功的操作audit all by caiwu by access whenever successful;

Or

//针对用户的审计(未执行成功的也审计)audit select table by caiwu by access;     //查表审计audit update table by caiwu by access;   //更新审计audit delete table by caiwu by access;    //删除审计audit insert table by caiwu by access;     //插入审计
//针对某表的更新、删除审计(错误也审计)AUDIT UPDATE,DELETE,INSERT ON T_TEST by access;  
//保护审计audit all on sys.aud$ by access;

4. Cancellation of audits

NOAUDIT UPDATE,DELETE,INSERT ON T_TEST by access;  

5. Query Audit Results

select OS_USERNAME,username,USERHOST,TERMINAL,TIMESTAMP,OWNER,obj_name,ACTION_NAME,sessionid,os_process,sql_text from dba_audit_trail;

6. Open the Audit table query to a user
grant select on dba_audit_trail to caiwu;

7. Clear Audit Records
DELETE FROM SYS.AUD$;

Oracle Database SQL Audit

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.