AUDIT_TRAIL = { none | os | db | db,extended | xml | xml,extended }
查看當(dāng)前數(shù)據(jù)庫(kù)審計(jì):
SYS@hfdr>show parameter audit_trail
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_trail string DB
可是更改audit_trail參數(shù)需要重啟數(shù)據(jù)庫(kù),就可以使用細(xì)粒度審計(jì)(FGA:Fine Grained Auditing)來進(jìn)行實(shí)現(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)建完之后驗(yàn)證創(chuàng)建是否成功
ZHANGYUN@hfdr>select policy_name from dba_audit_policies;
POLICY_NAME
------------------------------
CHK_ZHANGYUN_ZY
查看審計(jì)是否有效
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 下面我們來刪除已經(jīng)創(chuàng)建的FGA審計(jì)
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
文章版權(quán)歸作者所有,未經(jīng)允許請(qǐng)勿轉(zhuǎn)載,若此文章存在違規(guī)行為,您可以聯(lián)系管理員刪除。
轉(zhuǎn)載請(qǐng)注明本文地址:http://specialneedsforspecialkids.com/yun/129434.html
摘要:如何成為云中硬核牧羊人云堡壘機(jī)服務(wù)高效運(yùn)維,讓云主機(jī)不再成為落單的小羊企業(yè)運(yùn)維場(chǎng)景難點(diǎn),自檢你中招了哪些企業(yè)運(yùn)維賬號(hào)眾多企業(yè)運(yùn)維的服務(wù)器數(shù)量眾多,而維護(hù)人員數(shù)量有限,一個(gè)運(yùn)維人員維護(hù)多臺(tái)主機(jī)多個(gè)系統(tǒng)的現(xiàn)象普遍存在。 如何成為云中硬核牧羊人?云堡壘機(jī)服務(wù)高效運(yùn)維,讓云主機(jī)不再成為落單的小羊! 企業(yè)運(yùn)維場(chǎng)景難點(diǎn),自檢你中招了哪些?? 企業(yè)運(yùn)維賬號(hào)眾多企業(yè)運(yùn)維的服務(wù)器數(shù)量眾多,而維護(hù)人...
摘要:往期精選社區(qū)投稿和跨分片查詢結(jié)果不一致案例分析自定義拆分算法配置解析使用指南開源分布式中間件快速入門指南配置解析社區(qū)活動(dòng)如何獲取全國(guó)場(chǎng)主題大會(huì)免費(fèi)入場(chǎng)券 DBLE是基于開源項(xiàng)目MyCat發(fā)展的企業(yè)級(jí)開源分布式中間件,適用于高并發(fā)及TB級(jí)海量數(shù)據(jù)處理場(chǎng)景;江湖人送外號(hào) MyCat Plus;其簡(jiǎn)單穩(wěn)定,持續(xù)維護(hù),良好的社區(qū)環(huán)境和廣大的群眾基礎(chǔ)使DBLE得到了社區(qū)的大力支持。 DBLE項(xiàng)目...
閱讀 1346·2023-01-11 13:20
閱讀 1684·2023-01-11 13:20
閱讀 1132·2023-01-11 13:20
閱讀 1858·2023-01-11 13:20
閱讀 4100·2023-01-11 13:20
閱讀 2704·2023-01-11 13:20
閱讀 1385·2023-01-11 13:20
閱讀 3597·2023-01-11 13:20