{"id":87936,"date":"2024-10-18T05:13:17","date_gmt":"2024-10-17T21:13:17","guid":{"rendered":"https:\/\/server.hk\/cnblog\/87936\/"},"modified":"2024-10-18T05:13:17","modified_gmt":"2024-10-17T21:13:17","slug":"ora-22828-%e8%bc%b8%e5%85%a5%e6%a8%a1%e5%bc%8f%e6%88%96%e6%9b%bf%e6%8f%9b%e5%8f%83%e6%95%b8%e8%b6%85%e9%81%8e-32k-%e5%a4%a7%e5%b0%8f%e9%99%90%e5%88%b6-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/87936\/","title":{"rendered":"ORA-22828: \u8f38\u5165\u6a21\u5f0f\u6216\u66ff\u63db\u53c3\u6578\u8d85\u904e 32K \u5927\u5c0f\u9650\u5236 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-22828-%e8%bc%b8%e5%85%a5%e6%a8%a1%e5%bc%8f%e6%88%96%e6%9b%bf%e6%8f%9b%e5%8f%83%e6%95%b8%e8%b6%85%e9%81%8e-32k-%e5%a4%a7%e5%b0%8f%e9%99%90%e5%88%b6-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c-JUOaKGekMm\">ORA-22828: \u8f38\u5165\u6a21\u5f0f\u6216\u66ff\u63db\u53c3\u6578\u8d85\u904e 32K \u5927\u5c0f\u9650\u5236 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-22828<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u8868\u793a\u8f38\u5165\u6a21\u5f0f\u6216\u66ff\u63db\u53c3\u6578\u8d85\u904e\u4e86 32K \u7684\u5927\u5c0f\u9650\u5236\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u9019\u500b\u932f\u8aa4\u7684\u539f\u56e0\u3001\u5f71\u97ff\u4ee5\u53ca\u5982\u4f55\u9032\u884c\u6545\u969c\u4fee\u5fa9\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e5%8e%9f%e5%9b%a0-JUOaKGekMm\">\u932f\u8aa4\u539f\u56e0<\/h2>\n<p>\u7576\u4f60\u5728 Oracle \u6578\u64da\u5eab\u4e2d\u57f7\u884c\u67d0\u4e9b\u64cd\u4f5c\u6642\uff0c\u53ef\u80fd\u6703\u9047\u5230 <code>ORA-22828<\/code> \u932f\u8aa4\u3002\u9019\u901a\u5e38\u767c\u751f\u5728\u4ee5\u4e0b\u60c5\u6cc1\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528\u4e86\u904e\u5927\u7684 LOB\uff08Large Object\uff09\u6578\u64da\u985e\u578b\uff0c\u4f8b\u5982 CLOB \u6216 BLOB\u3002<\/li>\n<li>\u5728\u57f7\u884c PL\/SQL \u7a0b\u5e8f\u6642\uff0c\u50b3\u905e\u7684\u53c3\u6578\u8d85\u904e\u4e86 32K \u7684\u9650\u5236\u3002<\/li>\n<li>\u5728\u4f7f\u7528\u67d0\u4e9b SQL \u8a9e\u53e5\u6642\uff0c\u67e5\u8a62\u7684\u7d50\u679c\u96c6\u904e\u5927\u3002<\/li>\n<\/ul>\n<p>\u9019\u4e9b\u60c5\u6cc1\u90fd\u53ef\u80fd\u5c0e\u81f4 Oracle \u6578\u64da\u5eab\u7121\u6cd5\u8655\u7406\u8acb\u6c42\uff0c\u5f9e\u800c\u5f15\u767c <code>ORA-22828<\/code> \u932f\u8aa4\u3002<\/p>\n<h2 id=\"%e9%8c%af%e8%aa%a4%e5%bd%b1%e9%9f%bf-JUOaKGekMm\">\u932f\u8aa4\u5f71\u97ff<\/h2>\n<p>\u7576\u51fa\u73fe <code>ORA-22828<\/code> \u932f\u8aa4\u6642\uff0c\u5c07\u6703\u5f71\u97ff\u5230\u61c9\u7528\u7a0b\u5e8f\u7684\u6b63\u5e38\u904b\u884c\u3002\u9019\u53ef\u80fd\u5c0e\u81f4\u6578\u64da\u7121\u6cd5\u6b63\u78ba\u63d2\u5165\u3001\u66f4\u65b0\u6216\u67e5\u8a62\uff0c\u5f9e\u800c\u5f71\u97ff\u696d\u52d9\u6d41\u7a0b\u3002\u7279\u5225\u662f\u5728\u8655\u7406\u5927\u91cf\u6578\u64da\u6642\uff0c\u9019\u500b\u932f\u8aa4\u7684\u5f71\u97ff\u5c24\u70ba\u660e\u986f\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-JUOaKGekMm\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u8981\u4fee\u5fa9 <code>ORA-22828<\/code> \u932f\u8aa4\uff0c\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9a5f\u9032\u884c\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e6%95%b8%e6%93%9a%e5%a4%a7%e5%b0%8f-JUOaKGekMm\">1. \u6aa2\u67e5\u6578\u64da\u5927\u5c0f<\/h3>\n<p>\u9996\u5148\uff0c\u6aa2\u67e5\u50b3\u905e\u7d66 PL\/SQL \u7a0b\u5e8f\u6216 SQL \u8a9e\u53e5\u7684\u53c3\u6578\u5927\u5c0f\u3002\u78ba\u4fdd\u6240\u6709\u53c3\u6578\u7684\u5927\u5c0f\u90fd\u5728 32K \u7684\u9650\u5236\u4e4b\u5167\u3002\u5982\u679c\u9700\u8981\u8655\u7406\u66f4\u5927\u7684\u6578\u64da\uff0c\u53ef\u4ee5\u8003\u616e\u4f7f\u7528 LOB \u6578\u64da\u985e\u578b\u3002<\/p>\n<h3 id=\"2-%e4%bd%bf%e7%94%a8-lob-%e6%95%b8%e6%93%9a%e9%a1%9e%e5%9e%8b-JUOaKGekMm\">2. \u4f7f\u7528 LOB \u6578\u64da\u985e\u578b<\/h3>\n<p>\u5982\u679c\u4f60\u7684\u61c9\u7528\u7a0b\u5e8f\u9700\u8981\u8655\u7406\u5927\u91cf\u6587\u672c\u6216\u4e8c\u9032\u5236\u6578\u64da\uff0c\u5efa\u8b70\u4f7f\u7528 CLOB \u6216 BLOB \u6578\u64da\u985e\u578b\u3002\u9019\u4e9b\u6578\u64da\u985e\u578b\u53ef\u4ee5\u5b58\u5132\u8d85\u904e 32K \u7684\u6578\u64da\uff0c\u5f9e\u800c\u907f\u514d\u51fa\u73fe\u6b64\u932f\u8aa4\u3002<\/p>\n<pre><code>CREATE TABLE example_table (\n    id NUMBER,\n    large_text CLOB\n);\n<\/code><\/pre>\n<h3 id=\"3-%e5%88%86%e6%89%b9%e8%99%95%e7%90%86%e6%95%b8%e6%93%9a-JUOaKGekMm\">3. \u5206\u6279\u8655\u7406\u6578\u64da<\/h3>\n<p>\u5982\u679c\u7121\u6cd5\u907f\u514d\u50b3\u905e\u8d85\u904e 32K \u7684\u6578\u64da\uff0c\u53ef\u4ee5\u8003\u616e\u5c07\u6578\u64da\u5206\u6279\u8655\u7406\u3002\u9019\u6a23\u53ef\u4ee5\u6e1b\u5c11\u6bcf\u6b21\u8acb\u6c42\u7684\u6578\u64da\u91cf\uff0c\u5f9e\u800c\u907f\u514d\u89f8\u767c\u932f\u8aa4\u3002<\/p>\n<pre><code>DECLARE\n    v_large_data CLOB;\nBEGIN\n    -- \u5047\u8a2d v_large_data \u5305\u542b\u8d85\u904e 32K \u7684\u6578\u64da\n    FOR i IN 1..CEIL(DBMS_LOB.GETLENGTH(v_large_data) \/ 32767) LOOP\n        -- \u6bcf\u6b21\u8655\u7406 32K \u7684\u6578\u64da\n        INSERT INTO example_table (id, large_text)\n        VALUES (i, DBMS_LOB.SUBSTR(v_large_data, 32767, (i - 1) * 32767 + 1));\n    END LOOP;\nEND;\n<\/code><\/pre>\n<h3 id=\"4-%e8%aa%bf%e6%95%b4%e6%87%89%e7%94%a8%e7%a8%8b%e5%ba%8f%e9%82%8f%e8%bc%af-JUOaKGekMm\">4. \u8abf\u6574\u61c9\u7528\u7a0b\u5e8f\u908f\u8f2f<\/h3>\n<p>\u6700\u5f8c\uff0c\u6aa2\u67e5\u61c9\u7528\u7a0b\u5e8f\u7684\u908f\u8f2f\uff0c\u78ba\u4fdd\u4e0d\u6703\u5728\u4e0d\u5fc5\u8981\u7684\u60c5\u6cc1\u4e0b\u50b3\u905e\u904e\u5927\u7684\u6578\u64da\u3002\u512a\u5316\u67e5\u8a62\u548c\u6578\u64da\u8655\u7406\u908f\u8f2f\uff0c\u53ef\u4ee5\u6709\u6548\u6e1b\u5c11\u51fa\u73fe\u6b64\u932f\u8aa4\u7684\u6a5f\u6703\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-JUOaKGekMm\">\u7d50\u8ad6<\/h2>\n<p>\u5728 Oracle \u6578\u64da\u5eab\u4e2d\uff0c<code>ORA-22828<\/code> \u932f\u8aa4\u662f\u4e00\u500b\u5e38\u898b\u7684\u554f\u984c\uff0c\u4e3b\u8981\u7531\u65bc\u8f38\u5165\u6a21\u5f0f\u6216\u66ff\u63db\u53c3\u6578\u8d85\u904e 32K \u7684\u5927\u5c0f\u9650\u5236\u6240\u5f15\u8d77\u3002\u901a\u904e\u6aa2\u67e5\u6578\u64da\u5927\u5c0f\u3001\u4f7f\u7528 LOB \u6578\u64da\u985e\u578b\u3001\u5206\u6279\u8655\u7406\u6578\u64da\u4ee5\u53ca\u8abf\u6574\u61c9\u7528\u7a0b\u5e8f\u908f\u8f2f\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u9019\u4e00\u554f\u984c\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> \u6216 <a href=\"https:\/\/server.hk\">\u9999\u6e2f\u4f3a\u670d\u5668<\/a> \u89e3\u6c7a\u65b9\u6848\u4e5f\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-22828 \u932f\u8aa4\uff0c\u4e86\u89e3\u8f38\u5165\u6a21\u5f0f\u6216\u66ff\u63db\u53c3\u6578\u8d85\u904e 32K \u5927\u5c0f\u9650\u5236\u7684\u539f\u56e0\u53ca\u9060\u7a0b\u8655\u7406\u65b9\u6cd5\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-87936","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87936","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=87936"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87936\/revisions"}],"predecessor-version":[{"id":87937,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/87936\/revisions\/87937"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=87936"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=87936"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=87936"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}