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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Making database name part of SQL prompt in sqlplus

RE: Making database name part of SQL prompt in sqlplus

From: Shawn Ferris <Shawn.Ferris_at_twtelecom.com>
Date: Thu, 6 Jul 2000 14:02:59 -0600
Message-Id: <10550.111370@fatcity.com>


Add the lines:

set termout off
column name new_value _dbname
select name
from v$database ;
set sqlprompt '&_dbname.> '
set termout on

To glogin.sql in $ORACLE_HOME/sqlplus/admin

This solution wont span reconnects..

OLDDB> connect user/password_at_new_database

..once connected in sqlplus. Nor does it play particularly well with the /nolog option.

HTH
Shawn M Ferris
Oracle DBA - Time Warner Telecom

> -----Original Message-----
> From: Jay Weinshenker [mailto:jweinshe_at_concentric.net]
> Sent: Thursday, July 06, 2000 11:56 AM
> To: ORACLE-L_at_fatcity.com; oracledba_at_quickDOC.co.uk
> Subject: Making database name part of SQL prompt in sqlplus
>
>
> Anyone know how to do it?
>
> I've got a number of users doing SQL*Plus work and they keep
> making errors
> as to which instance they are in...
>
> Anyone?
>
> J
>
>
> --------
> If you're bored, then visit the list's website:
> http://www.lazydba.com (updated daily)
> to unsubscribe, send a blank email to
> oracledba-unsubscribe_at_quickdoc.co.uk
> to subscribe send a blank email to oracledba-subscribe_at_quickdoc.co.uk
Received on Thu Jul 06 2000 - 15:02:59 CDT

Original text of this message

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