{"id":186388,"date":"2024-11-11T05:30:24","date_gmt":"2024-11-10T21:30:24","guid":{"rendered":"https:\/\/server.hk\/cnblog\/186388\/"},"modified":"2024-11-11T05:30:25","modified_gmt":"2024-11-10T21:30:25","slug":"%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84log%e6%a0%bc%e5%bc%8f%e8%a9%b3%e8%a7%a3%ef%bc%88%e6%95%b8%e6%93%9a%e5%ba%ablog%e6%a0%bc%e5%bc%8f%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/186388\/","title":{"rendered":"\u6578\u64da\u5eab\u7684log\u683c\u5f0f\u8a73\u89e3\uff08\u6578\u64da\u5eablog\u683c\u5f0f\uff09"},"content":{"rendered":"<h1 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e7%9a%84log%e6%a0%bc%e5%bc%8f%e8%a9%b3%e8%a7%a3%ef%bc%88%e6%95%b8%e6%93%9a%e5%ba%ablog%e6%a0%bc%e5%bc%8f%ef%bc%89-xInJNpopXr\">\u6578\u64da\u5eab\u7684log\u683c\u5f0f\u8a73\u89e3\uff08\u6578\u64da\u5eablog\u683c\u5f0f\uff09<\/h1>\n<p>\u5728\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u4e2d\uff0clog\u6587\u4ef6\u626e\u6f14\u8457\u81f3\u95dc\u91cd\u8981\u7684\u89d2\u8272\u3002\u9019\u4e9blog\u6587\u4ef6\u8a18\u9304\u4e86\u6578\u64da\u5eab\u7684\u6240\u6709\u64cd\u4f5c\uff0c\u7121\u8ad6\u662f\u6578\u64da\u7684\u63d2\u5165\u3001\u66f4\u65b0\u9084\u662f\u522a\u9664\uff0c\u5747\u6703\u88ab\u8a73\u7d30\u8a18\u9304\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u6578\u64da\u5eab\u7684log\u683c\u5f0f\uff0c\u5e6b\u52a9\u8b80\u8005\u7406\u89e3\u5176\u7d50\u69cb\u53ca\u529f\u80fd\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e6%95%b8%e6%93%9a%e5%ba%ablog%ef%bc%9f-xInJNpopXr\">\u4ec0\u9ebc\u662f\u6578\u64da\u5eablog\uff1f<\/h2>\n<p>\u6578\u64da\u5eablog\u662f\u7528\u4f86\u8a18\u9304\u6578\u64da\u5eab\u64cd\u4f5c\u7684\u6587\u4ef6\uff0c\u4e3b\u8981\u7528\u65bc\u6578\u64da\u6062\u5fa9\u3001\u6545\u969c\u6392\u9664\u53ca\u6027\u80fd\u5206\u6790\u3002\u7576\u6578\u64da\u5eab\u767c\u751f\u6545\u969c\u6642\uff0clog\u6587\u4ef6\u53ef\u4ee5\u5e6b\u52a9\u7ba1\u7406\u54e1\u6062\u5fa9\u5230\u6700\u8fd1\u7684\u7a69\u5b9a\u72c0\u614b\u3002\u9019\u4e9blog\u901a\u5e38\u5305\u62ec\u4e8b\u52d9\u7684\u958b\u59cb\u548c\u7d50\u675f\u3001\u6578\u64da\u7684\u8b8a\u66f4\u4ee5\u53ca\u5176\u4ed6\u91cd\u8981\u4e8b\u4ef6\u3002<\/p>\n<h2 id=\"log%e6%a0%bc%e5%bc%8f%e7%9a%84%e7%a8%ae%e9%a1%9e-xInJNpopXr\">log\u683c\u5f0f\u7684\u7a2e\u985e<\/h2>\n<p>\u6578\u64da\u5eab\u7684log\u683c\u5f0f\u53ef\u4ee5\u6839\u64da\u4e0d\u540c\u7684\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\u800c\u6709\u6240\u4e0d\u540c\u3002\u4ee5\u4e0b\u662f\u5e7e\u7a2e\u5e38\u898b\u7684log\u683c\u5f0f\uff1a<\/p>\n<ul>\n<li><strong>WAL\uff08Write-Ahead Logging\uff09<\/strong>: \u9019\u662f\u4e00\u7a2e\u5e38\u898b\u7684log\u683c\u5f0f\uff0c\u4e3b\u8981\u7528\u65bcPostgreSQL\u7b49\u6578\u64da\u5eab\u3002WAL\u7684\u7279\u9ede\u662f\u5148\u5c07\u8b8a\u66f4\u5beb\u5165log\uff0c\u7136\u5f8c\u518d\u66f4\u65b0\u6578\u64da\u9801\uff0c\u9019\u6a23\u53ef\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u4e00\u81f4\u6027\u3002<\/li>\n<li><strong>Redo Log<\/strong>: \u5728Oracle\u6578\u64da\u5eab\u4e2d\uff0cRedo Log\u7528\u65bc\u8a18\u9304\u6240\u6709\u5c0d\u6578\u64da\u7684\u8b8a\u66f4\uff0c\u4ee5\u4fbf\u5728\u7cfb\u7d71\u5d29\u6f70\u5f8c\u9032\u884c\u6062\u5fa9\u3002Redo Log\u7684\u683c\u5f0f\u901a\u5e38\u5305\u62ec\u4e8b\u52d9ID\u3001\u64cd\u4f5c\u985e\u578b\u53ca\u8b8a\u66f4\u7684\u6578\u64da\u3002<\/li>\n<li><strong>Binary Log<\/strong>: MySQL\u4f7f\u7528Binary Log\u4f86\u8a18\u9304\u6240\u6709\u66f4\u6539\u6578\u64da\u7684\u64cd\u4f5c\u3002\u9019\u4e9blog\u4e0d\u50c5\u7528\u65bc\u6062\u5fa9\u6578\u64da\uff0c\u9084\u53ef\u4ee5\u7528\u65bc\u8907\u88fd\u6578\u64da\u5230\u5176\u4ed6\u4f3a\u670d\u5668\u3002<\/li>\n<\/ul>\n<h2 id=\"log%e6%a0%bc%e5%bc%8f%e7%9a%84%e7%b5%90%e6%a7%8b-xInJNpopXr\">log\u683c\u5f0f\u7684\u7d50\u69cb<\/h2>\n<p>\u6578\u64da\u5eablog\u7684\u7d50\u69cb\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u5e7e\u500b\u90e8\u5206\uff1a<\/p>\n<ul>\n<li><strong>\u6642\u9593\u6233<\/strong>: \u6bcf\u4e00\u689dlog\u8a18\u9304\u90fd\u6703\u5305\u542b\u4e00\u500b\u6642\u9593\u6233\uff0c\u4ee5\u6a19\u8a18\u64cd\u4f5c\u767c\u751f\u7684\u6642\u9593\u3002<\/li>\n<li><strong>\u4e8b\u52d9ID<\/strong>: \u6bcf\u500b\u4e8b\u52d9\u90fd\u6703\u88ab\u5206\u914d\u4e00\u500b\u552f\u4e00\u7684ID\uff0c\u4ee5\u4fbf\u8ffd\u8e64\u548c\u7ba1\u7406\u3002<\/li>\n<li><strong>\u64cd\u4f5c\u985e\u578b<\/strong>: log\u4e2d\u6703\u8a18\u9304\u64cd\u4f5c\u7684\u985e\u578b\uff0c\u4f8b\u5982\u63d2\u5165\uff08INSERT\uff09\u3001\u66f4\u65b0\uff08UPDATE\uff09\u6216\u522a\u9664\uff08DELETE\uff09\u3002<\/li>\n<li><strong>\u6578\u64da\u8b8a\u66f4<\/strong>: \u5177\u9ad4\u7684\u6578\u64da\u8b8a\u66f4\u5167\u5bb9\uff0c\u901a\u5e38\u4ee5JSON\u6216\u5176\u4ed6\u683c\u5f0f\u8868\u793a\u3002<\/li>\n<\/ul>\n<h2 id=\"log%e7%9a%84%e6%87%89%e7%94%a8%e5%a0%b4%e6%99%af-xInJNpopXr\">log\u7684\u61c9\u7528\u5834\u666f<\/h2>\n<p>\u6578\u64da\u5eablog\u7684\u61c9\u7528\u5834\u666f\u975e\u5e38\u5ee3\u6cdb\uff0c\u4e3b\u8981\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u6062\u5fa9<\/strong>: \u5728\u7cfb\u7d71\u5d29\u6f70\u6216\u6578\u64da\u640d\u58de\u7684\u60c5\u6cc1\u4e0b\uff0clog\u6587\u4ef6\u53ef\u4ee5\u5e6b\u52a9\u6062\u5fa9\u5230\u6700\u8fd1\u7684\u7a69\u5b9a\u72c0\u614b\u3002<\/li>\n<li><strong>\u6545\u969c\u6392\u9664<\/strong>: \u901a\u904e\u5206\u6790log\u6587\u4ef6\uff0c\u7ba1\u7406\u54e1\u53ef\u4ee5\u5feb\u901f\u5b9a\u4f4d\u554f\u984c\uff0c\u9032\u884c\u6545\u969c\u6392\u9664\u3002<\/li>\n<li><strong>\u6027\u80fd\u5206\u6790<\/strong>: log\u6587\u4ef6\u53ef\u4ee5\u63d0\u4f9b\u6709\u95dc\u6578\u64da\u5eab\u6027\u80fd\u7684\u5bf6\u8cb4\u4fe1\u606f\uff0c\u5e6b\u52a9\u512a\u5316\u67e5\u8a62\u548c\u6578\u64da\u7d50\u69cb\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b5%90%e8%ab%96-xInJNpopXr\">\u7d50\u8ad6<\/h2>\n<p>\u6578\u64da\u5eab\u7684log\u683c\u5f0f\u662f\u6578\u64da\u5eab\u7ba1\u7406\u4e2d\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u90e8\u5206\u3002\u4e86\u89e3\u5176\u7d50\u69cb\u548c\u529f\u80fd\u4e0d\u50c5\u6709\u52a9\u65bc\u6578\u64da\u7684\u5b89\u5168\u6027\u548c\u5b8c\u6574\u6027\uff0c\u9084\u80fd\u63d0\u9ad8\u6578\u64da\u5eab\u7684\u6027\u80fd\u548c\u53ef\u7528\u6027\u3002\u96a8\u8457\u6578\u64da\u91cf\u7684\u589e\u9577\uff0c\u5c0dlog\u7684\u7ba1\u7406\u548c\u5206\u6790\u5c07\u8b8a\u5f97\u8d8a\u4f86\u8d8a\u91cd\u8981\u3002<\/p>\n<p>\u5982\u679c\u60a8\u5c0d\u65bc\u6578\u64da\u5eab\u7684log\u683c\u5f0f\u6709\u9032\u4e00\u6b65\u7684\u8208\u8da3\uff0c\u6216\u5e0c\u671b\u4e86\u89e3\u66f4\u591a\u95dc\u65bc<a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a>\u53ca\u5176\u5728\u6578\u64da\u5eab\u7ba1\u7406\u4e2d\u7684\u61c9\u7528\uff0c\u6b61\u8fce\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u4ee5\u7372\u53d6\u66f4\u591a\u8cc7\u8a0a\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6df1\u5165\u63a2\u8a0e\u6578\u64da\u5eab\u7684log\u683c\u5f0f\uff0c\u4e86\u89e3\u5176\u7d50\u69cb\u3001\u529f\u80fd\u53ca\u5728\u6578\u64da\u6062\u5fa9\u4e2d\u7684\u91cd\u8981\u6027\uff0c\u52a9\u60a8\u63d0\u5347\u6578\u64da\u7ba1\u7406\u6548\u7387\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-186388","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186388","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=186388"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186388\/revisions"}],"predecessor-version":[{"id":186389,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186388\/revisions\/186389"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=186388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=186388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=186388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}