{"id":88878,"date":"2024-10-18T10:12:18","date_gmt":"2024-10-18T02:12:18","guid":{"rendered":"https:\/\/server.hk\/cnblog\/88878\/"},"modified":"2024-10-18T10:12:19","modified_gmt":"2024-10-18T02:12:19","slug":"ora-25122-%e5%83%85%e5%85%81%e8%a8%b1%e5%9c%a8%e5%88%86%e5%8d%80%e8%a1%a8%e4%b8%8a%e4%bd%bf%e7%94%a8-local-%e4%bd%8d%e5%9c%96%e7%b4%a2%e5%bc%95-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/88878\/","title":{"rendered":"ORA-25122: \u50c5\u5141\u8a31\u5728\u5206\u5340\u8868\u4e0a\u4f7f\u7528 LOCAL \u4f4d\u5716\u7d22\u5f15 ORACLE \u5831\u932f \u6545\u969c\u4fee\u5fa9 \u9060\u7a0b\u8655\u7406"},"content":{"rendered":"<h1 id=\"ora-25122-%e5%83%85%e5%85%81%e8%a8%b1%e5%9c%a8%e5%88%86%e5%8d%80%e8%a1%a8%e4%b8%8a%e4%bd%bf%e7%94%a8-local-%e4%bd%8d%e5%9c%96%e7%b4%a2%e5%bc%95-oracle-%e5%a0%b1%e9%8c%af-%e6%95%85%e9%9a%9c%e4%bf%ae-dqDxJjQnVs\">ORA-25122: \u50c5\u5141\u8a31\u5728\u5206\u5340\u8868\u4e0a\u4f7f\u7528 LOCAL \u4f4d\u5716\u7d22\u5f15 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-25122<\/code>\u3002\u9019\u500b\u932f\u8aa4\u901a\u5e38\u51fa\u73fe\u5728\u5617\u8a66\u5728\u975e\u5206\u5340\u8868\u4e0a\u5275\u5efa LOCAL \u4f4d\u5716\u7d22\u5f15\u6642\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-dqDxJjQnVs\">\u932f\u8aa4\u539f\u56e0<\/h2>\n<p>\u7576\u4f60\u5728 Oracle \u6578\u64da\u5eab\u4e2d\u5275\u5efa\u4f4d\u5716\u7d22\u5f15\u6642\uff0c\u53ef\u4ee5\u9078\u64c7\u4f7f\u7528 LOCAL \u6216 GLOBAL \u7d22\u5f15\u3002LOCAL \u4f4d\u5716\u7d22\u5f15\u50c5\u80fd\u5728\u5206\u5340\u8868\u4e0a\u4f7f\u7528\uff0c\u56e0\u70ba\u5b83\u662f\u91dd\u5c0d\u6bcf\u500b\u5206\u5340\u9032\u884c\u7d22\u5f15\u7684\u3002\u7576\u4f60\u5617\u8a66\u5728\u4e00\u500b\u975e\u5206\u5340\u8868\u4e0a\u5275\u5efa LOCAL \u4f4d\u5716\u7d22\u5f15\u6642\uff0cOracle \u6703\u8fd4\u56de <code>ORA-25122<\/code> \u932f\u8aa4\uff0c\u63d0\u793a\u300c\u50c5\u5141\u8a31\u5728\u5206\u5340\u8868\u4e0a\u4f7f\u7528 LOCAL \u4f4d\u5716\u7d22\u5f15\u300d\u3002<\/p>\n<h2 id=\"%e5%bd%b1%e9%9f%bf-dqDxJjQnVs\">\u5f71\u97ff<\/h2>\n<p>\u9019\u500b\u932f\u8aa4\u6703\u5c0e\u81f4\u6578\u64da\u5eab\u64cd\u4f5c\u5931\u6557\uff0c\u5f71\u97ff\u61c9\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u7a69\u5b9a\u6027\u3002\u7279\u5225\u662f\u5728\u9700\u8981\u9ad8\u6548\u67e5\u8a62\u7684\u60c5\u6cc1\u4e0b\uff0c\u7121\u6cd5\u4f7f\u7528\u4f4d\u5716\u7d22\u5f15\u53ef\u80fd\u6703\u5c0e\u81f4\u67e5\u8a62\u901f\u5ea6\u8b8a\u6162\uff0c\u5f9e\u800c\u5f71\u97ff\u7528\u6236\u9ad4\u9a57\u3002<\/p>\n<h2 id=\"%e6%95%85%e9%9a%9c%e4%bf%ae%e5%be%a9%e6%ad%a5%e9%a9%9f-dqDxJjQnVs\">\u6545\u969c\u4fee\u5fa9\u6b65\u9a5f<\/h2>\n<p>\u8981\u4fee\u5fa9 <code>ORA-25122<\/code> \u932f\u8aa4\uff0c\u60a8\u53ef\u4ee5\u8003\u616e\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e6%aa%a2%e6%9f%a5%e8%a1%a8%e7%9a%84%e5%88%86%e5%8d%80%e7%8b%80%e6%85%8b-dqDxJjQnVs\">1. \u6aa2\u67e5\u8868\u7684\u5206\u5340\u72c0\u614b<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u78ba\u8a8d\u60a8\u5617\u8a66\u5275\u5efa\u7d22\u5f15\u7684\u8868\u662f\u5426\u70ba\u5206\u5340\u8868\u3002\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b SQL \u67e5\u8a62\u4f86\u6aa2\u67e5\uff1a<\/p>\n<pre><code>SELECT table_name, partitioned FROM user_tables WHERE table_name = 'YOUR_TABLE_NAME';<\/code><\/pre>\n<p>\u5982\u679c\u8fd4\u56de\u7684\u7d50\u679c\u986f\u793a\u8a72\u8868\u4e0d\u662f\u5206\u5340\u8868\uff0c\u5247\u60a8\u7121\u6cd5\u4f7f\u7528 LOCAL \u4f4d\u5716\u7d22\u5f15\u3002<\/p>\n<h3 id=\"2-%e4%bd%bf%e7%94%a8-global-%e4%bd%8d%e5%9c%96%e7%b4%a2%e5%bc%95-dqDxJjQnVs\">2. \u4f7f\u7528 GLOBAL \u4f4d\u5716\u7d22\u5f15<\/h3>\n<p>\u5982\u679c\u8a72\u8868\u4e0d\u662f\u5206\u5340\u8868\uff0c\u60a8\u53ef\u4ee5\u8003\u616e\u4f7f\u7528 GLOBAL \u4f4d\u5716\u7d22\u5f15\u3002\u9019\u6a23\u53ef\u4ee5\u907f\u514d <code>ORA-25122<\/code> \u932f\u8aa4\u3002\u5275\u5efa GLOBAL \u4f4d\u5716\u7d22\u5f15\u7684 SQL \u8a9e\u53e5\u5982\u4e0b\uff1a<\/p>\n<pre><code>CREATE INDEX your_index_name ON your_table_name(column_name) INDEXTYPE IS BITMAP;<\/code><\/pre>\n<h3 id=\"3-%e5%b0%87%e8%a1%a8%e8%bd%89%e6%8f%9b%e7%82%ba%e5%88%86%e5%8d%80%e8%a1%a8-dqDxJjQnVs\">3. \u5c07\u8868\u8f49\u63db\u70ba\u5206\u5340\u8868<\/h3>\n<p>\u5982\u679c\u60a8\u5e0c\u671b\u4f7f\u7528 LOCAL \u4f4d\u5716\u7d22\u5f15\uff0c\u5247\u9700\u8981\u5c07\u8868\u8f49\u63db\u70ba\u5206\u5340\u8868\u3002\u9019\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u6b65\u9a5f\u5be6\u73fe\uff1a<\/p>\n<ul>\n<li>\u9996\u5148\uff0c\u5275\u5efa\u4e00\u500b\u65b0\u7684\u5206\u5340\u8868\u3002<\/li>\n<li>\u7136\u5f8c\uff0c\u5c07\u6578\u64da\u5f9e\u539f\u59cb\u8868\u63d2\u5165\u5230\u65b0\u5206\u5340\u8868\u4e2d\u3002<\/li>\n<li>\u6700\u5f8c\uff0c\u522a\u9664\u539f\u59cb\u8868\u4e26\u91cd\u547d\u540d\u65b0\u8868\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0b\u662f\u4e00\u500b\u7c21\u55ae\u7684\u793a\u4f8b\uff1a<\/p>\n<pre><code>CREATE TABLE new_partitioned_table (\n    id NUMBER,\n    name VARCHAR2(100)\n) PARTITION BY RANGE (id) (\n    PARTITION p1 VALUES LESS THAN (100),\n    PARTITION p2 VALUES LESS THAN (200)\n);\n\nINSERT INTO new_partitioned_table SELECT * FROM original_table;\n\nDROP TABLE original_table;\n\nALTER TABLE new_partitioned_table RENAME TO original_table;<\/code><\/pre>\n<h2 id=\"%e7%b5%90%e8%ab%96-dqDxJjQnVs\">\u7d50\u8ad6<\/h2>\n<p>\u5728 Oracle \u6578\u64da\u5eab\u4e2d\uff0c<code>ORA-25122<\/code> \u932f\u8aa4\u662f\u7531\u65bc\u5617\u8a66\u5728\u975e\u5206\u5340\u8868\u4e0a\u5275\u5efa LOCAL \u4f4d\u5716\u7d22\u5f15\u6240\u5f15\u8d77\u7684\u3002\u901a\u904e\u6aa2\u67e5\u8868\u7684\u5206\u5340\u72c0\u614b\u3001\u4f7f\u7528 GLOBAL \u4f4d\u5716\u7d22\u5f15\u6216\u5c07\u8868\u8f49\u63db\u70ba\u5206\u5340\u8868\uff0c\u53ef\u4ee5\u6709\u6548\u5730\u89e3\u6c7a\u6b64\u554f\u984c\u3002\u4e86\u89e3\u9019\u4e9b\u932f\u8aa4\u53ca\u5176\u89e3\u6c7a\u65b9\u6848\u5c0d\u65bc\u6578\u64da\u5eab\u7ba1\u7406\u548c\u6027\u80fd\u512a\u5316\u81f3\u95dc\u91cd\u8981\u3002<\/p>\n<p>\u5982\u9700\u9032\u4e00\u6b65\u4e86\u89e3\u6709\u95dc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u548c\u5176\u4ed6\u6578\u64da\u5eab\u7ba1\u7406\u89e3\u6c7a\u65b9\u6848\u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u6c7a ORA-25122 \u932f\u8aa4\uff0c\u4e86\u89e3\u50c5\u5141\u8a31\u5728\u5206\u5340\u8868\u4e0a\u4f7f\u7528 LOCAL \u4f4d\u5716\u7d22\u5f15\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-88878","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/88878","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=88878"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/88878\/revisions"}],"predecessor-version":[{"id":88879,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/88878\/revisions\/88879"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=88878"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=88878"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=88878"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}