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!

SYS_CONTEXT ('USERENV', 'SESSION_USER')) returns PUBLIC

user10550197Jan 24 2016 — edited Jan 25 2016

I have a created a trigger that is type of "AFTER LOGON ON DATABASE" .  This trigger captures user session information and inserts into a table. The table "SESSIONSHISTORY" has a primary key on sessionid using value from  dba_audit_trail.sessionid.


I sometimes receive the following errors .

 

ORA-20001: error:

ORA-00001: unique constraint (XXXXXXXXXXX_PK) violated


debug output: USERENV, SESSIONID: 999999999

debug output: USERENV, SESSION_USER: PUBLIC

debug output:  USERENV, OS_USER: XXXXXXX

 

The output above is generated from the trigger "WHEN OTHERS THEN" section


sys.dbms_system.ksdwrt (2, 'debug output: USERENV, SESSION_USER: ' || SYS_CONTEXT ('USERENV', 'SESSION_USER'));

I'm trying to identify what and who is public? I have no public user.?


Thank you for your help and assistance.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 22 2016
Added on Jan 24 2016
8 comments
810 views