{"id":87852,"date":"2024-10-18T04:31:19","date_gmt":"2024-10-17T20:31:19","guid":{"rendered":"https:\/\/server.hk\/cnblog\/87852\/"},"modified":"2024-10-18T04:31:20","modified_gmt":"2024-10-17T20:31:20","slug":"ora-22297-%e8%ad%a6%e5%91%8a-%e5%9c%a8%e4%ba%8b%e5%8b%99%e6%8f%90%e4%ba%a4%e6%99%82%e5%ad%98%e5%9c%a8%e6%89%93%e9%96%8b%e7%9a%84-lob-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-2","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/87852\/","title":{"rendered":"ORA-22297: \u8b66\u544a: \u5728\u4e8b\u52d9\u63d0\u4ea4\u6642\u5b58\u5728\u6253\u958b\u7684 LOB ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-22297-%e8%ad%a6%e5%91%8a-%e5%9c%a8%e4%ba%8b%e5%8b%99%e6%8f%90%e4%ba%a4%e6%99%82%e5%ad%98%e5%9c%a8%e6%89%93%e9%96%8b%e7%9a%84-lob-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9-PyACeUNKVC\">ORA-22297: \u8b66\u544a: \u5728\u4e8b\u52d9\u63d0\u4ea4\u6642\u5b58\u5728\u6253\u958b\u7684 LOB ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406<\/h1>\n<p>\u5728\u4f7f\u7528 Oracle \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\u662f <code>ORA-22297<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u4e8b\u52d9\u63d0\u4ea4\u6642\uff0c\u63d0\u793a\u5b58\u5728\u6253\u958b\u7684 LOB\uff08Large Object\uff09\u5c0d\u8c61\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u4e00\u932f\u8aa4\u7684\u6210\u56e0\u3001\u5f71\u97ff\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-lob%ef%bc%9f-PyACeUNKVC\">\u4ec0\u9ebc\u662f LOB\uff1f<\/h2>\n<p>LOB\uff08Large Object\uff09\u662f Oracle \u6578\u64da\u5eab\u4e2d\u7528\u4f86\u5b58\u5132\u5927\u91cf\u6578\u64da\u7684\u6578\u64da\u985e\u578b\uff0c\u901a\u5e38\u5305\u62ec\u6587\u672c\u3001\u5716\u50cf\u3001\u97f3\u983b\u548c\u8996\u983b\u7b49\u3002LOB \u985e\u578b\u4e3b\u8981\u6709\u4e09\u7a2e\uff1a<\/p>\n<ul>\n<li><strong>BLOB<\/strong>\uff08Binary Large Object\uff09\uff1a\u7528\u65bc\u5b58\u5132\u4e8c\u9032\u5236\u6578\u64da\uff0c\u5982\u5716\u50cf\u548c\u97f3\u983b\u3002<\/li>\n<li><strong>CLOB<\/strong>\uff08Character Large Object\uff09\uff1a\u7528\u65bc\u5b58\u5132\u5b57\u7b26\u6578\u64da\uff0c\u5982\u9577\u6587\u672c\u3002<\/li>\n<li><strong>NCLOB<\/strong>\uff1a\u7528\u65bc\u5b58\u5132\u570b\u969b\u5b57\u7b26\u96c6\u7684\u9577\u6587\u672c\u3002<\/li>\n<\/ul>\n<h2 id=\"ora-22297-%e9%8c%af%e8%aa%a4%e7%9a%84%e6%88%90%e5%9b%a0-PyACeUNKVC\">ORA-22297 \u932f\u8aa4\u7684\u6210\u56e0<\/h2>\n<p>\u7576\u4f60\u5728\u63d0\u4ea4\u4e8b\u52d9\u6642\u9047\u5230 <code>ORA-22297<\/code> \u932f\u8aa4\uff0c\u9019\u901a\u5e38\u610f\u5473\u8457\u5728\u4e8b\u52d9\u4e2d\u6709\u4e00\u500b\u6216\u591a\u500b LOB \u5c0d\u8c61\u4ecd\u7136\u8655\u65bc\u6253\u958b\u72c0\u614b\u3002\u9019\u53ef\u80fd\u662f\u7531\u65bc\u4ee5\u4e0b\u5e7e\u500b\u539f\u56e0\uff1a<\/p>\n<ul>\n<li>\u5728\u4e8b\u52d9\u4e2d\u672a\u6b63\u78ba\u95dc\u9589 LOB \u5c0d\u8c61\u3002<\/li>\n<li>\u5728\u4f7f\u7528 LOB \u5c0d\u8c61\u6642\u767c\u751f\u4e86\u7570\u5e38\uff0c\u5c0e\u81f4\u672a\u80fd\u6b63\u5e38\u91cb\u653e\u8cc7\u6e90\u3002<\/li>\n<li>\u5728\u4e8b\u52d9\u63d0\u4ea4\u4e4b\u524d\uff0cLOB \u5c0d\u8c61\u7684\u5f15\u7528\u88ab\u610f\u5916\u4e1f\u5931\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e4%bf%ae%e5%be%a9-ora-22297-%e9%8c%af%e8%aa%a4-PyACeUNKVC\">\u5982\u4f55\u4fee\u5fa9 ORA-22297 \u932f\u8aa4<\/h2>\n<p>\u4fee\u5fa9 <code>ORA-22297<\/code> \u932f\u8aa4\u7684\u95dc\u9375\u5728\u65bc\u78ba\u4fdd\u6240\u6709 LOB \u5c0d\u8c61\u5728\u4e8b\u52d9\u63d0\u4ea4\u4e4b\u524d\u90fd\u5df2\u6b63\u78ba\u95dc\u9589\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5177\u9ad4\u7684\u6b65\u9a5f\u548c\u5efa\u8b70\uff1a<\/p>\n<h3 id=\"1-%e7%a2%ba%e4%bf%9d%e6%ad%a3%e7%a2%ba%e9%97%9c%e9%96%89-lob-%e5%b0%8d%e8%b1%a1-PyACeUNKVC\">1. \u78ba\u4fdd\u6b63\u78ba\u95dc\u9589 LOB \u5c0d\u8c61<\/h3>\n<p>\u5728\u4f7f\u7528 LOB \u5c0d\u8c61\u5f8c\uff0c\u61c9\u8a72\u78ba\u4fdd\u8abf\u7528\u76f8\u61c9\u7684\u95dc\u9589\u65b9\u6cd5\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>DECLARE\n    l_blob BLOB;\nBEGIN\n    -- \u8b80\u53d6\u6216\u5beb\u5165 LOB \u5c0d\u8c61\n    -- ...\n    \n    -- \u78ba\u4fdd\u95dc\u9589 LOB \u5c0d\u8c61\n    DBMS_LOB.FREETEMPORARY(l_blob);\nEND;<\/code><\/pre>\n<h3 id=\"2-%e4%bd%bf%e7%94%a8%e7%95%b0%e5%b8%b8%e8%99%95%e7%90%86-PyACeUNKVC\">2. \u4f7f\u7528\u7570\u5e38\u8655\u7406<\/h3>\n<p>\u5728 PL\/SQL \u4e2d\uff0c\u4f7f\u7528\u7570\u5e38\u8655\u7406\u53ef\u4ee5\u5e6b\u52a9\u6355\u7372\u932f\u8aa4\u4e26\u78ba\u4fdd\u8cc7\u6e90\u7684\u91cb\u653e\u3002\u4f8b\u5982\uff1a<\/p>\n<pre><code>DECLARE\n    l_blob BLOB;\nBEGIN\n    -- \u8b80\u53d6\u6216\u5beb\u5165 LOB \u5c0d\u8c61\n    -- ...\nEXCEPTION\n    WHEN OTHERS THEN\n        -- \u78ba\u4fdd\u95dc\u9589 LOB \u5c0d\u8c61\n        DBMS_LOB.FREETEMPORARY(l_blob);\n        RAISE;\nEND;<\/code><\/pre>\n<h3 id=\"3-%e6%aa%a2%e6%9f%a5%e4%ba%8b%e5%8b%99%e9%82%8a%e7%95%8c-PyACeUNKVC\">3. \u6aa2\u67e5\u4e8b\u52d9\u908a\u754c<\/h3>\n<p>\u78ba\u4fdd\u5728\u4e8b\u52d9\u7684\u958b\u59cb\u548c\u7d50\u675f\u4e4b\u9593\uff0c\u6240\u6709\u7684 LOB \u64cd\u4f5c\u90fd\u5728\u6b63\u78ba\u7684\u7bc4\u570d\u5167\u9032\u884c\u3002\u907f\u514d\u5728\u4e8b\u52d9\u63d0\u4ea4\u5f8c\u518d\u9032\u884c LOB \u64cd\u4f5c\u3002<\/p>\n<h2 id=\"%e9%81%a0%e7%a8%8b%e8%99%95%e7%90%86%e7%9a%84%e8%80%83%e9%87%8f-PyACeUNKVC\">\u9060\u7a0b\u8655\u7406\u7684\u8003\u91cf<\/h2>\n<p>\u5728\u9032\u884c\u9060\u7a0b\u8655\u7406\u6642\uff0c\u7279\u5225\u662f\u5728\u5206\u4f48\u5f0f\u7cfb\u7d71\u4e2d\uff0c\u53ef\u80fd\u6703\u9762\u81e8\u66f4\u591a\u7684\u6311\u6230\u3002\u78ba\u4fdd\u6240\u6709\u7684 LOB \u5c0d\u8c61\u5728\u9060\u7a0b\u8abf\u7528\u4e2d\u90fd\u80fd\u6b63\u78ba\u7ba1\u7406\uff0c\u4e26\u4e14\u5728\u4e8b\u52d9\u7d50\u675f\u6642\u80fd\u5920\u6b63\u78ba\u91cb\u653e\u8cc7\u6e90\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-PyACeUNKVC\">\u7e3d\u7d50<\/h2>\n<p>\u9047\u5230 <code>ORA-22297<\/code> \u932f\u8aa4\u6642\uff0c\u958b\u767c\u8005\u9700\u8981\u4ed4\u7d30\u6aa2\u67e5 LOB \u5c0d\u8c61\u7684\u4f7f\u7528\u60c5\u6cc1\uff0c\u78ba\u4fdd\u5728\u4e8b\u52d9\u63d0\u4ea4\u4e4b\u524d\u6b63\u78ba\u95dc\u9589\u6240\u6709 LOB \u5c0d\u8c61\u3002\u901a\u904e\u9069\u7576\u7684\u7570\u5e38\u8655\u7406\u548c\u4e8b\u52d9\u7ba1\u7406\uff0c\u53ef\u4ee5\u6709\u6548\u907f\u514d\u6b64\u985e\u932f\u8aa4\u7684\u767c\u751f\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u6548\u6578\u64da\u8655\u7406\u7684\u61c9\u7528\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4e5f\u81f3\u95dc\u91cd\u8981\uff0c\u4ee5\u78ba\u4fdd\u7cfb\u7d71\u7684\u7a69\u5b9a\u6027\u548c\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-22297 \u8b66\u544a\uff1a\u4e8b\u52d9\u63d0\u4ea4\u6642\u5b58\u5728\u6253\u958b\u7684 LOB\uff0c\u63d0\u4f9b\u6545\u969c\u4fee\u5fa9\u548c\u9060\u7a0b\u8655\u7406\u65b9\u6848\uff0c\u78ba\u4fdd\u6578\u64da\u5b8c\u6574\u6027\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-87852","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87852","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=87852"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87852\/revisions"}],"predecessor-version":[{"id":87853,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87852\/revisions\/87853"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=87852"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=87852"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=87852"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}