I installed Oracle 10g XE on my Windows Server 2008 R2. Now I would like to configure SQL Plus to use login.sql for login settings. I created a login.sql file and put it into a


folder, but it does not seem to work. Where should I put this configuration file in Windows environment? My login.sql file is as follows:

SET pagesize 2000
SET LONG 10000
SET linesize 1000
COLUMN last_name format a20
COLUMN total format 999,999,999
SET feedback ON
alter session set nls_date_format = 'yyyy-mm-dd hh:mi:ssPM'
COLUMN global_name new_value gname
SELECT LOWER(USER) || '@' || global_name||CHR(10)||'SQL> ' AS global_name
FROM   global_name;

You need to set the environment variable SQLPATH (through the Control Panel) to tell SQL*Plus where to find the file:


Setting environment variables is explained here: http://support.microsoft.com/kb/310519/en-us

  • could you clarify where this needs to be added? May 23 '14 at 16:36
  • @AaronBertrand: I added a link to the Microsoft knowledge base May 23 '14 at 16:43
  • Thanks! A different user posted an answer asking about it - and they didn't have enough rep to comment. Cheers. May 23 '14 at 16:47
  • 1
    @AaronBertrand: to be honest: that link shows up as the first or second when searching for it. It's hard to believe someone can't find it by himself. It seems despite all popularity of Google and Co, searching for answers is a dying skill May 23 '14 at 16:58
  • True, but you could pick any random question on the site and with a good measure of accuracy say the same thing... May 23 '14 at 16:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.