Oracle will also look in the starting directory (where you launch SQL*Plus) for login.sql. As mentioned, you can set global login parameters in glogin.sql. When you start SQL*Plus, the environment variables that were in existence when you started stay in existence for that window. You can host out (>! UNIX command or >host UNIX command or simply >host) to do something in your shell window. However, you cannot effect a change with respect to environment variables in your SQL*Plus session.
Originally posted by marist89 If we want to be 100% correct, we'd say "sqlplus looks for .login in your $SQLPATH".
If login.sql is in the directory where you invoke the command, it will run, and that is without setting the SQLPATH variable. If you want login.sql to run from anywhere, SQLPATH variable, like the PATH variable, will do the trick.