Skip to main content

การเปิดใช้ Audit การใช้งานฐานข้อมูลบน Oracle 11c

1. Log in as SYS by SYSDBA

[oracle@labdbt2 bin]$ sqlplus "/as sysdba"

2. Check current setting

SQL> show parameter audit
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /oracle/admin/dblabt1/adump
audit_sys_operations                 boolean     TRUE
audit_syslog_level                   string
audit_trail                          string      DB
unified_audit_sga_queue_size         integer     1048576

3. Enable audit for sys operations.

SQL>alter system set audit_sys_operations=true scope=spfile;

4. Set the type of auditing you want by setting the audit_trail parameter

SQL> alter system set audit_trail=NONE scope=spfile;

5. change auditing destination

SQL> alter system set audit_file_dest='/oracle/admin/db12ct/adump' scope=spfile;

6. restart oracle instance

SQL> show parameter audit
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /oracle/admin/dblabt1/adump
audit_sys_operations                 boolean     TRUE
audit_syslog_level                   string
audit_trail                          string      DB
unified_audit_sga_queue_size         integer     1048576
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
 
Total System Global Area 2466250752 bytes
Fixed Size                  8795760 bytes
Variable Size             603982224 bytes
Database Buffers         1845493760 bytes
Redo Buffers                7979008 bytes
Database mounted.
Database opened.
SQL> 
SQL> show parameter audit
 
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest                      string      /oracle/admin/dblabt1/adump
audit_sys_operations                 boolean     TRUE
audit_syslog_level                   string
audit_trail                          string      NONE
unified_audit_sga_queue_size         integer     1048576