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!

Enabling Level-12 trace in SYSTEM.LOGON trigger

448778Oct 24 2008 — edited Oct 24 2008
I am trying to enable level-12 trace for a user as soon as it login to the database.

CREATE OR REPLACE TRIGGER SYSTEM.LOGON_ASPIRE
AFTER LOGON
ON DATABASE
BEGIN
if(upper(USER) = 'U_DATAHUB') then
EXECUTE IMMEDIATE 'ALTER SESSION SET EVENTS ''10046 TRACE NAME CONTEXT FOREVER,LEVEL 12''';
execute immediate 'alter session set current_schema=DATAHUB';
end if;

I have Grant DBA to user U_DATAHUB and I am able to generatr trace for all sessions..but all the trace file is showing this error

PARSING IN CURSOR #4 len=68 dep=2 uid=5 oct=42 lid=5 tim=14297715680259 hv=753686485 ad='0'
ALTER SESSION SET EVENTS '10046 TRACE NAME CONTEXT FOREVER,LEVEL 12'
END OF STMT
PARSE #4:c=0,e=18,p=0,cr=0,cu=0,mis=0,r=0,dep=2,og=0,tim=14297715680254
ERROR #2:err=1031 tim=2228813739
Skipped error 604 during the execution of SYSTEM.LOGON_ASPIRE
*** 2008-10-24 16:09:40.272
ksedmp: internal or fatal error
ORA-00604: error occurred at recursive SQL level 1
ORA-01031: insufficient privileges
ORA-06512: at line 192
This post has been answered by Enrique Orbegozo on Oct 24 2008
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 21 2008
Added on Oct 24 2008
20 comments
5,439 views