0
点赞
收藏
分享

微信扫一扫

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

盖码范 2022-07-18 阅读 24

 

--查询对应的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

 

日积月累



举报

相关推荐

0 条评论