Erp100论坛's Archiver

xiangzhao 发表于 2008-7-9 12:52

Oracle性能调优实践中的几点心得

[font=Arial][size=9pt][font=宋体]很多的时侯,做[/font][/size][/font][font=Arial][size=9pt]Oracle DBA[/size][/font][font=Arial][size=9pt][font=宋体]的我们,当应用管理员向我们通告现在应用很慢、数据库很慢的时侯,我们到数据库时做几个示例的[/font][/size][/font][font=Arial][size=9pt]Select[/size][/font][font=Arial][size=9pt][font=宋体]也发现同样的问题时,有些时侯我们会无从下手,因为我们认为数据库的各种命种率都是满足[/font][/size][/font][font=Arial][size=9pt]Oracle[/size][/font][font=Arial][size=9pt][font=宋体]文档的建议。实际上如今的优化己经向优化等待[/font][/size][/font][font=Arial][size=9pt](waits)[/size][/font][font=Arial][size=9pt][font=宋体]转型了,实际中性能优化最根本的出现点也都集中在[/font][/size][/font][font=Arial][size=9pt]IO[/size][/font][font=Arial][size=9pt][font=宋体],这是影响性能最主要的方面,由系统中的等待去发现[/font][/size][/font][font=Arial][size=9pt]Oracle[/size][/font][font=Arial][size=9pt][font=宋体]库中的不足、操作系统某些资源利用的不合理是一个比较好的办法,下面把我的一点实践经验与大家分享一下,本文测重于[/font][/size][/font][font=Arial][size=9pt]Unix[/size][/font][font=宋体][font=Arial][size=9pt]环境。[/size][/font][font=Arial][size=9pt][/size][/font][/font]
[font=Arial][size=9pt][font=宋体]一、通过操作系统的一些工具检查系统的状态,比如[/font][/size][/font][font=Arial][size=9pt]CPU[/size][/font][font=Arial][size=9pt][font=宋体]、内存、交换、磁盘的利用率,根据经验或与系统正常时的状态相比对,有时系统表面上看起来看空闲这也可能不是一个正常的状态,因为[/font][/size][/font][font=Arial][size=9pt]cpu[/size][/font][font=Arial][size=9pt][font=宋体]可能正等待[/font][/size][/font][font=Arial][size=9pt]IO[/size][/font][font=Arial][size=9pt][font=宋体]的完成。除此之外我们还应观注那些占用系统资源[/font][/size][/font][font=Arial][size=9pt](cpu[/size][/font][font=Arial][size=9pt][font=宋体]、内存[/font][/size][/font][font=Arial][size=9pt])[/size][/font][font=宋体][font=Arial][size=9pt]的进程。[/size][/font][font=Arial][size=9pt][/size][/font][/font]
[font=Arial][size=9pt]1[/size][/font][font=Arial][size=9pt][font=宋体]、如何检查操作系统是否存在[/font][/size][/font][font=Arial][size=9pt]IO[/size][/font][font=Arial][size=9pt][font=宋体]的问题?使用的工具有[/font][/size][/font][font=Arial][size=9pt]sar,[/size][/font][font=Arial][size=9pt][font=宋体]这是一个比较通用的工具。[/font][/size][/font][font=Arial][size=9pt]
  Rp1#Sar -u 2 10
  [/size][/font][font=Arial][size=9pt][font=宋体]即每隔[/font][/size][/font][font=Arial][size=9pt]2[/size][/font][font=Arial][size=9pt][font=宋体]秒检察一次,共执行[/font][/size][/font][font=Arial][size=9pt]20[/size][/font][font=Arial][size=9pt][font=宋体]次,当然这些都由你决定了。[/font][/size][/font]
[font=Arial][size=9pt][font=宋体]示例返回:[/font][/size][/font][font=Arial][size=9pt]
  HP-UX hpn2 B.11.00 U 9000/800    08/05/03
  18:26:32    %usr    %sys    %wio   %idle
  18:26:34      80       9      12       0
  18:26:36      78      11      11       0
  18:26:38      78       9      13       1
  18:26:40      81      10       9       1
  18:26:42      75      10      14       0
  18:26:44      76       8      15       0
  18:26:46      80       9      10       1
  18:26:48      78      11      11       0
  18:26:50      79      10      10       0
  18:26:52      81      10       9       0[/size][/font]
[font=Arial][size=9pt]  Average       79      10      11       0[/size][/font]

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2007 Comsenz Inc.