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: Displaying DB name at SQLPlus prompt- even after conn/disc, and not SYS user ?

Re: Displaying DB name at SQLPlus prompt- even after conn/disc, and not SYS user ?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 6 May 2003 21:14:58 +0200
Message-ID: <vbg33as1gb2115@corp.supernews.com>

"Thomas T" <T_at_T> wrote in message news:3eb7eed4$1_at_rutgers.edu...
> So there's this trick:
>
> column my_db new_value my_db noprint
> select user || '@' || name "my_db" from v$database;
> set sqlprompt "&my_db> "
>
> But... when I'm flipping between oracle servers, using disconnect and
> connect, is there a way that this can change, too? I don't want to have
to
> exit sql*plus between connections just so the above script can run. Also,
> how can I make this work if I'm -not- using the sys account? Do I need to
> grant select access on v$database- and isn't that a "bad" thing? :)
>
> And while I'm compiling this wish list; can I get the local service name,
> instead of the database name, out of Oracle? I searched the web, but I'm
> getting tons of links that talk about o/s command prompts, and system
> services...
>
> Thanks!
>
> -Thomas
>
>

All users have access to global_name(s). No need at all to use v$database.

-- 
Sybrand Bakker
Senior Oracle DBA

to reply remove '-verwijderdit' from my e-mail address
Received on Tue May 06 2003 - 14:14:58 CDT

Original text of this message

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