Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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

C:\users\myname

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
SET TERMOUT OFF
SELECT LOWER(USER) || '@' || global_name||CHR(10)||'SQL> ' AS global_name
FROM   global_name;
SET SQLPROMPT '&gname'
SET TERMOUT ON;
share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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

SQLPATH=C:\users\myname

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

share|improve this answer
    
could you clarify where this needs to be added? –  Aaron Bertrand May 23 at 16:36
    
@AaronBertrand: I added a link to the Microsoft knowledge base –  a_horse_with_no_name May 23 at 16:43
    
Thanks! A different user posted an answer asking about it - and they didn't have enough rep to comment. Cheers. –  Aaron Bertrand May 23 at 16:47
    
@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 –  a_horse_with_no_name May 23 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... –  Aaron Bertrand May 23 at 16:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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