Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-01031: insufficient privileges in a LOGON TRIGGER

thompjs-JavaNetDec 29 2010 — edited Dec 30 2010
Logged onto db as SYS (SYSDBA) and created:


CREATE OR REPLACE TRIGGER SYSTEM.trace_login
AFTER LOGON
ON DATABASE
BEGIN
IF SYS_CONTEXT ('USERENV', 'SESSION_USER') LIKE '%TS_PROD_OGE_70803A%'
THEN
-- EXECUTE IMMEDIATE 'alter session set sql_trace = TRUE' ;
DBMS_SESSION.session_trace_enable (waits => TRUE, binds => FALSE);
EXECUTE IMMEDIATE 'alter session set tracefile_identifier=LOCTRACE';
END IF;
END;

When user TS_PROD_OGE_70803A connects (logon)

Trace file c:\oracle\app\tsadmin\diag\rdbms\wptsora11g\wptsora1\trace\wptsora1_ora_2444.trc
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Windows NT Version V6.0 Service Pack 2
CPU : 4 - type 8664, 4 Physical Cores
Process Affinity : 0x0000000000000000
Memory (Avail/Total): Ph:793M/4094M, Ph+PgF:4981M/8437M
Instance name: wptsora1
Redo thread mounted by this instance: 1
Oracle process number: 21
Windows thread id: 2444, image: ORACLE.EXE (SHAD)


*** 2010-12-29 16:50:52.723
*** SESSION ID:(54.2012) 2010-12-29 16:50:52.723
*** CLIENT ID:() 2010-12-29 16:50:52.723
*** SERVICE NAME:(WPTSORA11G) 2010-12-29 16:50:52.723
*** MODULE NAME:(SQL Developer) 2010-12-29 16:50:52.723
*** ACTION NAME:() 2010-12-29 16:50:52.723

Skipped error 604 during the execution of SYSTEM.TRACE_LOGIN

*** 2010-12-29 16:50:52.723
----- Error Stack Dump -----
ORA-00604: error occurred at recursive SQL level 1
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SESSION", line 269
ORA-06512: at line 5


I've tried quite a number of grants to the user but I always get the same response

(Oracle 10.2.x and also on Oracle 11)

Thanks for any tips
This post has been answered by Finbar Fitzgerald on Dec 29 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 27 2011
Added on Dec 29 2010
9 comments
5,431 views