dbms_fga

官方文档的pl/sql packages写的比较清楚,这里翻译一下

begin   
DBMS_FGA.ADD_POLICY (
   object_schema      =>  'HR', 
   object_name        =>  'EMPLOYEES', 
   policy_name        =>  'mypolicy1', 
   audit_condition    =>  'salary<10500 or manager_id<100', 
   audit_column       =>  'salary,manager_id', 
   handler_schema     =>   NULL, 
   handler_module     =>   NULL, 
   enable             =>   TRUE, 
   statement_types    =>  'INSERT, UPDATE,SELECT', 
   audit_trail        =>   DBMS_FGA.DB + DBMS_FGA.EXTENDED, 
   audit_column_opts  =>   DBMS_FGA.ALL_COLUMNS);    
end;

缺省值表:

dbms_fga

其中:
audit_trail
Setting audit_trail to DBMS_FGA.DB sends the audit trail to the SYS.FGA_LOG$ table in the database and omits SQL Text and SQL Bind.
Setting audit_trail to DBMS_FGA.DB + DBMS_FGA.EXTENDED sends the audit trail to the SYS.FGA_LOG$ table in the database and includes SQL Text and SQL Bind.
Setting audit_trail to DBMS_FGA.XML writes the audit trail in XML files sent to the operating system and omits SQL Text and SQL Bind.
Setting audit_trail to DBMS_FGA.XML + DBMS_FGA.EXTENDED writes the audit trail in XML files sent to the operating system and includes SQL Text and SQL Bind.
清除XML,查看AUDIT_FILE_DEST ,删除即可;
清除DB级:truncate table sys.fga_log$;
audit_column_opts参数指定下面的情况是否记录
1当查询涉及里面的列(audit_column_opts=dbms_fga.any_columns)都记录
2仅当所有的列都被涉及(audit_column_opts=dbms_fga.all_columns)才记录

检查策略:

select object_schema,object_name,policy_name,policy_text,policy_column,enabled,audit_trail,policy_column_options
 from dba_audit_policies;

查看审计结果:

select timestamp, 
db_user,
os_user,
object_schema,
object_name,
sql_text
from dba_fga_audit_trail; 

select  
db_user,
os_user,
object_schema,
object_name,
sql_text from dba_common_audit_trail

删除策略:

begin
dbms_fga.drop_policy('HR','EMPLOYEES','MYPOLICY1');
end;

如果会话还在,可以连接: sys.fga_log$.sessionid = V$SESSION.AUDSID来查询相关信息

转载于:https://blog.51cto.com/snowhill/2141798

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值