{"id":373,"date":"2026-01-26T07:29:49","date_gmt":"2026-01-26T07:29:49","guid":{"rendered":"https:\/\/blog.gpst.net.cn:4008\/?p=373"},"modified":"2026-01-28T06:24:13","modified_gmt":"2026-01-28T06:24:13","slug":"oracle%e8%bf%90%e7%bb%b4-%e6%9f%a5%e7%9c%8b%e5%90%84%e7%a7%8d%e5%91%bd%e4%b8%ad%e7%8e%87%e5%92%8c%e6%80%a7%e8%83%bd%e7%bb%9f%e8%ae%a1%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/opshub.com.cn\/?p=373","title":{"rendered":"oracle\u8fd0\u7ef4\u2014\u2014\u67e5\u770b\u5404\u79cd\u547d\u4e2d\u7387\u548c\u6027\u80fd\u7edf\u8ba1\u6570\u636e"},"content":{"rendered":"\n<p>1.buffer \u547d\u4e2d\u7387:select round((1-(physical.value-direct.value-lobs.value)\/logical.value)*100,2) &#8220;buffer cache hit ratio&#8221; from v$sysstat physical,v$systat direct,v$sysstat lobs,v$sysstat logical where physical.name=&#8217;physical reads&#8217; and direct.name=&#8217;physical reads direct&#8217; and lobs.name=&#8217;physical reads direct (lob)&#8217; and logical.name=&#8217;session logical reads&#8217;;<\/p>\n\n\n\n<p>buffer\u547d\u4e2d\u7387\u7684\u6b63\u5e38\u6307\u6807\u4e3a90%-100%\uff0c\u4f46\u5728\u6570\u636e\u5e93\u7e41\u5fd9\u8fd0\u884c\u671f\u95f4\u6709\u53ef\u80fd\u4f4e\u4e8e90%\u3002<\/p>\n\n\n\n<p>2.library\u547d\u4e2d\u7387:select round(sum(pins-reloads)\/sum(pins)*100,2) &#8220;library cache hit ratio&#8221; from v$librarycache;<\/p>\n\n\n\n<p>library\u547d\u4e2d\u7387\u7684\u6b63\u5e38\u6307\u6807\u8303\u56f4\u662f95%-100%<\/p>\n\n\n\n<p>3.latch\u547d\u4e2d\u7387:select round((1-sum(misses+immediate_misses)\/sum(gets+immediate_gets))*100,2) &#8220;latch hit ratio&#8221; from v$latch;<\/p>\n\n\n\n<p>\u5185\u90e8\u7ed3\u6784\u7ef4\u62a4\u9501\u547d\u4e2d\u7387\u901a\u5e38\u9ad8\u4e8e99%\uff0c\u5982\u679c\u8be5\u547d\u4e2d\u7387\u8f83\u4f4e\uff0c\u5219\u662f\u56e0\u4e3ashared_pool_size\u53c2\u6570\u503c\u8fc7\u5927\u6216\u8005\u6ca1\u6709\u4f7f\u7528\u7ed1\u5b9a\u53d8\u91cf\u5bfc\u81f4\u786c\u89e3\u6790\u8fc7\u591a\u3002<\/p>\n\n\n\n<p>4.In-Memory Sort\u547d\u4e2d\u7387select round((1-disk.value\/(disk.value+memory.value))*100,2) &#8220;in-memory sort ratio&#8221; from v$sysstat disk,v$sysstat memory where disk.name=&#8217;sorts (disk)&#8217; and memory.name=&#8217;sorts (memory)&#8217;;<\/p>\n\n\n\n<p>\u547d\u4e2d\u7387\u6b63\u5e38\u6307\u6807\u4e3a99%-100%\u3002<\/p>\n\n\n\n<p>5.buffer nowait \u7f13\u51b2\u533a\u4e2d\u83b7\u53d6\u6570\u636e\u672a\u7b49\u5f85\u7684\u6bd4\u7387select round((1-busy.value\/tol.value)*100,2) &#8220;buffer busy nowait ratio&#8221; from (select sum(count) value from v$waitstat where class in (&#8216;dataq block&#8217;,&#8217;segment header&#8217;,&#8217;undo header&#8217;,&#8217;undo block&#8217;)) busy,(select value from v$sysstat where name=&#8217;session logical reads&#8217;) tol;<\/p>\n\n\n\n<p>\u6b63\u786e\u6307\u6807\u662f99%-100%.<\/p>\n\n\n\n<p>6.redo nowait \u91cd\u505a\u7f13\u51b2\u533a\u4e2d\u83b7\u53d6\u6570\u636e\u672a\u7b49\u5f85\u7684\u6bd4\u7387select round((1-waits.value\/redos.value)*100,2) &#8220;redo nowait ratio&#8221; from v$sysstat waits,v$sysstat redos where waits.name=&#8217;redo log space requests&#8217; and redos.name=&#8217;redo entries&#8217;;<\/p>\n\n\n\n<p>\u6b63\u786e\u6307\u6807\u4e3a99%-100%.\u8f83\u4f4e\u7684\u539f\u56e0\u53ef\u80fd\u662f\u5f52\u6863\u901f\u5ea6\u592a\u6162\uff0c\u8054\u673a\u65e5\u5fd7\u6587\u4ef6\u592a\u5c0f\u6216\u8005\u8054\u673a\u65e5\u5fd7\u6587\u4ef6\u5b58\u653e\u5728\u6bd4\u8f83\u6162\u7684\u5b58\u50a8\u8bbe\u5907\u4e0a\u3002<\/p>\n\n\n\n<p>7.parse cpu to parse elapsed \u6570\u636e\u5e93\u7528\u4e8e\u5206\u6790cpu\u7684\u65f6\u95f4\u548c\u5206\u6790\u5b8c\u6210\u7684\u6bd4\u7387\uff0c\u503c\u8f83\u4f4e\u8bf4\u660e\u5728\u5206\u6790\u8fc7\u7a0b\u4e2dcpu\u5728\u7b49\u5f85\u5176\u4ed6\u7684\u8d44\u6e90\u3002select round((1-cpu.value\/total.value)*100,2) &#8220;parse cpu to parse elapsed ratio&#8221; from v$sysstat cpu,v$sysstat total where cpu.name=&#8217;parse time cpu&#8217; and total.name=&#8217;parse time elapsed&#8217;;&nbsp;<\/p>\n\n\n\n<p>8.non-parse cpu \u67e5\u8be2\u5b9e\u9645\u8fd0\u884c\u65f6\u95f4\u5360sql\u8bed\u53e5\u8fd0\u884c\u52a0\u89e3\u6790\u65f6\u95f4\u4e4b\u548c\u7684\u6bd4\u4f8b\uff0c\u5982\u679c\u503c\u592a\u4f4e\u8868\u793a\u89e3\u6790sql\u8bed\u53e5\u6d88\u8017\u7684\u65f6\u95f4\u8fc7\u957f\u3002select round((1-parse.value\/total.value)*100,2) &#8220;non-parse cpu ratio&#8221; from v$sysstat parse,v$sysstat total where parse.name=&#8217;parse time cpu&#8217; and total.name=&#8217;CPU used by this session&#8217;;<\/p>\n\n\n\n<p>9.\u788e\u7247\u7a0b\u5ea6\uff08FSFI\uff09select tablespace_name,sqrt(max(blocks)\/sum(blocks))*(100\/sqrt(sqrt(count(blocks)))) FSFI from dba_free_space group by tablespace_name order by tablespace_name;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.buffer \u547d\u4e2d\u7387:select round((1-(physical.value-direct.value-lobs.value)\/logical.value)*100,2) &#8220;buffer cache hit ratio&#8221; from v$sysstat physical,v$systat direct,v$sysstat lobs,v$sysstat logical where physical.name=&#8217;physical reads&#8217; and direct.name=&#8217;physical reads direct&#8217; and lobs.name=&#8217;physical reads direct (lob)&#8217; and logical.name=&#8217;session logical reads&#8217;; buffer\u547d\u4e2d\u7387\u7684\u6b63\u5e38\u6307\u6807\u4e3a90%-100%\uff0c\u4f46\u5728\u6570\u636e\u5e93\u7e41\u5fd9\u8fd0\u884c\u671f\u95f4\u6709\u53ef\u80fd\u4f4e\u4e8e90%\u3002 2.library\u547d\u4e2d\u7387:select round(sum(pins-reloads)\/sum(pins)*100,2) &#8220;library cache hit ratio&#8221; from v$librarycache; library\u547d\u4e2d\u7387\u7684\u6b63\u5e38\u6307\u6807\u8303\u56f4\u662f95%-100% 3.latch\u547d\u4e2d\u7387:select round((1-sum(misses+immediate_misses)\/sum(gets+immediate_gets))*100,2) &#8220;latch hit ratio&#8221; from v$latch; \u5185\u90e8\u7ed3\u6784\u7ef4\u62a4\u9501\u547d\u4e2d\u7387\u901a\u5e38\u9ad8\u4e8e99%\uff0c\u5982\u679c\u8be5\u547d\u4e2d\u7387\u8f83\u4f4e\uff0c\u5219\u662f\u56e0\u4e3ashared_pool_size\u53c2\u6570\u503c\u8fc7\u5927\u6216\u8005\u6ca1\u6709\u4f7f\u7528\u7ed1\u5b9a\u53d8\u91cf\u5bfc\u81f4\u786c\u89e3\u6790\u8fc7\u591a\u3002 4.In-Memory Sort\u547d\u4e2d\u7387select round((1-disk.value\/(disk.value+memory.value))*100,2) &#8220;in-memory sort ratio&#8221; from v$sysstat [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-373","post","type-post","status-publish","format-standard","hentry","category-8"],"_links":{"self":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/373","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=373"}],"version-history":[{"count":1,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/373\/revisions"}],"predecessor-version":[{"id":374,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/373\/revisions\/374"}],"wp:attachment":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=373"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=373"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=373"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}