合并报告:ORA-28138:指定了无效的策略谓词

时间:2016-12-01 06:33:14

标签: oracle merge

当我执行合并声明时:

merge into employees e using new_employees n
on (e.employee_id = n.employee_id)
when matched then
update set e.salary = n.salary
when not matched then
insert (employee_id,first_name,last_name,email,phone_number,hire_date,
           job_id,salary,commission_pct,manager_id,department_id)
values (n.employee_id,n.first_name,n.last_name,n.email,n.phone_number,
           n.hire_date,n.job_id,n.salary,n.commission_pct,n.manager_id,
           n.department_id);

报告:ORA-28138:指定了无效的策略谓词。 我怎么了?

我发现此错误是由Fine_Grained审核引起的。我之前创建了一个策略,如下所示:

 DBMS_FGA.add_policy (object_schema       => 'primer',
                object_name         => 'employees',
                policy_name         => 'audit_policy',
                audit_condition     => 'employee_id = 100',
                audit_column        => 'phone_number,salary',
                handler_schema      => 'primer',
                handler_module      => 'FGA_SEND_MAIL(primer,employees,audit_policy)',
                ENABLE              => TRUE,
                statement_types     => 'select,insert,update,delete',
                audit_trail         => DBMS_FGA.db_extended,
                audit_column_opts   => DBMS_FGA.any_columns);

create or replace procedure primer.fga_send_mail (p_schema   in varchar2,
                                          p_obj      in varchar2,
                                          p_pol      in varchar2)
as
begin
   dbms_output.put_line ('Audit Trail Generated');
   dbms_output.put_line ('SQL=' || sys_context ('USERENV', 'CURRENT_SQL'));
   dbms_output.put_line ('USER' || sys_context ('USERENV', 'SESSION_USER'));

端;

它有什么问题?

0 个答案:

没有答案