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 -> problem with database level trigger

problem with database level trigger

From: Ford Desperado <ford_desperado_at_yahoo.com>
Date: 18 Oct 2004 15:16:37 -0700
Message-ID: <e96bc0d0.0410181416.47df63b4@posting.google.com>


there is a database level trigger which prevents from accidentally modifying view/functions/procedures:

CREATE OR REPLACE TRIGGER DDLProtection
BEFORE
TRUNCATE or RENAME or DROP or ALTER
ON DATABASE
BEGIN
  if some conditions here

              raise_application_error(-20001, 'Insufficient privileges for the operation');

            end if;
  end if;
END; the problem is that somehow it is in invalid state

any attempt to DO ANYTHING WITH IT it results in an error:

ALTER TRIGGER AAA.DDLProtection COMPILE
ORA-04098: trigger 'AAA.DDLPROTECTION' is invalid and failed re-val ALTER TRIGGER AAA.DDLProtection DISABLE
ORA-04098: trigger 'AAA.DDLPROTECTION' is invalid and failed re-val DROP TRIGGER AAA.DDLProtection
ORA-04098: trigger 'AAA.DDLPROTECTION' is invalid and failed re-val

using a system account has not helped

Looks like catch-22 to me: as soon as the trigger is invalid, no DDL can ever be changed

Any suggestions?
TIA Received on Mon Oct 18 2004 - 17:16:37 CDT

Original text of this message

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