oracle 常用SQL

创建索引

create index INDEX_FLOW_TRADENO on AC_T_FLOW (TRADE_NO)

 

 

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

posted on 2015-05-25 09:36  adolfmc  阅读(159)  评论(0编辑  收藏  举报