审计定义-sys_audit_defs
功能描述
sys_audit_defs系统表用于管理数据库审计定义信息。
字段说明
序号 | 字段名 | 类型 | 说明 |
---|---|---|---|
0 | DB_ID | OID_TYPE | 库ID |
1 | USER_ID | OID_TYPE | 用户ID |
2 | OBJ_ID | OID_TYPE | 对象ID |
3 | OBJ_TYPE | INTEGER | 对象类别 |
4 | AUDIT_MASK | BIGINT | 审计项目掩码 |
5 | WHENEVER | INTEGER | 审计时机(1:操作成功时记录审计项 2:操作失败时记录审计项 3:无论成功与否都记录审计项) |
6 | RESERVED1 | VARCHAR | 保留字段 |
7 | RESERVED2 | VARCHAR | 保留字段 |
AUDIT_MASK
编号 | 审计项目 | 成功 | 失败 | 所有 |
---|---|---|---|---|
1 | AUDIT_CONNECT | 4 | 8 | 12 |
2 | AUDIT_DATABASE | 4 | 8 | 12 |
3 | AUDIT_USER | 16 | 32 | 48 |
4 | AUDIT_ROLE | 256 | 512 | 768 |
5 | AUDIT_SCHEMA | 1024 | 2048 | 3072 |
6 | AUDIT_TABLE | 4096 | 8192 | 12288 |
7 | AUDIT_VIEW | 16384 | 32768 | 49152 |
8 | AUDIT_INDEX | 65536 | 131072 | 196608 |
9 | AUDIT_PROCEDURE | 262144 | 524288 | 786432 |
10 | AUDIT_TRIGGER | 1048576 | 2097152 | 3145728 |
11 | AUDIT_SEQUENCE | 4194304 | 8388608 | 12582912 |
12 | AUDIT_GRANT | 16777216 | 33554432 | 50331648 |
13 | AUDIT_REVOKE | 67108864 | 134217728 | 201326592 |
14 | AUDIT_AUDIT | 268435456 | 536870912 | 805306368 |
15 | AUDIT_NOAUDIT | 1073741824 | 2147483648 | 3221225472 |
16 | AUDIT_INSERT | 4294967296 | 8589934592 | 12884901888 |
17 | AUDIT_UPDATE | 17179869184 | 34359738368 | 51539607552 |
18 | AUDIT_DELETE | 68719476736 | 137438953472 | 206158430208 |
19 | AUDIT_SELECT | 274877906944 | 549755813888 | 824633720832 |
20 | AUDIT_LOCK_TAB | 1099511627776 | 2199023255552 | 3298534883328 |
21 | AUDIT_EXECUTE | 4398046511104 | 8796093022208 | 13194139533312 |
22 | AUDIT_POLICY | 17592186044416 | 35184372088832 | 52776558133248 |
23 | AUDIT_USER_POLICY | 70368744177664 | 140737488355328 | 211106232532992 |
24 | AUDIT_TAB_POLICY | 281474976710656 | 562949953421312 | 844424930131968 |
25 | AUDIT_SPACE | 1125899906842620 | 2251799813685250 | 3377699720527870 |
26 | AUDIT_PACKAGE | 4503599627370500 | 9007199254740990 | 13510798882111500 |
27 | AUDIT_TYPE | 18014398509482000 | 36028797018964000 | 54043195528446000 |
28 | AUDIT_DB_LINK | 72057594037927900 | 144115188075856000 | 216172782113784000 |
29 | AUDIT_SYNONYM | 288230376151712000 | 576460752303423000 | 864691128455135000 |
30 | AUDIT_DOMAIN | 1152921504606850000 | 2305843009213690000 | 3458764513820540000 |
示例
查询审计项目掩码等信息
sqlauditor: SQL> AUDIT TABLE; dba: SQL> SELECT * FROM sys_audit_defs; DB_ID | USER_ID | OBJ_ID | OBJ_TYPE | AUDIT_MASK | RESERVED1 | RESERVED2 | ------------------------------------------------------------------------------ 1 | 0 | 0 | <NULL>| 12288 | <NULL>| <NULL>|
查询审计对象等信息
相关系统表
- sys_users
- sys_audit_results
特殊说明
审计操作需先开启审计:SET enable_audit ON