Monday, October 12, 2009

get IP address in oracle

1. get ip address from database User basis

SELECT sid, machine,utl_inaddr.get_host_address(SUBSTR(machine,INSTR(machine,'\')+)) ip
FROM gv$session
WHERE type = 'USER'
AND username IS NOT NULL;


2. give Host name, get IP address
=================================

SELECT utl_inaddr.get_host_address('ADMINISTRATOR')
FROM dual;

3. give ip, get host_name address
=================================

SELECT utl_inaddr.get_host_name('10.11.1.105')

No comments: