2 Replies Latest reply: Jan 17, 2013 8:04 AM by 985498 RSS

    InstantClient's SQL*Plus and glogin.sql

      SQL*Plus default behaviour is to
      a) load login.sql from current directory
      b) if failed, load glogin.sql from the +$ORACLE_HOME/sqlplus/admin/+ directory

      Support note describes the same behaviour for InstantClient (10g) in +Glogin.sql is Not Used with Instant Client [ID 946528.1]+ too.

      The solution for 10g InstantClient is simple. Define +$ORACLE_HOME+ variable, point it to your instantclient directory and create path and file "+../sqlplus/admin/glogin.sql+".

      However, this now seem to have changed with InstantClient 11g. This is what the client does:
      stat64("login.sql", 0xbf9f2c14)         = -1 ENOENT (No such file or directory)
      brk(0x856e000)                          = 0x856e000
      stat64("glogin.sql", 0xbf9f2c14)        = -1 ENOENT (No such file or directory)
      It looks for login.sql in the current directory - as expected. But now it also looks for glogin.sql in the current directory - and no longer in a common/shared directory like +$ORACLE_HOME/sqlplus/admin/+.

      Which is just plain silly IMO - as why make glogin.sql now behave the same as login.sql ? Expecting it to be in the current work directory? What is "global" about that and being forced to have a glogin.sql in every single directory you have on your client, from which you run SQL*Plus?

      The correct behaviour should be to determine the directory of the module (i.e. instantclient dir from which sqlplus was executed) and then look for glogin.sql in it.

      Am I missing something here? Can the old behaviour be enforced somehow? Or is there a workaround that can be used?