{"id":5360,"date":"2024-11-14T11:58:14","date_gmt":"2024-11-14T03:58:14","guid":{"rendered":"https:\/\/fwq.ai\/blog\/5360\/"},"modified":"2024-11-14T11:58:14","modified_gmt":"2024-11-14T03:58:14","slug":"oracle%e7%b4%a2%e5%bc%95%e5%a4%b1%e6%95%88%e6%80%8e%e4%b9%88%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/5360\/","title":{"rendered":"oracle\u7d22\u5f15\u5931\u6548\u600e\u4e48\u5904\u7406"},"content":{"rendered":"<blockquote><p>\n  \u7d22\u5f15\u5931\u6548\u4f1a\u5bfc\u81f4\u67e5\u8be2\u6027\u80fd\u4e0b\u964d\uff0c\u4e3b\u8981\u539f\u56e0\u5305\u62ec\uff1a\u6570\u636e\u66f4\u65b0\u672a\u53ca\u65f6\u66f4\u65b0\u7d22\u5f15\u3002\u7d22\u5f15\u4e0a\u7684\u5217\u53d1\u751f\u53d8\u5316\u3002\u7d22\u5f15\u88ab\u6807\u8bb0\u4e3a\u4e0d\u53ef\u7528\u3002\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u8fc7\u65f6\u3002\u7d22\u5f15\u8bed\u6cd5\u9519\u8bef\u3002\u5176\u4ed6\u56e0\u7d20\uff08\u5982\u8868\u7a7a\u95f4\u635f\u574f\u6216\u6570\u636e\u5e93\u5b9e\u4f8b\u6545\u969c\uff09\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/26\/2024052620183575683.jpg\" class=\"aligncenter\" title=\"oracle\u7d22\u5f15\u5931\u6548\u600e\u4e48\u5904\u7406\u63d2\u56fe\" alt=\"oracle\u7d22\u5f15\u5931\u6548\u600e\u4e48\u5904\u7406\u63d2\u56fe\" \/><\/p>\n<p><strong>Oracle \u7d22\u5f15\u5931\u6548\u5904\u7406<\/strong><\/p>\n<p>\u5f53 Oracle \u7d22\u5f15\u5931\u6548\u65f6\uff0c\u67e5\u8be2\u6027\u80fd\u5c06\u5927\u5e45\u4e0b\u964d\u3002\u4e3b\u8981\u539f\u56e0\u5982\u4e0b\uff1a<\/p>\n<p><strong>1. \u6570\u636e\u66f4\u65b0\u672a\u53ca\u65f6\u66f4\u65b0\u7d22\u5f15<\/strong><\/p>\n<p>\u5f53\u6570\u636e\u8868\u4e2d\u7684\u6570\u636e\u66f4\u65b0\u65f6\uff0c\u76f8\u5e94\u7684\u7d22\u5f15\u672a\u53ca\u65f6\u66f4\u65b0\uff0c\u5bfc\u81f4\u7d22\u5f15\u4e0e\u6570\u636e\u8868\u4e0d\u4e00\u81f4\uff0c\u67e5\u8be2\u65f6\u65e0\u6cd5\u4f7f\u7528\u7d22\u5f15\u3002<\/p>\n<p><strong>\u5904\u7406\u65b9\u6cd5\uff1a<\/strong>\u4f7f\u7528 DDL \u547d\u4ee4\u91cd\u5efa\u7d22\u5f15\u4ee5\u5f3a\u5236 Oracle \u66f4\u65b0\u7d22\u5f15\u3002<\/p>\n<pre>ALTER INDEX index_name REBUILD;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u7d22\u5f15\u4e0a\u7684\u5217\u53d1\u751f\u53d8\u5316<\/strong><\/p>\n<p>\u5982\u679c\u7d22\u5f15\u4e0a\u7684\u5217\u6570\u636e\u7c7b\u578b\u6216\u957f\u5ea6\u53d1\u751f\u53d8\u5316\uff0c\u7d22\u5f15\u5c06\u5931\u6548\u3002<\/p>\n<p><strong>\u5904\u7406\u65b9\u6cd5\uff1a<\/strong>\u91cd\u5efa\u7d22\u5f15\u4ee5\u53cd\u6620\u5217\u7684\u53d8\u5316\u3002<\/p>\n<pre>ALTER INDEX index_name REBUILD;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u7d22\u5f15\u88ab\u6807\u8bb0\u4e3a\u4e0d\u53ef\u7528<\/strong><\/p>\n<p>\u5982\u679c\u7d22\u5f15\u5728\u521b\u5efa\u6216\u4fee\u6539\u540e\u88ab\u663e\u5f0f\u6807\u8bb0\u4e3a\u4e0d\u53ef\u7528\uff0c\u5219\u67e5\u8be2\u65f6\u5c06\u4e0d\u4f1a\u4f7f\u7528\u8be5\u7d22\u5f15\u3002<\/p>\n<p><strong>\u5904\u7406\u65b9\u6cd5\uff1a<\/strong>\u4f7f\u7528 ALTER INDEX \u547d\u4ee4\u542f\u7528\u7d22\u5f15\u3002<\/p>\n<pre>ALTER INDEX index_name ENABLE;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u8fc7\u65f6<\/strong><\/p>\n<p>\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\uff0c\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u53ef\u80fd\u4f1a\u8fc7\u65f6\uff0c\u5bfc\u81f4\u4f18\u5316\u5668\u505a\u51fa\u9519\u8bef\u7684\u51b3\u7b56\u3002<\/p>\n<p><strong>\u5904\u7406\u65b9\u6cd5\uff1a<\/strong>\u4f7f\u7528 ANALYZE \u547d\u4ee4\u66f4\u65b0\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u3002<\/p>\n<pre>ANALYZE TABLE table_name COMPUTE STATISTICS;<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>5. \u7d22\u5f15\u8bed\u6cd5\u9519\u8bef<\/strong><\/p>\n<p>\u5982\u679c\u7d22\u5f15\u7684\u521b\u5efa\u8bed\u53e5\u5b58\u5728\u8bed\u6cd5\u9519\u8bef\uff0c\u5219\u7d22\u5f15\u5c06\u5931\u6548\u3002<\/p>\n<p><strong>\u5904\u7406\u65b9\u6cd5\uff1a<\/strong>\u68c0\u67e5\u5e76\u4fee\u590d\u7d22\u5f15\u7684\u521b\u5efa\u8bed\u53e5\u3002<\/p>\n<pre>CREATE INDEX index_name ON table_name (column_name);<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>6. \u5176\u4ed6\u539f\u56e0<\/strong><\/p>\n<p>\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u7d22\u5f15\u5931\u6548\u53ef\u80fd\u662f\u7531\u5176\u4ed6\u56e0\u7d20\u9020\u6210\u7684\uff0c\u4f8b\u5982\u8868\u7a7a\u95f4\u635f\u574f\u6216\u6570\u636e\u5e93\u5b9e\u4f8b\u6545\u969c\u3002<\/p>\n<p><strong>\u5904\u7406\u65b9\u6cd5\uff1a<\/strong>\u6839\u636e\u5177\u4f53\u60c5\u51b5\u8fdb\u884c\u6545\u969c\u6392\u9664\uff0c\u4f8b\u5982\u4fee\u590d\u635f\u574f\u7684\u8868\u7a7a\u95f4\u6216\u91cd\u65b0\u542f\u52a8\u6570\u636e\u5e93\u5b9e\u4f8b\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u7d22\u5f15\u5931\u6548\u600e\u4e48\u5904\u7406\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d22\u5f15\u5931\u6548\u4f1a\u5bfc\u81f4\u67e5\u8be2\u6027\u80fd\u4e0b\u964d\uff0c\u4e3b\u8981\u539f\u56e0\u5305\u62ec\uff1a\u6570\u636e\u66f4\u65b0\u672a\u53ca\u65f6\u66f4\u65b0\u7d22\u5f15\u3002\u7d22\u5f15\u4e0a\u7684\u5217\u53d1\u751f\u53d8\u5316\u3002\u7d22\u5f15\u88ab\u6807\u8bb0\u4e3a\u4e0d\u53ef\u7528\u3002\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u8fc7\u65f6\u3002\u7d22\u5f15\u8bed\u6cd5\u9519\u8bef\u3002\u5176\u4ed6\u56e0\u7d20\uff08\u5982\u8868\u7a7a\u95f4\u635f\u574f\u6216\u6570\u636e\u5e93\u5b9e\u4f8b\u6545\u969c\uff09\u3002 Oracle \u7d22\u5f15\u5931\u6548\u5904\u7406 \u5f53 Oracle \u7d22\u5f15\u5931\u6548\u65f6\uff0c\u67e5\u8be2\u6027\u80fd\u5c06\u5927\u5e45\u4e0b\u964d\u3002\u4e3b\u8981\u539f\u56e0\u5982\u4e0b\uff1a 1. \u6570\u636e\u66f4\u65b0\u672a\u53ca\u65f6\u66f4\u65b0\u7d22\u5f15 \u5f53\u6570\u636e\u8868\u4e2d\u7684\u6570\u636e\u66f4\u65b0\u65f6\uff0c\u76f8\u5e94\u7684\u7d22\u5f15\u672a\u53ca\u65f6\u66f4\u65b0\uff0c\u5bfc\u81f4\u7d22\u5f15\u4e0e\u6570\u636e\u8868\u4e0d\u4e00\u81f4\uff0c\u67e5\u8be2\u65f6\u65e0\u6cd5\u4f7f\u7528\u7d22\u5f15\u3002 \u5904\u7406\u65b9\u6cd5\uff1a\u4f7f\u7528 DDL \u547d\u4ee4\u91cd\u5efa\u7d22\u5f15\u4ee5\u5f3a\u5236 Oracle \u66f4\u65b0\u7d22\u5f15\u3002 ALTER INDEX index_name REBUILD; \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 2. \u7d22\u5f15\u4e0a\u7684\u5217\u53d1\u751f\u53d8\u5316 \u5982\u679c\u7d22\u5f15\u4e0a\u7684\u5217\u6570\u636e\u7c7b\u578b\u6216\u957f\u5ea6\u53d1\u751f\u53d8\u5316\uff0c\u7d22\u5f15\u5c06\u5931\u6548\u3002 \u5904\u7406\u65b9\u6cd5\uff1a\u91cd\u5efa\u7d22\u5f15\u4ee5\u53cd\u6620\u5217\u7684\u53d8\u5316\u3002 ALTER INDEX index_name REBUILD; \u767b\u5f55\u540e\u590d\u5236 \u767b\u5f55\u540e\u590d\u5236 3. \u7d22\u5f15\u88ab\u6807\u8bb0\u4e3a\u4e0d\u53ef\u7528 \u5982\u679c\u7d22\u5f15\u5728\u521b\u5efa\u6216\u4fee\u6539\u540e\u88ab\u663e\u5f0f\u6807\u8bb0\u4e3a\u4e0d\u53ef\u7528\uff0c\u5219\u67e5\u8be2\u65f6\u5c06\u4e0d\u4f1a\u4f7f\u7528\u8be5\u7d22\u5f15\u3002 \u5904\u7406\u65b9\u6cd5\uff1a\u4f7f\u7528 ALTER INDEX \u547d\u4ee4\u542f\u7528\u7d22\u5f15\u3002 ALTER INDEX index_name ENABLE; \u767b\u5f55\u540e\u590d\u5236 4. \u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u8fc7\u65f6 \u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\uff0c\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u53ef\u80fd\u4f1a\u8fc7\u65f6\uff0c\u5bfc\u81f4\u4f18\u5316\u5668\u505a\u51fa\u9519\u8bef\u7684\u51b3\u7b56\u3002 \u5904\u7406\u65b9\u6cd5\uff1a\u4f7f\u7528 ANALYZE \u547d\u4ee4\u66f4\u65b0\u7d22\u5f15\u7edf\u8ba1\u4fe1\u606f\u3002 ANALYZE TABLE table_name COMPUTE STATISTICS; \u767b\u5f55\u540e\u590d\u5236 5. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-5360","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=5360"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/5360\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=5360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=5360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=5360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}