Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: instance_name as unprivileged user
sybrandb_at_yahoo.com wrote:
> according to the 9i docs this
>
> select sys_context('USERENV','DB_NAME') FROM DUAL
>
> should work, and it actually does.
>
>
> You could also in PL/sql use
>
> declare
> str_len number;
> str varchar2(30);
> begin
> dbms_utility.get_parameter_value('db_name', str_len, str);
> end;
> /
> or select * from global_name
>
> etc, etc,etc
>
>
> Hth
Just being picky here but Oracle has deprecated USERENV and recommends using, instead, SYS_CONTEXT. The query would be either:
SELECT sys_context('USERENV', 'INSTANCE') FROM dual;
or
SELECT sys_context('USERENV', 'INSTANCE_NAME') FROM dual;
-- Daniel A. Morgan http://www.psoug.org damorgan_at_x.washington.edu (replace x with u to respond)Received on Wed Dec 21 2005 - 11:46:19 CST