--1.执行以下包制定监考策略
begin
dbms_fga.add_policy(object_name => 'ods_product', --被操作表名
policy_name => 'my_control', --策略的名称
statement_types => 'update,delete,insert', --要监考的操作,如果有两个以上用“,”分隔
enable=>TRUE );
end;
/
dbms_fga.add_policy(object_name => 'ods_product', --被操作表名
policy_name => 'my_control', --策略的名称
statement_types => 'update,delete,insert', --要监考的操作,如果有两个以上用“,”分隔
enable=>TRUE );
end;
/
--2、查询刚才创建的策略
select * from dba_audit_policies;
select * from dba_audit_policies;
--3.查询指定策略对象(表)的操作
select timestamp,
userhost,
os_user,
db_user,
object_schema,
object_name,
statement_type,
sql_text,
policy_name
from dba_fga_audit_trail
where policy_name = 'MY_CONTROL'
order by timestamp;
select timestamp,
userhost,
os_user,
db_user,
object_schema,
object_name,
statement_type,
sql_text,
policy_name
from dba_fga_audit_trail
where policy_name = 'MY_CONTROL'
order by timestamp;
--4.删除刚才制定的监考策略
exec dbms_fga.drop_policy(object_schema=>'mytest', object_name => 'ods_product',policy_name => 'my_control');
exec dbms_fga.drop_policy(object_schema=>'mytest', object_name => 'ods_product',policy_name => 'my_control');
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25269462/viewspace-764276/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/25269462/viewspace-764276/