{"id":90946,"date":"2024-10-18T16:59:16","date_gmt":"2024-10-18T08:59:16","guid":{"rendered":"https:\/\/server.hk\/cnblog\/90946\/"},"modified":"2024-10-18T16:59:17","modified_gmt":"2024-10-18T08:59:17","slug":"ora-28554-pass-through-sql-out-of-cursors-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\/90946\/","title":{"rendered":"ORA-28554: pass-through SQL: out of cursors ORACLE\u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-28554-pass-through-sql-out-of-cursors-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-wjjhJaPfpn\">ORA-28554: pass-through SQL: out of cursors ORACLE\u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528Oracle\u6578\u64da\u5eab\u6642\uff0c\u958b\u767c\u8005\u548c\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u53ef\u80fd\u6703\u9047\u5230\u5404\u7a2e\u932f\u8aa4\u4ee3\u78bc\uff0c\u5176\u4e2d\u4e4b\u4e00\u4fbf\u662fORA-28554\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8207\u4f7f\u7528\u901a\u904eSQL\u7684\u9060\u7a0b\u6578\u64da\u5eab\u9023\u63a5\u6709\u95dc\uff0c\u7279\u5225\u662f\u5728\u4f7f\u7528Oracle\u7684\u5916\u90e8\u6578\u64da\u6e90\u6642\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0eORA-28554\u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u4fee\u5fa9\u65b9\u6cd5\u3002<\/p>\n<h2 id=\"ora-28554%e9%8c%af%e8%aa%a4%e7%9a%84%e5%8e%9f%e5%9b%a0-wjjhJaPfpn\">ORA-28554\u932f\u8aa4\u7684\u539f\u56e0<\/h2>\n<p>ORA-28554\u932f\u8aa4\u7684\u5177\u9ad4\u4fe1\u606f\u70ba\u201cpass-through SQL: out of cursors\u201d\u3002\u9019\u610f\u5473\u8457\u5728\u57f7\u884c\u901a\u904eSQL\u7684\u67e5\u8a62\u6642\uff0c\u8d85\u51fa\u4e86\u53ef\u7528\u7684\u6e38\u6a19\u6578\u91cf\u3002\u6e38\u6a19\u662f\u7528\u65bc\u7ba1\u7406SQL\u67e5\u8a62\u7684\u6578\u64da\u7d50\u69cb\uff0cOracle\u6578\u64da\u5eab\u5c0d\u6bcf\u500b\u6703\u8a71\u7684\u6e38\u6a19\u6578\u91cf\u6709\u4e00\u5b9a\u7684\u9650\u5236\u3002<\/p>\n<ul>\n<li><strong>\u6e38\u6a19\u9650\u5236\uff1a<\/strong>\u6bcf\u500bOracle\u6703\u8a71\u90fd\u6709\u4e00\u500b\u6700\u5927\u6e38\u6a19\u6578\u91cf\u7684\u9650\u5236\uff0c\u901a\u5e38\u9ed8\u8a8d\u70ba300\u3002\u5982\u679c\u540c\u6642\u6253\u958b\u7684\u6e38\u6a19\u6578\u91cf\u8d85\u904e\u9019\u500b\u9650\u5236\uff0c\u5c31\u6703\u51fa\u73feORA-28554\u932f\u8aa4\u3002<\/li>\n<li><strong>\u672a\u6b63\u78ba\u95dc\u9589\u6e38\u6a19\uff1a<\/strong>\u5982\u679c\u5728\u61c9\u7528\u7a0b\u5e8f\u4e2d\u672a\u6b63\u78ba\u95dc\u9589\u6e38\u6a19\uff0c\u9019\u6703\u5c0e\u81f4\u6e38\u6a19\u6578\u91cf\u9010\u6f38\u589e\u52a0\uff0c\u6700\u7d42\u9054\u5230\u9650\u5236\u3002<\/li>\n<li><strong>\u9577\u6642\u9593\u904b\u884c\u7684\u67e5\u8a62\uff1a<\/strong>\u67d0\u4e9b\u67e5\u8a62\u53ef\u80fd\u9700\u8981\u9577\u6642\u9593\u57f7\u884c\uff0c\u9019\u6703\u4f54\u7528\u6e38\u6a19\uff0c\u5c0e\u81f4\u53ef\u7528\u6e38\u6a19\u6578\u91cf\u6e1b\u5c11\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%bd%b1%e9%9f%bf-wjjhJaPfpn\">\u5f71\u97ff<\/h2>\n<p>\u7576\u51fa\u73feORA-28554\u932f\u8aa4\u6642\uff0c\u5c07\u7121\u6cd5\u57f7\u884c\u4efb\u4f55\u65b0\u7684SQL\u67e5\u8a62\uff0c\u9019\u6703\u5f71\u97ff\u61c9\u7528\u7a0b\u5e8f\u7684\u6b63\u5e38\u904b\u884c\u3002\u7279\u5225\u662f\u5728\u9ad8\u6d41\u91cf\u7684\u74b0\u5883\u4e2d\uff0c\u9019\u53ef\u80fd\u5c0e\u81f4\u7cfb\u7d71\u6027\u80fd\u4e0b\u964d\uff0c\u751a\u81f3\u9020\u6210\u670d\u52d9\u4e2d\u65b7\u3002<\/p>\n<h2 id=\"%e4%bf%ae%e5%be%a9%e6%96%b9%e6%b3%95-wjjhJaPfpn\">\u4fee\u5fa9\u65b9\u6cd5<\/h2>\n<p>\u70ba\u4e86\u89e3\u6c7aORA-28554\u932f\u8aa4\uff0c\u53ef\u4ee5\u63a1\u53d6\u4ee5\u4e0b\u5e7e\u7a2e\u65b9\u6cd5\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e6%b8%b8%e6%a8%99%e4%bd%bf%e7%94%a8%e6%83%85%e6%b3%81-wjjhJaPfpn\">1. \u6aa2\u67e5\u6e38\u6a19\u4f7f\u7528\u60c5\u6cc1<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0bSQL\u67e5\u8a62\u4f86\u6aa2\u67e5\u7576\u524d\u6703\u8a71\u7684\u6e38\u6a19\u4f7f\u7528\u60c5\u6cc1\uff1a<\/p>\n<pre><code>SELECT COUNT(*) FROM v$open_cursor WHERE sid = SYS_CONTEXT('USERENV', 'SID');<\/code><\/pre>\n<p>\u9019\u5c07\u986f\u793a\u7576\u524d\u6703\u8a71\u4e2d\u6253\u958b\u7684\u6e38\u6a19\u6578\u91cf\u3002\u5982\u679c\u63a5\u8fd1\u6216\u8d85\u904e\u9650\u5236\uff0c\u5247\u9700\u8981\u9032\u884c\u8abf\u6574\u3002<\/p>\n<h3 id=\"2-%e9%97%9c%e9%96%89%e6%9c%aa%e4%bd%bf%e7%94%a8%e7%9a%84%e6%b8%b8%e6%a8%99-wjjhJaPfpn\">2. \u95dc\u9589\u672a\u4f7f\u7528\u7684\u6e38\u6a19<\/h3>\n<p>\u78ba\u4fdd\u5728\u61c9\u7528\u7a0b\u5e8f\u4e2d\u6b63\u78ba\u95dc\u9589\u6e38\u6a19\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u78bc\u793a\u4f8b\u4f86\u95dc\u9589\u6e38\u6a19\uff1a<\/p>\n<pre><code>IF cursor_variable IS NOT NULL THEN\n    CLOSE cursor_variable;\nEND IF;<\/code><\/pre>\n<h3 id=\"3-%e5%a2%9e%e5%8a%a0%e6%b8%b8%e6%a8%99%e9%99%90%e5%88%b6-wjjhJaPfpn\">3. \u589e\u52a0\u6e38\u6a19\u9650\u5236<\/h3>\n<p>\u5982\u679c\u61c9\u7528\u7a0b\u5e8f\u7684\u9700\u6c42\u78ba\u5be6\u9700\u8981\u66f4\u591a\u7684\u6e38\u6a19\uff0c\u53ef\u4ee5\u8003\u616e\u589e\u52a0\u6e38\u6a19\u7684\u9650\u5236\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4fee\u6539\u521d\u59cb\u5316\u53c3\u6578\u4f86\u5be6\u73fe\uff1a<\/p>\n<pre><code>ALTER SYSTEM SET open_cursors = 500; -- \u5c07\u6e38\u6a19\u6578\u91cf\u589e\u52a0\u5230500<\/code><\/pre>\n<p>\u8acb\u6ce8\u610f\uff0c\u589e\u52a0\u6e38\u6a19\u9650\u5236\u53ef\u80fd\u6703\u5f71\u97ff\u7cfb\u7d71\u6027\u80fd\uff0c\u56e0\u6b64\u61c9\u8b39\u614e\u64cd\u4f5c\u3002<\/p>\n<h3 id=\"4-%e5%84%aa%e5%8c%96%e6%9f%a5%e8%a9%a2-wjjhJaPfpn\">4. \u512a\u5316\u67e5\u8a62<\/h3>\n<p>\u6aa2\u67e5\u4e26\u512a\u5316\u9577\u6642\u9593\u904b\u884c\u7684\u67e5\u8a62\uff0c\u78ba\u4fdd\u5b83\u5011\u4e0d\u6703\u4f54\u7528\u904e\u591a\u7684\u8cc7\u6e90\u3002\u4f7f\u7528\u7d22\u5f15\u3001\u907f\u514d\u4e0d\u5fc5\u8981\u7684\u806f\u63a5\u7b49\u65b9\u6cd5\u53ef\u4ee5\u63d0\u9ad8\u67e5\u8a62\u6027\u80fd\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-wjjhJaPfpn\">\u7d50\u8ad6<\/h2>\n<p>ORA-28554\u932f\u8aa4\u662fOracle\u6578\u64da\u5eab\u4e2d\u5e38\u898b\u7684\u554f\u984c\u4e4b\u4e00\uff0c\u4e86\u89e3\u5176\u539f\u56e0\u548c\u4fee\u5fa9\u65b9\u6cd5\u5c0d\u65bc\u7dad\u8b77\u7cfb\u7d71\u7684\u7a69\u5b9a\u6027\u81f3\u95dc\u91cd\u8981\u3002\u901a\u904e\u6aa2\u67e5\u6e38\u6a19\u4f7f\u7528\u60c5\u6cc1\u3001\u6b63\u78ba\u95dc\u9589\u6e38\u6a19\u3001\u589e\u52a0\u6e38\u6a19\u9650\u5236\u4ee5\u53ca\u512a\u5316\u67e5\u8a62\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\uff0c\u78ba\u4fdd\u61c9\u7528\u7a0b\u5e8f\u7684\u6b63\u5e38\u904b\u884c\u3002<\/p>\n<p>\u5982\u9700\u9032\u4e00\u6b65\u4e86\u89e3\u5982\u4f55\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4ee5\u652f\u6301\u60a8\u7684\u6578\u64da\u5eab\u9700\u6c42\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to troubleshoot ORA-28554: pass-through SQL: out of cursors in Oracle. Discover effective remote handling and repair solutions.<\/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-90946","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/90946","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=90946"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/90946\/revisions"}],"predecessor-version":[{"id":90947,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/90946\/revisions\/90947"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=90946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=90946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=90946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}