Skip to Main Content

Logon Trigger - Question

719861Aug 28 2009 — edited Aug 28 2009
Hi,

I'm a beginner on the Oracle technology and I'm trying add a step on my logon trigger that avoids that the same user connects twice to the database using PL/SQL Developer.

Here what I'm doing:

.
.
.
VUSER := UPPER(SYS_CONTEXT('USERENV', 'SESSION_USER'))

VPROGRAM := UPPER(SYS_CONTEXT('USERENV', 'MODULE'))
.
.
.
SELECT COUNT(*) INTO N_SESSION
FROM V$SESSION
WHERE USERNAME = UPPER(SYS_CONTEXT('USERENV', 'SESSION_USER'));

IF VUSER NOT IN ('SYS','SYSTEM') AND N_SESSION >= 2 AND VPROGRAM LIKE 'PLSQLDEV%' THEN
RAISE_APPLICATION_ERROR(-20003,
'Access to database ' ||
UPPER(SYS_CONTEXT('USERENV', 'DB_NAME')) ||
' denied for this application');
END IF;
.
.
.

For some reason, it's not working.

Do you guys know what I should do?

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked due to inactivity on Sep 25 2009
Added on Aug 28 2009
2 comments
737 views