AUDIT_TRAIL = { none | os | db | db,extended | xml | xml,extended }
查看當前數(shù)據(jù)庫審計:
SYS@hfdr>show parameter audit_trail
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_trail string DB
可是更改audit_trail參數(shù)需要重啟數(shù)據(jù)庫,就可以使用細粒度審計(FGA:Fine Grained Auditing)來進行實現(xiàn)。
DBMS_FGA.ADD_POLICY(
object_schema IN VARCHAR2 DEFAULT NULL
object_name IN VARCHAR2,
policy_name IN VARCHAR2,
audit_condition IN VARCHAR2 DEFAULT NULL,
audit_column IN VARCHAR2 DEFAULT NULL
handler_schema IN VARCHAR2 DEFAULT NULL,
handler_module IN VARCHAR2 DEFAULT NULL,
enable IN BOOLEAN DEFAULT TRUE,
statement IN SELECT,
audit_trail IN BINARY_INTEGER DEFAULT NULL,
audit_column_opts IN BINARY_INTEGER DEFAULT ANY_COLUMNS,
policy_owner IN VARCHAR2 DEFAULT NULL);
BEGIN
DBMS_FGA.ADD_POLICY(
object_schema => HR,
object_name => EMPLOYEES,
policy_name => chk_hr_employees,
audit_column => SALARY,
enable => TRUE,
statement_types => INSERT, UPDATE, SELECT, DELETE);
END;
/
ZHANGYUN@hfdr>select * from zy;
ID NAME ADDR
---------- -------------------- --------------------
1 zhangyu6 hefei
2 zhangyu4 hefei
3 zhangyu4444 hefei
4 zhangyu3 hefei
5 zhangyu2 hefei
6 zhangyu1 hefei
BEGIN
DBMS_FGA.ADD_POLICY(
object_schema => ZHANGYUN,
object_name => ZY,
policy_name => chk_zhangyun_zy,
audit_column => name,
enable => TRUE,
statement_types => INSERT, UPDATE, SELECT, DELETE);
END;
/
創(chuàng)建完之后驗證創(chuàng)建是否成功
ZHANGYUN@hfdr>select policy_name from dba_audit_policies;
POLICY_NAME
------------------------------
CHK_ZHANGYUN_ZY
查看審計是否有效
ZHANGYUN@hfdr>select sql_text from dba_fga_audit_trail;
ZHANGYUN@hfdr>select * from zy where name=zhangyu1;
ID NAME ADDR
---------- -------------------- --------------------
6 zhangyu1 hefei
ZHANGYUN@hfdr>select * from zy;
ID NAME ADDR
---------- -------------------- --------------------
1 zhangyu6 hefei
2 zhangyu4 hefei
3 zhangyu4444 hefei
4 zhangyu3 hefei
5 zhangyu2 hefei
6 zhangyu1 hefei
ZHANGYUN@hfdr>select id from zy;
ID
----------
1
2
3
4
5
6
ZHANGYUN@hfdr>select id from zy where name=zhangyu1;
ID
----------
6
ZHANGYUN@hfdr>select sql_text from dba_fga_audit_trail;
SQL_TEXT
--------------------------------------------------------------------------------
select * from zy where name=zhangyu1
select * from zy
select id from zy where name=zhangyu1
DBMS_FGA.DROP_POLICY(
object_schema VARCHAR2,
object_name VARCHAR2,
policy_name IVARCHAR2);
6.2 下面我們來刪除已經創(chuàng)建的FGA審計
BEGIN
DBMS_FGA.DROP_POLICY(
object_schema => zhangyun,
object_name => zy,
policy_name => chk_zhangyun_zy);
END;
/
select policy_name from dba_audit_policies;
ZHANGYUN@hfdr>select sql_text from dba_fga_audit_trail;
SQL_TEXT
--------------------------------------------------------------------------------
select * from zy where name=zhangyu1
select * from zy
select id from zy where name=zhangyu1
文章版權歸作者所有,未經允許請勿轉載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉載請注明本文地址:http://m.specialneedsforspecialkids.com/yun/129434.html
摘要:如何成為云中硬核牧羊人云堡壘機服務高效運維,讓云主機不再成為落單的小羊企業(yè)運維場景難點,自檢你中招了哪些企業(yè)運維賬號眾多企業(yè)運維的服務器數(shù)量眾多,而維護人員數(shù)量有限,一個運維人員維護多臺主機多個系統(tǒng)的現(xiàn)象普遍存在。 如何成為云中硬核牧羊人?云堡壘機服務高效運維,讓云主機不再成為落單的小羊! 企業(yè)運維場景難點,自檢你中招了哪些?? 企業(yè)運維賬號眾多企業(yè)運維的服務器數(shù)量眾多,而維護人...
摘要:往期精選社區(qū)投稿和跨分片查詢結果不一致案例分析自定義拆分算法配置解析使用指南開源分布式中間件快速入門指南配置解析社區(qū)活動如何獲取全國場主題大會免費入場券 DBLE是基于開源項目MyCat發(fā)展的企業(yè)級開源分布式中間件,適用于高并發(fā)及TB級海量數(shù)據(jù)處理場景;江湖人送外號 MyCat Plus;其簡單穩(wěn)定,持續(xù)維護,良好的社區(qū)環(huán)境和廣大的群眾基礎使DBLE得到了社區(qū)的大力支持。 DBLE項目...
閱讀 1353·2023-01-11 13:20
閱讀 1700·2023-01-11 13:20
閱讀 1211·2023-01-11 13:20
閱讀 1904·2023-01-11 13:20
閱讀 4162·2023-01-11 13:20
閱讀 2751·2023-01-11 13:20
閱讀 1397·2023-01-11 13:20
閱讀 3664·2023-01-11 13:20