PL/SQL (MOSC)

MOSC Banner

JDBC connections bypassing logon trigger—need a solution

edited Mar 6, 2025 7:05AM in PL/SQL (MOSC) 18 commentsAnswered

Oracle Product: Oracle Database 19c Enterprise Edition

Version: 19.23.0.0.0

Hi,

I have an issue regarding JDBC connections bypassing a logon trigger that is supposed to block access to my non-prod database. My goal is to block all connections except for specific users required for monitoring and maintenance, allowing me to complete some business tasks without interruptions.

I implemented the following logon trigger to enforce this restriction:

CREATE OR REPLACE NONEDITIONABLE TRIGGER SYS.AFTER_LOGON_TRG_BC

  AFTER LOGON on DATABASE

BEGIN

    IF SYS_CONTEXT('USERENV','SESSION_USER')

     NOT IN ('DBSNMP','SYSMAN','SYSRAC') THEN

     RAISE_APPLICATION_ERROR (-20001, 'Logon on database is blocked');

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center