Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: which db
"marc bautis" <bautisma_at_bigfoot.com> wrote in message
news:8l4qnh$20d$1_at_nnrp1.deja.com...
> using sqlplus on unix is there a command or a view i can query that
> will tell me which database i am in
>
> thanks,
> marc
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
I have this in my login.sql file:
set pause off
set termout off
column the_db_name new_value the_db_name
select
substr(substr(global_name,1,100),1,instr(substr(global_name,1,100),'.')-1)
the_db_name
from global_name;
select lower(username)||'@&the_db_name' the_db_name from user_users;
set sqlp "&the_db_name.> "
Every time I connect to a database using SQL*Plus, the prompt is changed
from
SQL>
to
andrew_at_SID>
so I know what I am connected to. I set this up after accidently truncating
half a production database when I thought I was connected to the test
database, but that is another story and a long time ago.
Regards
Andrew
Received on Fri Jul 21 2000 - 00:00:00 CDT