Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: problem with database level trigger
>
> To add to the previous answer.
> I couldn't reproduce your case: SYS is always able to drop the trigger.
> Can you post more:
> - real code
> - which is the owner? what are his privileges?
> ...
well, the trigger looked like:
CREATE OR REPLACE TRIGGER DDLProtection
BEFORE
TRUNCATE or RENAME or DROP or ALTER
ON DATABASE
BEGIN
if (has_privileges(...) = 0)
raise_application_error(-20001, 'Insufficient privileges for
the operation');
end if;
END;
and the function has_privileges() got invalid,
I'd replaced the body with
if (0 = 1)
raise_application_error(-20001, 'Insufficient privileges for
the operation');
end if;
and that solved all the problems
I reproduced the problem with TEST_USER:
CREATE USER TEST_USER IDENTIFIED BY TEST_USER; GRANT ALL PRIVILEGES TO TEST_USER; then I created the trigger from that account and invalidated the function used by the trigger. That done, an invalid trigger was preventing SYS from dropping itself
Thanks! Received on Wed Oct 20 2004 - 09:17:11 CDT