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: Ryan <rgaffuri_at_cox.net>
Date: Wed, 07 May 2003 01:31:09 GMT
Message-ID: <xlZta.30175$g41.2853149@news1.east.cox.net>

"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
>
>

make a script called connect.sql

in the script have the following

connect &1
@@glogin.sql

then when you connec to a new instance do:

@connect username/password

I use it all the time. Received on Tue May 06 2003 - 20:31:09 CDT

Original text of this message

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