oracle 查看数据库连接备忘
Java代码
1. select count(*) from v$session where username is not null order by machine;
2. select * from v$session where username is not null order by machine;
3. select count(*) from v$session where username is not null and machine='test1' order by machine ;
4. select count(*) from v$session where username is not null and machine='localhost.localdomain' order by machine ;
5. select * from v$process where username is not null ;
6. select * from V$SHARED_SERVER_MONITOR ;
7. SELECT * FROM v$open_cursor;
8. SELECT sql_text,COUNT(*) FROM v$sql s , v$session se WHERE se.prev_hash_value =s.hash_value GROUP BY sql_text;