1、SQL> select MACHINE from v$session group by MACHINE;
localhost.localdomain
server20
server69
3 rows selected.
2、[oracle@db01 ~]$ netstat -ant|grep 1521|grep ESTABLISHED |awk '{print $5}' |awk -F: '{print $1}'|sort|uniq -c |sort -n
2 127.0.0.1
13 192.168.1.20
26 192.168.1.69
登陆到数据库中,使用下列sql语句查询连接到数据库的用户数:
select count(*) from v$session;