Last active
November 4, 2022 15:48
-
-
Save hhudson/bdbe2168fa14f69d4971ae080e9b2fc9 to your computer and use it in GitHub Desktop.
A Database Logon Trigger to set session values (enable PL/SQL Warnings, for eg)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This script needs to be run from a privileged account with the following grants (SYS will work): | |
* • GRANT CREATE TRIGGER TO {your privileged schema}; | |
* • GRANT ADMINISTER DATABASE TRIGGER TO {your privileged schema}; | |
*/ | |
create or replace trigger ait_logon_trigger | |
after logon on database | |
when (user not in ('SYS','SYSTEM') and user not like 'APEX%') | |
begin | |
execute immediate q'[ALTER SESSION SET PLSQL_WARNINGS = 'ENABLE:ALL']'; | |
execute immediate q'[ALTER SESSION SET PLSCOPE_SETTINGS='IDENTIFIERS:ALL, STATEMENTS:ALL']'; | |
end ait_logon_trigger; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment