{"id":247323,"date":"2024-01-02T20:25:20","date_gmt":"2024-01-02T12:25:20","guid":{"rendered":"https:\/\/www.idc.net\/help\/247323\/"},"modified":"2024-01-02T20:25:20","modified_gmt":"2024-01-02T12:25:20","slug":"%e5%a6%82%e4%bd%95%e4%bf%ae%e5%a4%8dpostgresql%e9%94%99%e8%af%af%e4%bb%a3%e7%a0%81%ef%bc%9axx002-index_corrupted%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/247323\/","title":{"rendered":"\u5982\u4f55\u4fee\u590dPostgreSQL\u9519\u8bef\u4ee3\u7801\uff1aXX002 &#8211; index_corrupted\uff1f"},"content":{"rendered":"<p><title id=\"%e5%a6%82%e4%bd%95%e4%bf%ae%e5%a4%8dpostgresql%e9%94%99%e8%af%af%e4%bb%a3%e7%a0%81%ef%bc%9axx002-index_corrupted%ef%bc%9f-JtOlDkcMjU\">\u5982\u4f55\u4fee\u590dPostgreSQL\u9519\u8bef\u4ee3\u7801\uff1aXX002 - index_corrupted\uff1f<\/title><\/p>\n<h1 id=\"%e5%a6%82%e4%bd%95%e4%bf%ae%e5%a4%8dpostgresql%e9%94%99%e8%af%af%e4%bb%a3%e7%a0%81%ef%bc%9axx002-index_corrupted%ef%bc%9f-JtOlDkcMjU\">\u5982\u4f55\u4fee\u590dPostgreSQL\u9519\u8bef\u4ee3\u7801\uff1aXX002 - index_corrupted\uff1f<\/h1>\n<p>PostgreSQL\u662f\u4e00\u79cd\u6d41\u884c\u7684\u5f00\u6e90\u5173\u7cfb\u578b\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u88ab\u5e7f\u6cdb\u7528\u4e8e\u5404\u79cd\u5e94\u7528\u7a0b\u5e8f\u548c\u7f51\u7ad9\u3002\u7136\u800c\uff0c\u6709\u65f6\u5019\u5728\u4f7f\u7528PostgreSQL\u65f6\uff0c\u60a8\u53ef\u80fd\u4f1a\u9047\u5230\u9519\u8bef\u4ee3\u7801XX002 - index_corrupted\u3002\u8fd9\u4e2a\u9519\u8bef\u4ee3\u7801\u8868\u793a\u6570\u636e\u5e93\u4e2d\u7684\u7d22\u5f15\u5df2\u635f\u574f\uff0c\u9700\u8981\u4fee\u590d\u624d\u80fd\u7ee7\u7eed\u6b63\u5e38\u4f7f\u7528\u3002<\/p>\n<h2 id=\"%e4%ba%86%e8%a7%a3%e9%94%99%e8%af%af%e4%bb%a3%e7%a0%81xx002-index_corrupted-JtOlDkcMjU\">\u4e86\u89e3\u9519\u8bef\u4ee3\u7801XX002 - index_corrupted<\/h2>\n<p>\u9519\u8bef\u4ee3\u7801XX002 - index_corrupted\u8868\u793a\u6570\u636e\u5e93\u4e2d\u7684\u7d22\u5f15\u5df2\u635f\u574f\u3002\u7d22\u5f15\u662f\u7528\u4e8e\u52a0\u5feb\u6570\u636e\u5e93\u67e5\u8be2\u901f\u5ea6\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5f53\u7d22\u5f15\u635f\u574f\u65f6\uff0c\u6570\u636e\u5e93\u7684\u6027\u80fd\u548c\u7a33\u5b9a\u6027\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002<\/p>\n<h2 id=\"%e4%bf%ae%e5%a4%8dpostgresql%e9%94%99%e8%af%af%e4%bb%a3%e7%a0%81xx002-index_corrupted%e7%9a%84%e6%96%b9%e6%b3%95-JtOlDkcMjU\">\u4fee\u590dPostgreSQL\u9519\u8bef\u4ee3\u7801XX002 - index_corrupted\u7684\u65b9\u6cd5<\/h2>\n<p>\u4fee\u590dPostgreSQL\u9519\u8bef\u4ee3\u7801XX002 - index_corrupted\u7684\u65b9\u6cd5\u6709\u591a\u79cd\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5e38\u89c1\u7684\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<h3 id=\"1-%e9%87%8d%e6%96%b0%e5%88%9b%e5%bb%ba%e7%b4%a2%e5%bc%95-JtOlDkcMjU\">1. \u91cd\u65b0\u521b\u5efa\u7d22\u5f15<\/h3>\n<p>\u9996\u5148\uff0c\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u65b0\u521b\u5efa\u635f\u574f\u7684\u7d22\u5f15\u3002\u53ef\u4ee5\u4f7f\u7528PostgreSQL\u63d0\u4f9b\u7684REINDEX\u547d\u4ee4\u6765\u91cd\u65b0\u521b\u5efa\u7d22\u5f15\u3002\u8be5\u547d\u4ee4\u4f1a\u5220\u9664\u73b0\u6709\u7684\u7d22\u5f15\u5e76\u91cd\u65b0\u6784\u5efa\u4e00\u4e2a\u65b0\u7684\u7d22\u5f15\u3002<\/p>\n<pre><code>REINDEX INDEX index_name;<\/code><\/pre>\n<p>\u8bf7\u5c06<code>index_name<\/code>\u66ff\u6362\u4e3a\u5b9e\u9645\u7684\u7d22\u5f15\u540d\u79f0\u3002<\/p>\n<h3 id=\"2-%e6%81%a2%e5%a4%8d%e6%95%b0%e6%8d%ae%e5%ba%93%e5%a4%87%e4%bb%bd-JtOlDkcMjU\">2. \u6062\u590d\u6570\u636e\u5e93\u5907\u4efd<\/h3>\n<p>\u5982\u679c\u91cd\u65b0\u521b\u5efa\u7d22\u5f15\u65e0\u6cd5\u89e3\u51b3\u95ee\u9898\uff0c\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528\u6570\u636e\u5e93\u7684\u5907\u4efd\u6765\u6062\u590d\u6570\u636e\u3002\u9996\u5148\uff0c\u60a8\u9700\u8981\u627e\u5230\u6700\u8fd1\u7684\u53ef\u7528\u5907\u4efd\uff0c\u5e76\u5c06\u5176\u8fd8\u539f\u5230\u4e00\u4e2a\u65b0\u7684\u6570\u636e\u5e93\u4e2d\u3002\u7136\u540e\uff0c\u60a8\u53ef\u4ee5\u5c06\u635f\u574f\u7684\u6570\u636e\u5e93\u4e0e\u65b0\u7684\u6570\u636e\u5e93\u8fdb\u884c\u6bd4\u8f83\uff0c\u4ee5\u786e\u5b9a\u7d22\u5f15\u7684\u5dee\u5f02\uff0c\u5e76\u5c1d\u8bd5\u4fee\u590d\u635f\u574f\u7684\u7d22\u5f15\u3002<\/p>\n<h3 id=\"3-%e4%bd%bf%e7%94%a8pg_resetxlog%e5%b7%a5%e5%85%b7-JtOlDkcMjU\">3. \u4f7f\u7528pg_resetxlog\u5de5\u5177<\/h3>\n<p>\u5982\u679c\u4ee5\u4e0a\u65b9\u6cd5\u90fd\u65e0\u6cd5\u4fee\u590d\u9519\u8bef\u4ee3\u7801XX002 - index_corrupted\uff0c\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u4f7f\u7528PostgreSQL\u63d0\u4f9b\u7684pg_resetxlog\u5de5\u5177\u3002\u8be5\u5de5\u5177\u53ef\u4ee5\u91cd\u7f6e\u6570\u636e\u5e93\u7684\u4e8b\u52a1\u65e5\u5fd7\uff0c\u4ee5\u4fee\u590d\u7d22\u5f15\u548c\u5176\u4ed6\u76f8\u5173\u95ee\u9898\u3002<\/p>\n<pre><code>pg_resetxlog -D \/path\/to\/database<\/code><\/pre>\n<p>\u8bf7\u5c06<code>\/path\/to\/database<\/code>\u66ff\u6362\u4e3a\u5b9e\u9645\u7684\u6570\u636e\u5e93\u8def\u5f84\u3002<\/p>\n<h2 id=\"%e6%80%bb%e7%bb%93-JtOlDkcMjU\">\u603b\u7ed3<\/h2>\n<p>\u5728\u4f7f\u7528PostgreSQL\u65f6\uff0c\u9519\u8bef\u4ee3\u7801XX002 - index_corrupted\u53ef\u80fd\u4f1a\u51fa\u73b0\uff0c\u8868\u793a\u6570\u636e\u5e93\u4e2d\u7684\u7d22\u5f15\u5df2\u635f\u574f\u3002\u4e3a\u4e86\u4fee\u590d\u8fd9\u4e2a\u95ee\u9898\uff0c\u60a8\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u65b0\u521b\u5efa\u7d22\u5f15\u3001\u6062\u590d\u6570\u636e\u5e93\u5907\u4efd\u6216\u4f7f\u7528pg_resetxlog\u5de5\u5177\u3002\u9009\u62e9\u9002\u5408\u60a8\u60c5\u51b5\u7684\u65b9\u6cd5\uff0c\u5e76\u786e\u4fdd\u5728\u64cd\u4f5c\u4e4b\u524d\u5907\u4efd\u6570\u636e\u5e93\u4ee5\u9632\u4e07\u4e00\u3002<\/p>\n<p>\u5982\u679c\u60a8\u6b63\u5728\u5bfb\u627e\u53ef\u9760\u7684\u9999\u6e2f\u670d\u52a1\u5668\u4f9b\u5e94\u5546\uff0c\u540e\u6d6a\u4e91\u662f\u60a8\u7684\u9996\u9009\u3002\u6211\u4eec\u63d0\u4f9b\u9ad8\u6027\u80fd\u7684\u9999\u6e2f\u670d\u52a1\u5668\uff0c\u53ef\u6ee1\u8db3\u5404\u79cd\u9700\u6c42\u3002\u8bf7\u8bbf\u95ee\u6211\u4eec\u7684\u5b98\u7f51\u4e86\u89e3\u66f4\u591a\u4fe1\u606f\uff1a<a href=\"https:\/\/idc.net\">https:\/\/idc.net<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5982\u4f55\u4fee\u590dPostgreSQL\u9519\u8bef\u4ee3\u7801\uff1aXX002 - index_corrupted\uff1f \u5982\u4f55\u4fee\u590dPostgre [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7038],"tags":[],"class_list":["post-247323","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/247323","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=247323"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/247323\/revisions"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=247323"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=247323"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=247323"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}