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

Oracle database SQL audit

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

Share

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

In our daily work, some databases with high security requirements need to increase audit operations, which user did what at what time.

1. Open database audit

Alter system set audit_sys_operations=TRUE scope=spfile; / / Audit management user alter system set audit_trail=db,extended scope=spfile; / / write the sql statement to the audit table

two。 Restart the database and view

Restart the database shutdown immediate;startup;show parameter audit

3. Increase audit strategy

We need to audit all the operations of the caiwu users of the database

/ / Audit user caiwu all successful operations audit all by caiwu by access whenever successful

Or

/ / audit for users (audit if not performed successfully) audit select table by caiwu by access; / / look up table audit audit update table by caiwu by access; / / update audit audit delete table by caiwu by access; / / delete audit audit insert table by caiwu by access; / / insert audit / / update audit for a table, delete audit (error audit) AUDIT UPDATE,DELETE,INSERT ON T_TEST by access / / Protection Audit audit all on sys.aud$ by access

4. Cancel the audit

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 an audit table query to a user

Grant select on dba_audit_trail to caiwu

7. Empty audit records

DELETE FROM SYS.AUD$

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