
begin
DBMS_FGA.ADD_POLICY (object_schema => 'FRNTPC', object_name => 'USER_ACCOUNT', policy_name => 'POL_USER_ACCOUNT', enable => TRUE, statement_types => 'UPDATE, DELETE', audit_column_opts => DBMS_FGA.ANY_COLUMNS);
DBMS_FGA.ADD_POLICY (object_schema => 'FRNTPC', object_name => 'ROLE_AUTHORITY', policy_name => 'POL_ROLE_AUTHORITY', enable => TRUE, statement_types => 'UPDATE, DELETE', audit_column_opts => DBMS_FGA.ANY_COLUMNS);
DBMS_FGA.ADD_POLICY (object_schema => 'FRNTPC', object_name => 'ROLE', policy_name => 'POL_ROLE', enable => TRUE, statement_types => 'UPDATE, DELETE', audit_column_opts => DBMS_FGA.ANY_COLUMNS);
DBMS_FGA.ADD_POLICY (object_schema => 'FRNTPC', object_name => 'ORGANIZATION', policy_name => 'POL_ORGANIZATION', enable => TRUE, statement_types => 'UPDATE, DELETE', audit_column_opts => DBMS_FGA.ANY_COLUMNS);
end;


select 'edw数据库在' || to_char(f.timestamp,'yyyy-MM-dd HH24:mi:ss') || '发生来自主机' || f.userhost || '利用用户' ||
       f.db_user || '对表' || f.object_name || '进行违法操作,操作SQL为:' || f.sql_text
  from dba_fga_audit_trail f
 where f.timestamp > sysdate - 1 / 24;

select to_char(timestamp,'yyyy-MM-dd HH24:mi:ss') from dba_fga_audit_trail

select object_schema, object_name, policy_name from dba_audit_policies;
select * from dba_audit_policies;


SELECT  T.*, T.ROWID  FROM FRNTPC.USER_ACCOUNT T WHERE T.PHONE IN ('13422302090');
update FRNTPC.USER_ACCOUNT set email='test3@qq.com' where PHONE IN ('13422302090')
