Oracle query host name and corresponding IP address

 

-- Query the corresponding IP address

select count(1), machine, a.CLIENT_INFO   from v$session a  group by machine, CLIENT_INFO;

--Query the corresponding host name and IP address

select distinct w.machine, a.CLIENT_INFO   from DBA_HIST_ACTIVE_SESS_HISTORY w, v$session a  where w.sql_exec_start >= sysdate - 30   

--and w.machine not in ('db2','db1')   

and a.MACHINE = w.machine

---或者    select distinct w.machine, a.CLIENT_INFO   from v$active_session_history w, v$session a  where w.sql_exec_start >= sysdate - 30   

--and w.machine not in ('db2','db1')   

and a.MACHINE = w.machine

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325212093&siteId=291194637