{"id":82140,"date":"2024-10-16T18:44:15","date_gmt":"2024-10-16T10:44:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/82140\/"},"modified":"2024-10-16T18:44:15","modified_gmt":"2024-10-16T10:44:15","slug":"ora-00846-could-not-shrink-memory_target-to-specified-value-oracle%e5%a0%b1%e9%8c%af%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/82140\/","title":{"rendered":"ORA-00846: could not shrink MEMORY_TARGET to specified value ORACLE\u5831\u932f\u6545\u969c\u4fee\u5fa9\u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-00846-%e7%84%a1%e6%b3%95%e5%b0%87-memory_target-%e7%b8%ae%e5%b0%8f%e8%87%b3%e6%8c%87%e5%ae%9a%e5%80%bc%e7%9a%84%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-HQtoHVzlZP\">ORA-00846: \u7121\u6cd5\u5c07 MEMORY_TARGET \u7e2e\u5c0f\u81f3\u6307\u5b9a\u503c\u7684\u6545\u969c\u4fee\u5fa9<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \u6578\u64da\u5eab\u6642\uff0c\u9047\u5230\u932f\u8aa4\u4ee3\u78bc <code>ORA-00846<\/code> \u662f\u4e00\u500b\u5e38\u898b\u7684\u554f\u984c\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u7528\u6236\u5617\u8a66\u8abf\u6574 <code>MEMORY_TARGET<\/code> \u53c3\u6578\u6642\uff0c\u5c24\u5176\u662f\u7576\u7cfb\u7d71\u7684\u5167\u5b58\u914d\u7f6e\u4e0d\u5141\u8a31\u9019\u6a23\u7684\u8b8a\u66f4\u6642\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u500b\u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"ora-00846-%e9%8c%af%e8%aa%a4%e7%9a%84%e5%8e%9f%e5%9b%a0-HQtoHVzlZP\">ORA-00846 \u932f\u8aa4\u7684\u539f\u56e0<\/h2>\n<p>\u7576\u7528\u6236\u5617\u8a66\u5c07 <code>MEMORY_TARGET<\/code> \u7684\u503c\u7e2e\u5c0f\u6642\uff0cOracle \u6578\u64da\u5eab\u6703\u6aa2\u67e5\u7576\u524d\u7684\u5167\u5b58\u4f7f\u7528\u60c5\u6cc1\u3002\u5982\u679c\u7576\u524d\u7684\u5167\u5b58\u4f7f\u7528\u91cf\u8d85\u904e\u4e86\u65b0\u7684 <code>MEMORY_TARGET<\/code> \u8a2d\u5b9a\uff0c\u5247\u6703\u51fa\u73fe <code>ORA-00846<\/code> \u932f\u8aa4\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u4ee5\u4e0b\u60c5\u6cc1\uff1a<\/p>\n<ul>\n<li>\u7576\u524d\u7684\u5167\u5b58\u4f7f\u7528\u91cf\u5df2\u7d93\u9054\u5230\u6216\u8d85\u904e\u4e86\u65b0\u7684\u8a2d\u5b9a\u503c\u3002<\/li>\n<li>\u7cfb\u7d71\u4e2d\u6709\u5176\u4ed6\u9032\u7a0b\u6216\u6703\u8a71\u6b63\u5728\u4f7f\u7528\u5167\u5b58\uff0c\u5c0e\u81f4\u7121\u6cd5\u91cb\u653e\u8db3\u5920\u7684\u5167\u5b58\u3002<\/li>\n<li>\u6578\u64da\u5eab\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u5b58\u5728\u4e0d\u4e00\u81f4\u7684\u8a2d\u7f6e\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e6%aa%a2%e6%9f%a5%e7%95%b6%e5%89%8d%e7%9a%84-memory_target-%e8%a8%ad%e5%ae%9a-HQtoHVzlZP\">\u5982\u4f55\u6aa2\u67e5\u7576\u524d\u7684 MEMORY_TARGET \u8a2d\u5b9a<\/h2>\n<p>\u8981\u6aa2\u67e5\u7576\u524d\u7684 <code>MEMORY_TARGET<\/code> \u8a2d\u5b9a\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\uff1a<\/p>\n<pre><code>SELECT name, value FROM v$parameter WHERE name = 'memory_target';<\/code><\/pre>\n<p>\u9019\u5c07\u986f\u793a\u7576\u524d\u7684 <code>MEMORY_TARGET<\/code> \u503c\uff0c\u5e6b\u52a9\u7528\u6236\u4e86\u89e3\u7576\u524d\u7684\u5167\u5b58\u914d\u7f6e\u3002<\/p>\n<h2 id=\"%e8%a7%a3%e6%b1%ba-ora-00846-%e9%8c%af%e8%aa%a4%e7%9a%84%e6%96%b9%e6%b3%95-HQtoHVzlZP\">\u89e3\u6c7a ORA-00846 \u932f\u8aa4\u7684\u65b9\u6cd5<\/h2>\n<p>\u89e3\u6c7a <code>ORA-00846<\/code> \u932f\u8aa4\u7684\u6b65\u9a5f\u5982\u4e0b\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e7%95%b6%e5%89%8d%e5%85%a7%e5%ad%98%e4%bd%bf%e7%94%a8%e6%83%85%e6%b3%81-HQtoHVzlZP\">1. \u6aa2\u67e5\u7576\u524d\u5167\u5b58\u4f7f\u7528\u60c5\u6cc1<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8a62\u4f86\u6aa2\u67e5\u7576\u524d\u7684\u5167\u5b58\u4f7f\u7528\u60c5\u6cc1\uff1a<\/p>\n<pre><code>SELECT * FROM v$sgastat;<\/code><\/pre>\n<p>\u9019\u5c07\u986f\u793a\u7cfb\u7d71\u4e2d\u5404\u7a2e\u5167\u5b58\u5340\u57df\u7684\u4f7f\u7528\u60c5\u6cc1\uff0c\u5e6b\u52a9\u7528\u6236\u4e86\u89e3\u662f\u5426\u6709\u8db3\u5920\u7684\u5167\u5b58\u53ef\u4f9b\u7e2e\u5c0f\u3002<\/p>\n<h3 id=\"2-%e8%aa%bf%e6%95%b4-memory_target-HQtoHVzlZP\">2. \u8abf\u6574 MEMORY_TARGET<\/h3>\n<p>\u5982\u679c\u78ba\u5b9a\u53ef\u4ee5\u7e2e\u5c0f <code>MEMORY_TARGET<\/code>\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u8abf\u6574\uff1a<\/p>\n<pre><code>ALTER SYSTEM SET MEMORY_TARGET = \u65b0\u7684\u503c SCOPE = SPFILE;<\/code><\/pre>\n<p>\u8acb\u6ce8\u610f\uff0c\u9019\u9700\u8981\u91cd\u555f\u6578\u64da\u5eab\u624d\u80fd\u751f\u6548\u3002<\/p>\n<h3 id=\"3-%e9%87%8b%e6%94%be%e5%85%a7%e5%ad%98-HQtoHVzlZP\">3. \u91cb\u653e\u5167\u5b58<\/h3>\n<p>\u5982\u679c\u7576\u524d\u7684\u5167\u5b58\u4f7f\u7528\u91cf\u904e\u9ad8\uff0c\u53ef\u4ee5\u8003\u616e\u91cb\u653e\u4e00\u4e9b\u5167\u5b58\u3002\u9019\u53ef\u4ee5\u901a\u904e\u95dc\u9589\u4e0d\u5fc5\u8981\u7684\u6703\u8a71\u6216\u9032\u7a0b\u4f86\u5be6\u73fe\u3002<\/p>\n<h3 id=\"4-%e6%aa%a2%e6%9f%a5%e9%85%8d%e7%bd%ae%e6%96%87%e4%bb%b6-HQtoHVzlZP\">4. \u6aa2\u67e5\u914d\u7f6e\u6587\u4ef6<\/h3>\n<p>\u78ba\u4fdd\u6578\u64da\u5eab\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u6c92\u6709\u4e0d\u4e00\u81f4\u7684\u8a2d\u7f6e\uff0c\u7279\u5225\u662f\u8207\u5167\u5b58\u76f8\u95dc\u7684\u53c3\u6578\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u67e5\u8a62\u4f86\u6aa2\u67e5\u6240\u6709\u5167\u5b58\u76f8\u95dc\u7684\u53c3\u6578\uff1a<\/p>\n<pre><code>SELECT name, value FROM v$parameter WHERE name LIKE '%memory%';<\/code><\/pre>\n<h2 id=\"%e7%b8%bd%e7%b5%90-HQtoHVzlZP\">\u7e3d\u7d50<\/h2>\n<p>\u5728 Oracle \u6578\u64da\u5eab\u4e2d\uff0c<code>ORA-00846<\/code> \u932f\u8aa4\u901a\u5e38\u662f\u7531\u65bc\u5167\u5b58\u914d\u7f6e\u4e0d\u7576\u5f15\u8d77\u7684\u3002\u901a\u904e\u6aa2\u67e5\u7576\u524d\u7684\u5167\u5b58\u4f7f\u7528\u60c5\u6cc1\u3001\u8abf\u6574 <code>MEMORY_TARGET<\/code>\u3001\u91cb\u653e\u5167\u5b58\u4ee5\u53ca\u6aa2\u67e5\u914d\u7f6e\u6587\u4ef6\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u9019\u4e00\u554f\u984c\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u548c\u9ad8\u6548\u904b\u884c\u7684\u61c9\u7528\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u670d\u52d9\u4e5f\u662f\u81f3\u95dc\u91cd\u8981\u7684\uff0c\u9019\u6a23\u53ef\u4ee5\u78ba\u4fdd\u6578\u64da\u5eab\u7684\u6027\u80fd\u548c\u53ef\u9760\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to resolve the ORA-00846 error in Oracle, which prevents shrinking MEMORY_TARGET. Step-by-step remote troubleshooting guide included.<\/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-82140","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/82140","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=82140"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/82140\/revisions"}],"predecessor-version":[{"id":82141,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/82140\/revisions\/82141"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=82140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=82140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=82140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}