Re: why does this guy use dual?

From: BicycleRepairman <engel.kevin_at_gmail.com>
Date: Fri, 28 Jan 2011 04:36:04 -0800 (PST)
Message-ID: <3b1bd85f-c146-437f-9570-4c8b5572c93c_at_e9g2000vbi.googlegroups.com>



On Jan 27, 8:29 pm, John Hurley <hurleyjo..._at_yahoo.com> wrote:
> Joel:
>
> #http://www.oracleobserver.com/?q=node/28seemsto have an unnecessary
> use of dual, or am I missing something?
>
> A new hire to a certain unnamed consulting group?

That's my vote. Since PUBLIC access to UTL_TCP is a 'critical' security policy finding, and access to V$INSTANCE requires additional privileges, why not do it the simple way that anyone with CREATE SESSION can use?
create user test identified by test;
grant create session to test;
connect test/test_at_alias
select sys_context('userenv','server_host') host, sys_context('userenv','instance_name') instance_name, sys_context('userenv','ip_address') ip_address from dual;

HOST                           INSTANCE_NAME
IP_ADDRESS
------------------------------ ------------------------------
----------------
laptop-1005596                 orcl

10.10.10.10

I know, it's a lot more typing! Received on Fri Jan 28 2011 - 06:36:04 CST

Original text of this message