oracle 维护检查SQL
1 锁表
select p.spid,c.object_name,b.session_id,b.oracle_username,b.os_user_name from v$process p,v$session a, v$locked_object b,all_objects c where p.addr=a.paddr and a.process=b.process and c.object_id=b.object_id ;
分组
select c.object_name,b.oracle_username,b.os_user_name from v$process p,v$session a, v$locked_object b,all_objects c where p.addr=a.paddr and a.process=b.process and c.object_id=b.object_id group by c.object_name,b.oracle_username,b.os_user_name ;
2 连接数
select count(*) from v$session;
select username,count(username) from v$session where username is not null group by username;
资源
http://www.cnblogs.com/vipsoft/archive/2012/05/23/2514374.html