I have to question Oracle’s quality control sometimes. Back in the 90’s I remember being shipped an Oracle RDBMS CD that wouldn’t install in the user specified directory. Now we have 12cR2 that won’t run the login.sql in the SQLPATH, which was obvious immediately. At first I wondered if it was intentional, but it seemed such a daft thing to introduce.
Doc 2241021.1 says
From 18.104.22.168.0, SQL*Plus will only search for the User Profile in the directories you specify with the ORACLE_PATH environment variable on Linux and SQLPATH on Windows.
Okay, so it was intentional on Linux, but unintentional on Windows. Why try to make the behaviour different between Windows and Linux?!
There is a hidden bug for %SQLPATH%\login.sql being ignored on Windows.
Bug 25804573 : SQL PLUS 12.2 NOT OBSERVING SQLPATH IN REGISTRY OR ENV VARIABLE FOR LOGIN.SQL.
UPDATE: The patch is now available, and works for the initial session. However after each subsequent CONNECT statement, I get the error:
SP2-0310: unable to open file “LOGIN.SQL”
Oracle Support confirmed this limitation and say the proper fix is due in 18c.
Alternatively, one can work around it by specifying the login.sql explicitly, (ideally in a script eg S+.BAT), ie:
sqlplus / as sysdba @login