Chinaunix首页 | 论坛 | 博客
  • 博客访问: 248375
  • 博文数量: 53
  • 博客积分: 1585
  • 博客等级: 上尉
  • 技术积分: 690
  • 用 户 组: 普通用户
  • 注册时间: 2005-03-14 11:16
个人简介

basecn@163.com

文章分类

全部博文(53)

文章存档

2013年(1)

2012年(2)

2011年(4)

2009年(41)

2008年(5)

我的朋友

分类: 数据库开发技术

2009-09-16 17:14:59

 
统计服务线程状态、
select type, state, count(*) from v$service_thread group by type, state;
 
 
查看终端会话
select comm_name, count(*) from v$session group by comm_name order by 1 desc;
 
查看阻塞会话
select a.comm_name Client_IP, client_pid Client_Pid from v$session a , v$service_thread b where a.SERVICE_THREAD_ID=b.id and b.type='DEDICATED';
 
查找前5个用时最多的SQL
select query, total_time from v$statement order by 2 desc limit 5;
 
查看线程配置
select name, value1 from v$property where name like 'MULTIPLEXING%';
 
查看复制阻塞的情况
v$repgap
 
查看数据库内存分配情况
select MEM_ALLOC_PAGE_COUNT , MEM_FREE_PAGE_COUNT  from v$database;
 
查看内存数据库总的分配大小
select sum(alloc_size) from v$memstat;
 
查看表占用的空间
select a.name, b.TABLE_NAME ,d.fixed_alloc_mem+d.var_alloc_mem MEM_ALLOC_SIZE ,
       d.fixed_used_mem+d.var_used_mem USED_SIZE
  from x$tablespaces a, system_.SYS_TABLES_ b, X$TABLE_INFO c ,V$MEMTBL_INFO d
 where b.TABLE_OID=c.TABLE_OID and c.TABLESPACE_ID=a.ID and d.TABLE_OID=c.TABLE_OID
   and b.table_name not like 'SYS_%' and b.table_name not like 'NEXT_%'
 order by a.name desc , b.table_name asc;
 
语句锁
v$lock, v$lock_statement, v$lock_wait
阅读(1314) | 评论(0) | 转发(0) |
0

上一篇:事务teanscation ACID属性

下一篇:AB

给主人留下些什么吧!~~