免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
1234下一页
最近访问板块 发新帖
查看: 21677 | 回复: 36

Informix数据库日常维护脚本 [复制链接]

论坛徽章:
0
发表于 2005-12-12 14:16 |显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
发表于 2005-12-12 16:31 |显示全部楼层
学习下!

论坛徽章:
0
发表于 2005-12-12 17:16 |显示全部楼层
我也贴两个我常用的脚本
看数据库里面那些表的碎片比较多(碎片小比较好)
select dbsname , tabname ,count(*), sum(size)
from sysextents
group by 1,2
order by 3 desc;

表和索引的读写情况,(考查那个数据库实体读写比较多)
select dbsname, tabname, (isreads + pagreads) diskreads, (iswrites + pagwrites)
diskwrites
from sysptprof
order by 3 desc, 4 desc

那些表的锁竞争比较厉害(越小越好)
select a.tabname,nrows,lockwts,deadlks
from sysmaster:sysptprof a,systables b
where a.tabname=b.tabname and lockwts>0
and a.dbsname = 库名
and b.tabid >= 100
order by tabname;

表的顺序扫描数(OLTP系统的话,大表的顺序扫描数越小越好)
select a.tabname,nrows,seqscans
from sysmaster:sysptprof a,systables b
where a.tabname=b.tabname and seqscans>0
and a.dbsname = '库名'
and b.tabid>=100
order by tabname;

论坛徽章:
0
发表于 2005-12-12 22:28 |显示全部楼层
好,学习

论坛徽章:
0
发表于 2005-12-13 02:15 |显示全部楼层

回复 1楼 czw1413_cn 的帖子

Good job. Thanks for your cooperation.

论坛徽章:
0
发表于 2005-12-15 19:32 |显示全部楼层
好东西,建议斑竹置顶,大家有好的都放上去!

论坛徽章:
0
发表于 2005-12-20 09:29 |显示全部楼层
谢谢楼主和2楼,真的很有用。
春风 该用户已被删除
发表于 2005-12-30 08:03 |显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
发表于 2006-01-04 15:07 |显示全部楼层
顶一下,不错,要好好学习

论坛徽章:
0
发表于 2006-01-10 10:21 |显示全部楼层
xiao习,xiao习!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP