Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: problem with database level trigger

Re: problem with database level trigger

From: Ford Desperado <ford_desperado_at_yahoo.com>
Date: 20 Oct 2004 07:17:11 -0700
Message-ID: <e96bc0d0.0410200617.51603214@posting.google.com>


>
> 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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US