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: Michel Cadot <micadot{at}altern{dot}org>
Date: Tue, 19 Oct 2004 06:33:21 +0200
Message-ID: <417498d3$0$24430$636a15ce@news.free.fr>

"Ford Desperado" <ford_desperado_at_yahoo.com> a écrit dans le message de news:e96bc0d0.0410181416.47df63b4_at_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
Use SYS to drop your trigger.
This shows the issue we can get with database trigger if we don't test it before.

-- 
Regards
Michel Cadot
Received on Mon Oct 18 2004 - 23:33:21 CDT

Original text of this message

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