开启审计:
alter system autit_trail=true scope=spfile;
关闭审计:
alter system autit_trail= none scope=spfile;
增加审计列:自己一看就懂咋个填,就不多写了
BEGIN
dbms_fga.add_policy(object_schema => 'HSCMP',
object_name => 'TEST',
policy_name => 'TEST_POLICY',
audit_column => 'ENAME',
statement_types => 'update,insert',
ENABLE => TRUE);
END;
/
查询开启老哪些表、列的审计
SELECT object_schema, object_name, policy_name, enabled
FROM dba_audit_policies;
查询审计表、列的变动情况
SELECT *
FROM dba_fga_audit_trail
ORDER BY TIMESTAMP;
删除审计列
BEGIN
dbms_fga.drop_policy(object_schema => 'TEST',
object_name => 'dept2',
policy_name => 'update_dept2_dname');
END;
删除审计的数据:
DELETE FROM sys.fga_log$ WHERE policyname = upper('UPDATE_DEPT2_DNAME');