Sometimes there are tiny little changes in a new release – and sometimes they are not documented very well yet. One of these changes is the new behavior of login.sql for SQL*Plus in Oracle Database 220.127.116.11.
Behavior before Oracle Database 12.2
In all releases until Oracle Database 18.104.22.168 by default SQL*Plus searches for the user profile (login.sql) in your current directory first, and then in the directories you specify with the ORACLE_PATH environment variable.
Please be aware that this change can be introduced with a PSU or a BP from 2017 as well.
Behavior since Oracle Database 12.2
Since Oracle Database 22.214.171.124 SQL*Plus will only search for the user profile (login.sql) in the directories you specify with the ORACLE_PATH environment variable on Linux (or SQLPATH on Windows). That means, you have a login.sql in your working directory – but it will be silently ignored unless you set explicitly ORACLE_PATH or SQLPATH to point to this directory. I’d just blindly guess that the same behavior change applies to SQLcl as well.
Users currently using a login.sql to customize a session will need to set the ORACLE_PATH variable accordingly, and move login.sql to the directory defined in ORACLE_PATH.
If that doesn’t work for you maybe using a prologue for scripts, including it explicitly with @@ calls would be a doable workaround.
On Windows please be aware of (credits to Tim Hall):
- Bug 25804573
SQL PLUS 12.2 NOT OBSERVING SQLPATH IN REGISTRY OR ENV VARIABLE FOR LOGIN.SQL
- MOS Note 2241021.1
SQL*Plus 126.96.36.199.0 Change in Behavior for Search Path of Login.sql
- Franck Pachot (dbi services):