Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Logon Trigger on schema
-----Message d'origine-----
De : Bertrand Guillaumin [mailto:bguillaumin.ext_at_francetelecom.com]
Envoyé : jeudi 6 avril 2006 15:29
À : 'Oracle-L Freelists'
Objet : Logon Trigger on schema
Hi! I'm trying to use a logon trigger on a schema so that it will systematically have the skip_unusable_indexes set to true and parallel DML enabled(I have to use an app which sometimes disconnects and reconnects without any visible reason).
So I wrote this trigger :
SQL> CREATE OR REPLACE TRIGGER FC_ENABLE_PARALLEL_DML after LOGON ON SCHEMA
2 BEGIN
3 EXECUTE IMMEDIATE 'ALTER SESSION ENABLE PARALLEL DML';
4 EXECUTE IMMEDIATE 'ALTER SESSION SET SKIP_UNUSABLE_INDEXES=TRUE';
5 END;
6 /
DÚclencheur crÚÚ.
and created a table for testing purpose : SQL> CREATe TABLE T AS SELECT 1 as num FROM DUAL 2 /
Table crÚÚe.
SQL> CREATE INDEX I ON T(NUM)
2 /
Index crÚÚ.
SQL> ALTER INDEX I UNUSABLE
2 /
Index modifiÚ.
But the problem is, when I disconnect and reconnect via sqlplus and try to update an indexed column with the same user :
SQL> UPDATE T set NUM = 2;
UPDATE T set NUM = 2
*
ERREUR Ó la ligne 1 :
ORA-01502: index 'CP20DEV2.I' or partition is unusable
I'm working on 9.2.0.4.
Any hint or advice appreciated.
Regards,
Bertrand Guillaumin
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Apr 11 2006 - 03:52:33 CDT
![]() |
![]() |