|
|
|
Re: Oracle server address [message #620242 is a reply to message #620241] |
Wed, 30 July 2014 10:10 |
Lalit Kumar B
Messages: 3174 Registered: May 2013 Location: World Wide on the Web
|
Senior Member |
|
|
Ah, BS posted too, so I can't add more to the same post with edit.
@OP, perhaps you got confused when Burleson says "local IP address". So what local here means, client or server? Is that what you are in doubt with?
P.S. : To avoid getting confused further, stop believing what you see in that site. The surprising fact is, Burleson's site mostly comes up first in google search.
[Updated on: Wed, 30 July 2014 10:13] Report message to a moderator
|
|
|
|
Re: Oracle server address [message #620244 is a reply to message #620239] |
Wed, 30 July 2014 11:48 |
Solomon Yakobson
Messages: 3273 Registered: January 2010 Location: Connecticut, USA
|
Senior Member |
|
|
andrewscharles89 wrote on Wed, 30 July 2014 10:47SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM dual;
This would give the IP address of the client machine.
Not entirely true. Only if client session is connected via tcpip. We will not get client IP address if client is connected, for example, locally or via named pipe:
C:\>set ORACLE_SID=ORCL
C:\>sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 30 11:58:34 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM dual;
SYS_CONTEXT('USERENV','IP_ADDRESS')
--------------------------------------------------------------------------------
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\>sqlplus scott@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=NMP)(SERVER=localhost)(PIPE=ORAPIPE)))(CONNECT_DATA=(SID=ORCL)))/tiger
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 30 11:58:49 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM dual;
SYS_CONTEXT('USERENV','IP_ADDRESS')
--------------------------------------------------------------------------------
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Pr
oduction
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\>sqlplus scott@orcl/tiger
SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 30 11:59:00 2014
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> SELECT SYS_CONTEXT('USERENV','IP_ADDRESS') FROM dual;
SYS_CONTEXT('USERENV','IP_ADDRESS')
--------------------------------------------------------------------------------
127.0.0.1
SQL>
SY.
|
|
|