- 论坛徽章:
- 1
|
如何查看各个session或thread占用的系统资源,如CPU,I/O等
偶给你个脚本
你区执行一下,显示的是准确的统计信息。
- dbaccess - -<<! 1>;chkiosum.out
- database sysmaster;
- select
- name dbspace,
- chknum,
- "Primary" chktype,
- reads,
- writes,
- pagesread,
- pageswritten
- from syschktab c, sysdbstab d
- where c.dbsnum = d.dbsnum
- union all
- select
- name[1,10] dbspace,
- chknum,
- "Mirror" chktype,
- reads,
- writes,
- pagesread,
- pageswritten
- from syschktab c,sysdbstab d
- where c.dbsnum = d.dbsnum
- into temp A;
- select
- sum(reads) total_reads,
- sum(writes) total_writes,
- sum(pagesread) total_pgreads,
- sum(pageswritten) total_pgwrites
- from A
- into temp B;
- select
- dbspace,
- chknum,
- chktype,
- reads,
- writes,
- pagesread,
- pageswritten,
- round((reads/total_reads)*100,2 ) percent_reads,
- round((writes/total_writes)*100,2 ) percent_writes,
- round((pagesread/total_pgreads)*100,2 ) percent_pgreads,
- round((pageswritten/total_pgwrites)*100,2 ) percent_pgwrites
- from A,B
- order by 11;
- !
复制代码 |
|