小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

Informix 數(shù)據(jù)庫(kù)日常維護(hù)腳本...

 昵稱(chēng)90415 2009-02-24
Informix 數(shù)據(jù)庫(kù)日常維護(hù)腳本
 
作者:czw1413_cn  出處:Unix愛(ài)好者家園unix-cd.com  更新時(shí)間: 2005年12月16日 
為了提高日常維護(hù)IDS的效率,特提供以下腳本供大家參考。


檢查各個(gè)dbspaces的空間使用狀況:
select name dbspace,sum(chksize) allocated,sum(nfree) free,round(((sum(chksize)-sum(nfree))/sum(chksize))*100)||"%" pcused
form sysdbspaces d,syschunks c
where d.dbsnum=c.dbsnum group by name order by 4 desc
剩余空間肯定是越大越好了

顯示各個(gè)dbspaces的I/O狀況:
select d.name,fname path_name,sum(pagesread) diskreads,sum(pageswritten) diskwrites
from syschkio c,syschunks k,sysdbspaces d
where d.dbsnum=k.dbsnum and k.chknum=c.chunknum
group by 1,2 order by 3 desc
根據(jù)各個(gè)dbspaces的I/O來(lái)調(diào)整表的布局,使整個(gè)系統(tǒng)I/O均衡

檢查哪個(gè)表具有最多的磁盤(pán)I/0:
select dbsname, tabname, (isreads + pagreads) diskreads, (iswrites + pagwrites) diskwrites
from sysptprof
order by 3 desc,4 desc
同上。


檢查表的extent的分布狀況:
select t.tabname, count(*) num_ext
from sysextents e, npmdb:systables t
where e.tabname=t.tabname
and dbsname = "npmdb"
and t.tabname not like "sys%"
group by 1
having count(*) > 1
order by 2 desc
表的extent建議最大不超過(guò)30個(gè),如果太大,就需要重建表修改extent size的大小從而修改extent的數(shù)量

檢查表中索引的層數(shù)(越少越好):
select idxname, levels from sysindexes order by 2 desc

檢查命中率不高的索引(nrows和unique越接近越好):
select tabname, idxname, nrows, nunique
from systables t, sysindexes I
where t.tabid =i.tabid and t.tabid > 99
and nrows > 0 and nunique > 0 
當(dāng)索引的效率不高的時(shí)候,需要根據(jù)實(shí)際情況修改 
看數(shù)據(jù)庫(kù)里面那些表的碎片比較多(碎片小比較好)
select dbsname , tabname ,count(*), sum(size)
from sysextents
group by 1,2
order by 3 desc;

表和索引的讀寫(xiě)情況,(考查那個(gè)數(shù)據(jù)庫(kù)實(shí)體讀寫(xiě)比較多)
select dbsname, tabname, (isreads + pagreads) diskreads, (iswrites + pagwrites) 
diskwrites
from sysptprof
order by 3 desc, 4 desc

那些表的鎖競(jìng)爭(zhēng)比較厲害(越小越好)
select a.tabname,nrows,lockwts,deadlks
from sysmaster:sysptprof a,systables b
where a.tabname=b.tabname and lockwts>0 
and a.dbsname = 庫(kù)名
and b.tabid >= 100
order by tabname;

表的順序掃描數(shù)(OLTP系統(tǒng)的話(huà),大表的順序掃描數(shù)越小越好)
select a.tabname,nrows,seqscans
from sysmaster:sysptprof a,systables b
where a.tabname=b.tabname and seqscans>0 
and a.dbsname = '庫(kù)名'
and b.tabid>=100
order by tabname; 

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶(hù)發(fā)布,不代表本站觀(guān)點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶(hù) 評(píng)論公約

    類(lèi)似文章 更多