oracle 查询 主机名和对应的IP地址

 

--查询对应的IP地址

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

--查询对应的主机名、IP地址

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

 

posted @ 2018-05-03 18:17  钱若梨花落  阅读(2068)  评论(0编辑  收藏  举报