Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: What happens when I log on to SQLPlus
I'd be very hesitant to do SELECTs in the main glogin.sql file. But some
people do clever and useful things that are safe, like using it to change
the default SQL > prompt to,
say:
P1_at_SUN1> (if you have so many instances and servers you forget what you're logged into
or
SYSTEM_at_P1 > (if you have a knack for forgetting who you're logged in as)
I'm NOT fond of extreme cleverness like:
SYSTEM on P1_at_SUN1 on 5/1/2002 @ 5:45 >
Prompts that take up half the screen are not among my favorite things. Besides, how hard is it to do a ! and ask the host what time and date it is, or, wear a watch maybe?
But more seriously, only put minimal and globally useful things in the default, glogin file. It IS quite useful , for example, for DBA users to have a local file to do all those tedious SETs
like
SET LINESIZE
and COLUMN commands to shorten up things like USERNAME or OWNER or
OBJECT_NAME, etc, to shorter lengths, unless you have the bad luck to have
things in your database that are as long as Oracle allows you to make them.
(That's usually a sign you need more design reviews, to encourage your eager
beaver analysts that table names like
UNPAID_STATEMENTS_FOR_COATINGS_POLYMERS_DIVISION
isn't going to make them many friends in the DBA and development groups.)
RSH
"Anton Buijs" <aammbuijs_at_xs4all.nl> wrote in message
news:a9v2f7$9ta$1_at_news1.xs4all.nl...
> Ofcourse you can! There it's for.
> Do global settings that you want to apply for everybody in glogin.sql (the
> global login)
> Do you personal settings in a login.sql in a well choosen directory.
>
> Be carefull when doing selects in glogin.sql. Remember that glogin.sql
runs
> for every user that uses the sqlplus executable in that Oracle home. Don't
> do a select from views like v$database because only dba's have access. Do
a
> select from global_name if you want the database name in the prompt.
>
> Mostly people include "set" commands in the (g)login.sql like "set
linesize
> 132" or something like that.
>
> Pinaki <bpinaki123_at_indiatimes.com> schreef in berichtnieuws
> 96eccafc.0204211020.3799ad14_at_posting.google.com...
> > Hi,
> > Thanks for the replies...But can I edit the glogin.sql
> > file.Suppose I want to change the sql prompt(SQL>) to something
> > else.Not for the particular session(this I can can change from the
> > enviornment settings) but whenever I login through SQLPLus.
> >
> > Pinaki
> >
> >
> >
> >
> > "Anton Buijs" <aammbuijs_at_xs4all.nl> wrote in message
> news:<a9tu1k$eht$1_at_news1.xs4all.nl>...
> > > Indead, first $ORACLE_HOME/sqlplus/admin/glogin.sql is run.
> > > Then sqlplus looks for a file named login.sql in the current
directory.
> > > If it's not there it searches all directories listed in $ORACLE_PATH
> > > variable.
> > > The first login.sql file found is run.
> > >
> > > Same applies for Oracle on Windows NT: glogin.sql in the Oracle home
> > > sqlplus\admin dir
> > > Then the first login.sql file found in:
> > > a. the current dir (when you used the installed shortcut: the oracle
> home
> > > \bin subdirectory)
> > > b. if set the directories listed in the variable %SQLPATH%.
> > > c. the directories listed in registry key
> > > \\HKLM\Software\Oracle\HOME<n>\SQLPATH
> > >
> > > Use this variable or registry key to include the directories where you
> store
> > > your sql scripts in. Sqlplus will find them then regardless the
current
> > > directory from where it started.
> > >
> > >
> > > Pinaki <bpinaki123_at_indiatimes.com> schreef in berichtnieuws
> > > 96eccafc.0204201017.70a659a1_at_posting.google.com...
> > > > Hi,
> > > > I have a simple question to ask.Which script does Oracle
execute
> > > > when I click on the sqlplus icon(enter the username,password and
> > > > hoststring) and create a session with Oracle...
> > > >
> > > > Thanks,
> > > > Pinaki
>
>
Received on Mon Apr 22 2002 - 12:14:41 CDT
![]() |
![]() |