{"id":95280,"date":"2024-10-19T23:44:18","date_gmt":"2024-10-19T15:44:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/95280\/"},"modified":"2024-10-19T23:44:19","modified_gmt":"2024-10-19T15:44:19","slug":"oracle%e5%85%a7%e5%ad%98%e7%b5%90%e6%a7%8b%e8%a3%a1process-memory%e5%af%a6%e9%9a%9b%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%a9%9f","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/95280\/","title":{"rendered":"Oracle\u5167\u5b58\u7d50\u69cb\u88e1Process Memory\u5be6\u969b\u64cd\u4f5c\u6b65\u9a5f"},"content":{"rendered":"<h1 id=\"oracle%e5%85%a7%e5%ad%98%e7%b5%90%e6%a7%8b%e8%a3%a1process-memory%e5%af%a6%e9%9a%9b%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%a9%9f-vypujvkQrc\">Oracle\u5167\u5b58\u7d50\u69cb\u88e1Process Memory\u5be6\u969b\u64cd\u4f5c\u6b65\u9a5f<\/h1>\n<p>\u5728Oracle\u6578\u64da\u5eab\u4e2d\uff0c\u5167\u5b58\u7d50\u69cb\u7684\u8a2d\u8a08\u5c0d\u65bc\u6027\u80fd\u548c\u6548\u7387\u81f3\u95dc\u91cd\u8981\u3002\u7279\u5225\u662fProcess Memory\uff08\u9032\u7a0b\u5167\u5b58\uff09\uff0c\u5b83\u662fOracle\u6578\u64da\u5eab\u904b\u884c\u6642\u7684\u6838\u5fc3\u7d44\u6210\u90e8\u5206\u4e4b\u4e00\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0eOracle\u7684Process Memory\u7d50\u69cb\u53ca\u5176\u5be6\u969b\u64cd\u4f5c\u6b65\u9a5f\uff0c\u5e6b\u52a9\u8b80\u8005\u66f4\u597d\u5730\u7406\u89e3\u548c\u7ba1\u7406Oracle\u6578\u64da\u5eab\u7684\u5167\u5b58\u4f7f\u7528\u3002<\/p>\n<h2 id=\"1-oracle%e5%85%a7%e5%ad%98%e7%b5%90%e6%a7%8b%e6%a6%82%e8%bf%b0-vypujvkQrc\">1. Oracle\u5167\u5b58\u7d50\u69cb\u6982\u8ff0<\/h2>\n<p>Oracle\u6578\u64da\u5eab\u7684\u5167\u5b58\u7d50\u69cb\u4e3b\u8981\u5206\u70ba\u5169\u500b\u90e8\u5206\uff1aSystem Global Area (SGA) \u548c Program Global Area (PGA)\u3002SGA\u662f\u5171\u4eab\u5167\u5b58\u5340\u57df\uff0c\u6240\u6709\u7528\u6236\u9032\u7a0b\u90fd\u53ef\u4ee5\u8a2a\u554f\uff0c\u800cPGA\u5247\u662f\u6bcf\u500b\u7528\u6236\u9032\u7a0b\u5c08\u7528\u7684\u5167\u5b58\u5340\u57df\u3002<\/p>\n<h3 id=\"1-1-system-global-area-sga-vypujvkQrc\">1.1 System Global Area (SGA)<\/h3>\n<ul>\n<li><strong>\u6578\u64da\u7de9\u5b58\uff1a<\/strong>\u7528\u65bc\u5b58\u5132\u6578\u64da\u584a\uff0c\u6e1b\u5c11\u78c1\u789fI\/O\u3002<\/li>\n<li><strong>\u5171\u4eab\u6c60\uff1a<\/strong>\u5b58\u5132SQL\u8a9e\u53e5\u548cPL\/SQL\u7a0b\u5e8f\u7684\u89e3\u6790\u7d50\u679c\u3002<\/li>\n<li><strong>\u65e5\u8a8c\u7de9\u5b58\uff1a<\/strong>\u7528\u65bc\u5b58\u5132\u91cd\u505a\u65e5\u8a8c\u7684\u6578\u64da\u3002<\/li>\n<\/ul>\n<h3 id=\"1-2-program-global-area-pga-vypujvkQrc\">1.2 Program Global Area (PGA)<\/h3>\n<ul>\n<li><strong>\u79c1\u6709\u5167\u5b58\uff1a<\/strong>\u6bcf\u500b\u9032\u7a0b\u7684\u79c1\u6709\u6578\u64da\u548c\u63a7\u5236\u4fe1\u606f\u3002<\/li>\n<li><strong>\u6392\u5e8f\u5340\u57df\uff1a<\/strong>\u7528\u65bc\u6392\u5e8f\u64cd\u4f5c\u7684\u5167\u5b58\u3002<\/li>\n<li><strong>\u6703\u8a71\u4fe1\u606f\uff1a<\/strong>\u5b58\u5132\u7528\u6236\u6703\u8a71\u7684\u72c0\u614b\u548c\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<h2 id=\"2-process-memory%e7%9a%84%e5%af%a6%e9%9a%9b%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%a9%9f-vypujvkQrc\">2. Process Memory\u7684\u5be6\u969b\u64cd\u4f5c\u6b65\u9a5f<\/h2>\n<p>\u5728Oracle\u4e2d\uff0c\u7ba1\u7406Process Memory\u7684\u64cd\u4f5c\u4e3b\u8981\u6d89\u53ca\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"2-1-%e7%a2%ba%e8%aa%8dpga%e7%9a%84%e5%a4%a7%e5%b0%8f-vypujvkQrc\">2.1 \u78ba\u8a8dPGA\u7684\u5927\u5c0f<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u78ba\u8a8d\u7576\u524dPGA\u7684\u5927\u5c0f\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0bSQL\u67e5\u8a62\u4f86\u7372\u53d6PGA\u7684\u76f8\u95dc\u4fe1\u606f\uff1a<\/p>\n<pre><code>SELECT name, value \nFROM v$parameter \nWHERE name LIKE '%pga%';<\/code><\/pre>\n<p>\u9019\u5c07\u986f\u793a\u8207PGA\u76f8\u95dc\u7684\u53c3\u6578\uff0c\u4f8b\u5982pga_aggregate_target\u548cpga_aggregate_limit\u3002<\/p>\n<h3 id=\"2-2-%e8%aa%bf%e6%95%b4pga%e7%9a%84%e5%a4%a7%e5%b0%8f-vypujvkQrc\">2.2 \u8abf\u6574PGA\u7684\u5927\u5c0f<\/h3>\n<p>\u6839\u64da\u7cfb\u7d71\u7684\u9700\u6c42\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u8abf\u6574PGA\u7684\u5927\u5c0f\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u4fee\u6539PGA\u7684\u76ee\u6a19\u5927\u5c0f\uff1a<\/p>\n<pre><code>ALTER SYSTEM SET pga_aggregate_target = 2G SCOPE=BOTH;<\/code><\/pre>\n<p>\u9019\u88e1\u5c07PGA\u7684\u76ee\u6a19\u5927\u5c0f\u8a2d\u7f6e\u70ba2GB\u3002\u6839\u64da\u5be6\u969b\u9700\u6c42\uff0c\u60a8\u53ef\u4ee5\u8abf\u6574\u9019\u500b\u503c\u3002<\/p>\n<h3 id=\"2-3-%e7%9b%a3%e6%8e%a7pga%e4%bd%bf%e7%94%a8%e6%83%85%e6%b3%81-vypujvkQrc\">2.3 \u76e3\u63a7PGA\u4f7f\u7528\u60c5\u6cc1<\/h3>\n<p>\u70ba\u4e86\u78ba\u4fddPGA\u7684\u6709\u6548\u4f7f\u7528\uff0c\u60a8\u9700\u8981\u5b9a\u671f\u76e3\u63a7\u5176\u4f7f\u7528\u60c5\u6cc1\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8a62\u4f86\u6aa2\u67e5PGA\u7684\u4f7f\u7528\u60c5\u6cc1\uff1a<\/p>\n<pre><code>SELECT * \nFROM v$pgastat;<\/code><\/pre>\n<p>\u9019\u5c07\u986f\u793aPGA\u7684\u5404\u7a2e\u7d71\u8a08\u4fe1\u606f\uff0c\u5305\u62ec\u5df2\u4f7f\u7528\u7684\u5167\u5b58\u548c\u6700\u5927\u5167\u5b58\u4f7f\u7528\u91cf\u3002<\/p>\n<h3 id=\"2-4-%e5%84%aa%e5%8c%96pga%e9%85%8d%e7%bd%ae-vypujvkQrc\">2.4 \u512a\u5316PGA\u914d\u7f6e<\/h3>\n<p>\u6839\u64da\u76e3\u63a7\u7d50\u679c\uff0c\u60a8\u53ef\u80fd\u9700\u8981\u9032\u4e00\u6b65\u512a\u5316PGA\u7684\u914d\u7f6e\u3002\u53ef\u4ee5\u8003\u616e\u8abf\u6574\u4ee5\u4e0b\u53c3\u6578\uff1a<\/p>\n<ul>\n<li><strong>pga_aggregate_target\uff1a<\/strong>\u8a2d\u7f6ePGA\u7684\u76ee\u6a19\u5927\u5c0f\u3002<\/li>\n<li><strong>pga_aggregate_limit\uff1a<\/strong>\u8a2d\u7f6ePGA\u7684\u6700\u5927\u9650\u5236\u3002<\/li>\n<\/ul>\n<p>\u9019\u4e9b\u8abf\u6574\u53ef\u4ee5\u5e6b\u52a9\u63d0\u9ad8\u6578\u64da\u5eab\u7684\u6027\u80fd\uff0c\u7279\u5225\u662f\u5728\u9ad8\u8ca0\u8f09\u7684\u60c5\u6cc1\u4e0b\u3002<\/p>\n<h2 id=\"3-%e7%b8%bd%e7%b5%90-vypujvkQrc\">3. \u7e3d\u7d50<\/h2>\n<p>Oracle\u7684Process Memory\u7d50\u69cb\u5c0d\u65bc\u6578\u64da\u5eab\u7684\u6027\u80fd\u81f3\u95dc\u91cd\u8981\u3002\u901a\u904e\u4e86\u89e3\u548c\u7ba1\u7406PGA\u7684\u5927\u5c0f\u53ca\u5176\u4f7f\u7528\u60c5\u6cc1\uff0c\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u53ef\u4ee5\u6709\u6548\u5730\u512a\u5316\u6578\u64da\u5eab\u6027\u80fd\u3002\u5b9a\u671f\u76e3\u63a7\u548c\u8abf\u6574PGA\u914d\u7f6e\u5c07\u6709\u52a9\u65bc\u78ba\u4fdd\u7cfb\u7d71\u5728\u9ad8\u8ca0\u8f09\u4e0b\u7684\u7a69\u5b9a\u6027\u548c\u6548\u7387\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc\u5982\u4f55\u5728\u9999\u6e2f\u4f7f\u7528<a href=\"https:\/\/server.hk\">VPS<\/a>\u4f86\u904b\u884cOracle\u6578\u64da\u5eab\u6709\u8208\u8da3\uff0c\u6216\u60f3\u4e86\u89e3\u66f4\u591a\u95dc\u65bc<a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a>\u7684\u8cc7\u8a0a\uff0c\u8acb\u96a8\u6642\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3Oracle\u5167\u5b58\u7d50\u69cb\u4e2dProcess Memory\u7684\u5be6\u969b\u64cd\u4f5c\u6b65\u9a5f\uff0c\u63d0\u5347\u6578\u64da\u5eab\u6027\u80fd\u8207\u7ba1\u7406\u6548\u7387\u3002<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-95280","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/95280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=95280"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/95280\/revisions"}],"predecessor-version":[{"id":95281,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/95280\/revisions\/95281"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=95280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=95280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=95280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}