Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: which server am I on?
lesliet_at_u.washington.edu (L. Tseng) wrote:
>Is there an easy way to tell what server your are on in a SQL*Plus
>session? How about the way to show the database/instance for the
>session? I found myself frequently confused over having serveral
>sql*plus sessions connecting to different Oracle servers (local,remote)
>and instances.
>
>Thanks,
>
>Leslie
>
One source of the data is: "select name from v$database;"
A login.sql file is always executed when you connect to sqlplus, if the login.sql file exists (also
look into the glogin.sql file).
Try putting the following in a login.sql file in your current directory (or use SQLPATH environment
variable to set a search list of directories for login.sql):
REM ************************************************************** REM * login.sql * REM **************************************************************set termout off
set SQLPROMPT '&_DB_NAME.> '
clear breaks
set termout on
set feedback on
When using this, keep in mind that, within the SQL*Plus session, if you subsequently connect to another Oracle instance (via connect user/pass_at_instance), the prompt will not get updated!.
Steve Tahmosh
State Street Bank
Received on Thu Dec 19 1996 - 00:00:00 CST
![]() |
![]() |