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!

Assistance with log on trigger

T1DSoldierDec 21 2023

Hello All,

I am having an issue with a log in trigger. I have looked at many examples and I dont understand why I am getting the error. It is preventing the log in, so is it working and if so why is it saying there is an error in the trigger?

oracle 19.21 multi

CREATE OR REPLACE TRIGGER OEM_TRIGGER
AFTER LOGON
ON TEST_OCI.SCHEMA
BEGIN
IF LOWER (SYS_CONTEXT ('userenv', 'session_user')) = ('test_oci')
AND LOWER (SYS_CONTEXT ('userenv', 'module')) = ('oem')
AND LOWER (SYS_CONTEXT ('userenv', 'program')) = ('oms')
AND LOWER (SYS_CONTEXT ('userenv', 'db_name')) IN ('test_instance', ‘test2_instance’)
THEN
NULL;
ELSE
RAISE_APPLICATION_ERROR (-20001, 'Connection to Root CDB with test_oci account is for OEM only.');
END IF;
END;
/

SHOW ERRORS;

Thanks in advance for any ideas

Dave

This post has been answered by T1DSoldier on Jan 17 2024
Jump to Answer
Comments
Post Details
Added on Dec 21 2023
5 comments
294 views