audit by user by table

zhouwf0726發表於2019-05-02
看聯機文件audit語法應該可以實現,實際上確不能。
 
T@ bip> audit select,insert,update,delete on t.t by ys;
audit select,insert,update,delete on t.t by ys                                           *
ERROR at line 1:
ORA-01708: ACCESS or SESSION expected
I wanted to audit dml by user by table,but I can not.Use FGA instead.
BEGIN
  DBMS_FGA.ADD_POLICY(
   object_schema      => 'T',
   object_name        => 'T',
   policy_name        => 'chk_t',
  audit_condition    => 'sys_context(''userenv'',''session_user'')=''TT''',
   enable             =>  TRUE,
   statement_types    => 'INSERT, UPDATE, SELECT, DELETE',
   audit_trail        =>  DBMS_FGA.DB);
END;
/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/756652/viewspace-722623/,如需轉載,請註明出處,否則將追究法律責任。

相關文章