Home » RDBMS Server » Server Administration » IP address
IP address [message #299939] Wed, 13 February 2008 15:46 Go to next message
uicmxz
Messages: 48
Registered: July 2006
Member
Is it possible to get the IP address for the user login in Oracle?
Re: IP address [message #300028 is a reply to message #299939] Thu, 14 February 2008 01:02 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Yes, use SYS_CONTEXT for current session.

Regards
Michel
Re: IP address [message #300078 is a reply to message #300028] Thu, 14 February 2008 03:23 Go to previous messageGo to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
Quote:

SELECT SYS_CONTEXT ('USERENV', 'CURRENT_USER'),
SYS_CONTEXT ('USERENV', 'OS_USER'),
SYS_CONTEXT ('USERENV', 'HOST'),
SYS_CONTEXT ('USERENV', 'CURRENT_SCHEMA'),
SYS_CONTEXT ('USERENV', 'IP_ADDRESS')
FROM DUAL;


Re: IP address [message #300080 is a reply to message #300078] Thu, 14 February 2008 03:27 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
And what does this add to my previous post?

Regards
Michel
Re: IP address [message #300086 is a reply to message #300080] Thu, 14 February 2008 03:34 Go to previous messageGo to next message
Rafeek
Messages: 159
Registered: April 2007
Location: egypt
Senior Member
sorry i donet read your post
rafeek
Re: IP address [message #300468 is a reply to message #300078] Fri, 15 February 2008 09:15 Go to previous messageGo to next message
uicmxz
Messages: 48
Registered: July 2006
Member
How can I get IP addresses for all active sessions (all users connected to database)?
Re: IP address [message #300470 is a reply to message #300468] Fri, 15 February 2008 09:25 Go to previous messageGo to next message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
select sid, machine, utl_inaddr.get_host_address(machine) ip 
from v$session 
where type='USER' and username is not null 
/ 

Regards
Michel
Re: IP address [message #300490 is a reply to message #300470] Fri, 15 February 2008 11:54 Go to previous messageGo to next message
uicmxz
Messages: 48
Registered: July 2006
Member
Do I need to be connected as sysdba user to be able to run this query?
Re: IP address [message #300492 is a reply to message #300490] Fri, 15 February 2008 11:56 Go to previous message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You need select privilege on v$session and execute privilege on utl_inaddr.

You NEVER use SYSDBA to query.
Give appropriate privileges to users.

Regards
Michel
Previous Topic: Udump Error Defination
Next Topic: Installing oracle automatic
Goto Forum:
  


Current Time: Fri Dec 09 13:39:22 CST 2016

Total time taken to generate the page: 0.50758 seconds