---
title: "（转）oracle 查看数据库连接备忘"
author: "mlxia"
date: "2010-08-19T15:28:39Z"
tags: []
categories: ["数据库"]
slug: "oracle"
draft: false
lastmod: "2010-08-19T15:28:39Z"
id: 741229
url: "https://mlxia.iteye.com/blog/741229"
---

[http://yezi.iteye.com/blog/127210](http://yezi.iteye.com/blog/127210)

2007-09-26

### [oracle 查看数据库连接备忘](http://yezi.iteye.com/blog/127210)

关键字: 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;