Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: which server am I on?
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
In the following example the machine name is "pythia", the user name is "oracle". Note the prompt once SQL*Plus is invoked. Hope this helps....
[pythia:oracle]: cat $ORACLE_HOME/sqlplus/admin/glogin.sql
rem glogin.sql
rem
rem SQL*Plus global login startup file.
rem
rem This is the global login file for SQL*Plus.
rem Add any sqlplus commands here that are to be
rem executed when a user invokes sqlplus
rem
set termout off
column glogin_prompt noprint new_value _glogin_prompt
select substr(program,instr(program,'@')+1,instr(program,' ')-instr(program,'@')-1)||':'||value glogin_prompt
from v$parameter,v$process where program like '%SMON%' and name='db_name';
set sqlprompt 'SQL@&_glogin_prompt> '
set termout on
[pythia:oracle]: sqlplus /
SQL*Plus: Release 3.2.3.0.0 - Production on Thu Dec 19 08:37:15 1996
---snip---
SQL_at_pythia:jmp> exit
[pythia:oracle]:
-- \\|// (0-0) +-----oOO----(_)-----------+ | Brian P. Mac Lean | | Database Analyst | | brian.maclean_at_teldta.com | | http://www.teldta.com | +-------------------oOO----+ |__|__| || || ooO OooReceived on Thu Dec 19 1996 - 00:00:00 CST
![]() |
![]() |