sqlplus's login.sql
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: sqlplus's login.sql

  1. #1
    Join Date
    Sep 2005
    Posts
    8

    Question sqlplus's login.sql

    I have followed Tom's Expert One on One Oracle to configure my sqlplus, I composed a file called login.sql which contains:
    set serveroutput on size 1000000

    set trimspool on
    set long 5000
    set linesize 100
    set pagesize 9999
    column plan_plus_exp format a80

    column global_name new_value gname
    set termout off
    select lower(user) || '@' ||
    decode(global_name, 'ORACLE10.WORLD', '10.0', 'ORA10g.WORLD',
    '10g', global_name ) global_name from global_name;
    set sqlprompt '&gname> '
    set termout on

    and then I start sqlplus, it worked well yesterday, but today the login.sql seems never been executed, because when I input the command ‘show serveroutput', it always tells me ’serveroutput off'

    my database is Oracle 10g and my OS is Windows XP SP2

    Thanks for any clue.

  2. #2
    Join Date
    Sep 2005
    Posts
    8
    And if I append the script into the file glogin.sql, then things seem to work properly. Why sqlplus do not execute login.sql? In the Oracle document it says:
    Previously, the SQL*Plus site and user profile files, glogin and login, were run when SQL*Plus was started with a username and password, or with /NOLOG. The profile files, glogin and login are now also run after successful CONNECT commands.

  3. #3
    Join Date
    Sep 2005
    Posts
    8
    I have solved the problem. It's just because that when sqlplus start, it only check the current directory to see if there is a login.sql, so if I first switch the directory into the one where login.sql reside, it will then work properly!

  4. #4
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    Nice job figuring this one out...
    "I do not fear computers. I fear the lack of them." Isaac Asimov
    Oracle Scirpts DBA's need

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width