How To Create Disabled Trigger?

Hi,

My friend working as developer asked me a question about triggers a few days ago.

The question was as follows: I want to create Trigger as disabled is it possible?

Prior to 11g all triggers used to get created in ENABLED state by default. That means triggers come into operation directly. On production systems, this behavior may cause unwanted issues. Prior to 11g, We can disable trigger using  “ALTER TRIGGER trigger_name DISABLE;”. However, the trigger can come into operation between the time of creation and disabling.

This problem is solved by DISABLED TRIGGER in Oracle 11g.  In Oracle 11g, we can specify ‘DISABLE’ clause in trigger definition.  For example let us create trigger in disabled state.

CREATE OR REPLACE TRIGGER TALIP_TEST_TRIG
BEFORE INSERT ON TALIP_TEST
FOR EACH ROW
DISABLED
BEGIN
:NEW.TARIH := SYSDATE;
END;

Talip Hakan Öztürk

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s