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

Home -> Community -> Usenet -> c.d.o.tools -> Re: PL/SQL: get ORACLE_SID?

Re: PL/SQL: get ORACLE_SID?

From: Markus Roeder <markus.roeder_at_gwi-ag.com>
Date: Mon, 18 Dec 2000 08:51:26 +0100
Message-ID: <3a3dc1fe@news.gwi-ag.com>

Hi Jan,

if you need the current username of the operating system - try something like

declare

   sOSUser varchar(64);
   ...
begin

   select osuser into sOSUser from v$session where audsid = userenv('sessionid');

   ...
end;
/

"Andrew Hardy" <Andrew.Hardy_at_AdvanticaTech.com> schrieb im Newsbeitrag news:91d7re$q5f$1_at_sun-cc204.lut.ac.uk...
> You could have a look at v$parameter - there's a db_name, service_names in
> there.
>
> Andy
> Jan Haase <jh_at_informationsdesign.de> wrote in message
> news:3A3A0356.35E6CE6C_at_informationsdesign.de...
> > Hi.
> >
> > In one of my scripts I need to check the username and ORACLE_SID to be
> sure that the following create table statements don't go into the wrong
> database.
> > Is there a possibility to get the value of these variables - or any
 environment variables in a pl/sql-script?
> >
> > Thanks in advance,
> > Jan
>
>
Received on Mon Dec 18 2000 - 01:51:26 CST

Original text of this message

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