Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: UNIX-like prompt in SQL*PLUS

Re: UNIX-like prompt in SQL*PLUS

From: John P. Higgins <jh33378nospam_at_deere.com>
Date: 1997/09/28
Message-ID: <342EB731.1799@deere.com>#1/1

Here is a login.sql script that I use:

set pause off

set pause ".....................   MORE"
set pagesize 24
set linesize 132
set timing on
set underline off
set echo off
set null ^
set termout off
column today new_value _date
select to_char(sysdate, 'MON DD YYYY') today from sys.dual; column DatabaseName new_value _dbn
select value DatabaseName from v$parameter where name ='db_name'; column SessionOwner new_value _usr
select distinct username SessionOwner from user_sys_privs   where username <> 'PUBLIC';
set termout on
prompt "Database SID is &_dbn"
prompt "User is &_usr"
set sqlprompt "&_dbn..&_usr ===> "
set pause on

Thomas.Meyer wrote:
>
> Dear oraculars,
>
> I sometimes get confused when I have several SQL*PLUS sessions open,
> some connected to different instances on one host, some connected to a
> specific SQL*NET service.
>
> I would like to have the database/service that I'm connected to displayed in the SQL*PLUS prompt, like having the UNIX host name displayed in, say, the ksh prompt.
>
> Do you see a way of bringing the output of "select * from global_name" into the SQL*PROMPT, ideally whenever I do a new "connect"?
>
> When answering, please do a "CC" to Thomas.Meyer_at_dla-marbach.de
>
> Regards,
>
> --
>
> Thomas Meyer, EDV-Systemadministrator
> email: Thomas.Meyer_at_dla-marbach.de
> smail: Deutsches Literaturarchiv Marbach
> Schillerhoehe 8-10
> D-71672 Marbach
> Telefon: +49-7144-848-141
> Fax: ...-387
> WWW: http://www.dla-marbach.de
 

-- 
John P. Higgins      Voice:    (309)765-7868
Deere & Company      Fax:      (309)765-7800
John Deere Road      Internet: jh33378nospam_at_deere.com
Moline, IL 61265     Opinions: My Own
Received on Sun Sep 28 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US