-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathAUDIT.sql
24 lines (19 loc) · 1.19 KB
/
AUDIT.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--select * from dba_audit_session;
--show parameters aud;
--select * from aud$ order by NTIMESTAMP# desc;
--SELECT username, TIMESTAMP, owner, obj_name, action_name, obj_privilege, sys_privilege, admin_option, grantee, audit_option, returncode FROM dba_audit_statement;
--select * from dba_audit_object;
--SELECT audit_option FROM dba_stmt_audit_opts; --îïöèè óñòàíîâëåííûå â Àóäèòå (çà êàêèìè îïåðàöèÿìè ñëåäèòü)
SELECT privilege, success, failure FROM dba_priv_audit_opts;
--AUDIT select table, insert table, update table, delete table BY ah, be; --àóäèò êîìàíä äëÿ ïîëüçîâàòåëåé ah, be
--NOAUDIT insert table, update table, delete table, select table BY ah, be; --îòêëþ÷àèòü
--AUDIT select, insert, update, delete ON hr.employees; --àóäèò îïåðàöèé íà òàáëèöó
--DESC dba_audit_trail;
--AUDIT alter system; --ñëåäèòü çà îïåðàöèåé alter system
--alter system set "_dbms_sql_security_level" = 384 scope=spfile;
--alter system set audit_trail='DB','EXTENDED' scope=spfile; --òîëüêî â sys.aud$ è îáßçàòåëüíûå íà ôàéëîâîé ñèñòåìå
--truncate table sys.aud$;
--AUDIT_SYS_OPERATIONS = TRUE
--AUDIT_TRAIL=OS,
--show parameter AUDIT_SYS_OPERATIONS
--alter system set AUDIT_TRAIL=NONE scope=spfile; --îòêëþ÷èòü àóäèò