{"id":186686,"date":"2024-11-11T07:59:26","date_gmt":"2024-11-10T23:59:26","guid":{"rendered":"https:\/\/server.hk\/cnblog\/186686\/"},"modified":"2024-11-11T07:59:27","modified_gmt":"2024-11-10T23:59:27","slug":"%e6%95%b8%e6%93%9a%e5%ba%ab%e5%9b%9e%e6%bb%be%e6%97%a5%e8%aa%8c%e5%8a%9f%e8%83%bd%e5%8f%8a%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95-%e6%95%b8%e6%93%9a%e5%ba%ab-%e5%9b%9e%e6%bb%be%e6%97%a5%e8%aa%8c","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/186686\/","title":{"rendered":"\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\u529f\u80fd\u53ca\u4f7f\u7528\u65b9\u6cd5 (\u6578\u64da\u5eab \u56de\u6efe\u65e5\u8a8c)"},"content":{"rendered":"<h1 id=\"%e6%95%b8%e6%93%9a%e5%ba%ab%e5%9b%9e%e6%bb%be%e6%97%a5%e8%aa%8c%e5%8a%9f%e8%83%bd%e5%8f%8a%e4%bd%bf%e7%94%a8%e6%96%b9%e6%b3%95-%e6%95%b8%e6%93%9a%e5%ba%ab-%e5%9b%9e%e6%bb%be%e6%97%a5%e8%aa%8c-DepkffASHD\">\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\u529f\u80fd\u53ca\u4f7f\u7528\u65b9\u6cd5 (\u6578\u64da\u5eab \u56de\u6efe\u65e5\u8a8c)<\/h1>\n<p>\u5728\u73fe\u4ee3\u7684\u6578\u64da\u5eab\u7ba1\u7406\u4e2d\uff0c\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u53ef\u9760\u6027\u81f3\u95dc\u91cd\u8981\u3002\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\uff08Transaction Log\uff09\u662f\u4e00\u7a2e\u95dc\u9375\u7684\u529f\u80fd\uff0c\u80fd\u5920\u5e6b\u52a9\u7ba1\u7406\u54e1\u5728\u6578\u64da\u640d\u58de\u6216\u610f\u5916\u932f\u8aa4\u7684\u60c5\u6cc1\u4e0b\u6062\u5fa9\u6578\u64da\u3002\u672c\u6587\u5c07\u6df1\u5165\u63a2\u8a0e\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\u7684\u529f\u80fd\u53ca\u5176\u4f7f\u7528\u65b9\u6cd5\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e6%95%b8%e6%93%9a%e5%ba%ab%e5%9b%9e%e6%bb%be%e6%97%a5%e8%aa%8c%ef%bc%9f-DepkffASHD\">\u4ec0\u9ebc\u662f\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\uff1f<\/h2>\n<p>\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\u662f\u4e00\u7a2e\u8a18\u9304\u6578\u64da\u5eab\u64cd\u4f5c\u7684\u65e5\u8a8c\u6587\u4ef6\u3002\u5b83\u8a18\u9304\u4e86\u6240\u6709\u5c0d\u6578\u64da\u5eab\u9032\u884c\u7684\u4fee\u6539\uff0c\u5305\u62ec\u63d2\u5165\u3001\u66f4\u65b0\u548c\u522a\u9664\u64cd\u4f5c\u3002\u9019\u4e9b\u65e5\u8a8c\u4e0d\u50c5\u7528\u65bc\u6578\u64da\u6062\u5fa9\uff0c\u9084\u80fd\u5920\u652f\u6301\u6578\u64da\u5eab\u7684\u4e8b\u52d9\u7ba1\u7406\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\u3002<\/p>\n<h2 id=\"%e5%9b%9e%e6%bb%be%e6%97%a5%e8%aa%8c%e7%9a%84%e5%8a%9f%e8%83%bd-DepkffASHD\">\u56de\u6efe\u65e5\u8a8c\u7684\u529f\u80fd<\/h2>\n<ul>\n<li><strong>\u6578\u64da\u6062\u5fa9\uff1a<\/strong>\u7576\u6578\u64da\u5eab\u767c\u751f\u6545\u969c\u6216\u6578\u64da\u640d\u58de\u6642\uff0c\u56de\u6efe\u65e5\u8a8c\u53ef\u4ee5\u5e6b\u52a9\u6062\u5fa9\u5230\u6700\u8fd1\u7684\u7a69\u5b9a\u72c0\u614b\u3002<\/li>\n<li><strong>\u4e8b\u52d9\u7ba1\u7406\uff1a<\/strong>\u56de\u6efe\u65e5\u8a8c\u652f\u6301\u4e8b\u52d9\u7684\u539f\u5b50\u6027\uff0c\u78ba\u4fdd\u6240\u6709\u64cd\u4f5c\u8981\u9ebc\u5168\u90e8\u6210\u529f\uff0c\u8981\u9ebc\u5168\u90e8\u5931\u6557\u3002<\/li>\n<li><strong>\u6027\u80fd\u512a\u5316\uff1a<\/strong>\u901a\u904e\u8a18\u9304\u64cd\u4f5c\uff0c\u6578\u64da\u5eab\u53ef\u4ee5\u5728\u9700\u8981\u6642\u5feb\u901f\u56de\u6efe\u5230\u67d0\u500b\u72c0\u614b\uff0c\u5f9e\u800c\u63d0\u9ad8\u6027\u80fd\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8%e6%95%b8%e6%93%9a%e5%ba%ab%e5%9b%9e%e6%bb%be%e6%97%a5%e8%aa%8c-DepkffASHD\">\u5982\u4f55\u4f7f\u7528\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c<\/h2>\n<p>\u4f7f\u7528\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\u7684\u904e\u7a0b\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u5e7e\u500b\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"1-%e5%95%9f%e7%94%a8%e5%9b%9e%e6%bb%be%e6%97%a5%e8%aa%8c-DepkffASHD\">1. \u555f\u7528\u56de\u6efe\u65e5\u8a8c<\/h3>\n<p>\u5728\u5927\u591a\u6578\u6578\u64da\u5eab\u7cfb\u7d71\u4e2d\uff0c\u56de\u6efe\u65e5\u8a8c\u662f\u9ed8\u8a8d\u555f\u7528\u7684\uff0c\u4f46\u7528\u6236\u4ecd\u9700\u78ba\u8a8d\u5176\u8a2d\u7f6e\u3002\u4ee5 MySQL \u70ba\u4f8b\uff0c\u53ef\u4ee5\u901a\u904e\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5\u65e5\u8a8c\u72c0\u614b\uff1a<\/p>\n<pre><code>SHOW VARIABLES LIKE 'log_bin';<\/code><\/pre>\n<p>\u5982\u679c\u8fd4\u56de\u503c\u70ba &#8216;ON&#8217;\uff0c\u5247\u8868\u793a\u56de\u6efe\u65e5\u8a8c\u5df2\u555f\u7528\u3002<\/p>\n<h3 id=\"2-%e9%80%b2%e8%a1%8c%e6%95%b8%e6%93%9a%e6%93%8d%e4%bd%9c-DepkffASHD\">2. \u9032\u884c\u6578\u64da\u64cd\u4f5c<\/h3>\n<p>\u5728\u9032\u884c\u6578\u64da\u64cd\u4f5c\u6642\uff0c\u6240\u6709\u7684\u8b8a\u66f4\u90fd\u6703\u81ea\u52d5\u8a18\u9304\u5230\u56de\u6efe\u65e5\u8a8c\u4e2d\u3002\u4f8b\u5982\uff0c\u57f7\u884c\u4e00\u500b\u63d2\u5165\u64cd\u4f5c\uff1a<\/p>\n<pre><code>INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com');<\/code><\/pre>\n<h3 id=\"3-%e6%95%b8%e6%93%9a%e6%81%a2%e5%be%a9-DepkffASHD\">3. \u6578\u64da\u6062\u5fa9<\/h3>\n<p>\u5982\u679c\u767c\u751f\u932f\u8aa4\u6216\u6545\u969c\uff0c\u53ef\u4ee5\u4f7f\u7528\u56de\u6efe\u65e5\u8a8c\u4f86\u6062\u5fa9\u6578\u64da\u3002\u4ee5 SQL Server \u70ba\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f86\u6062\u5fa9\u6578\u64da\uff1a<\/p>\n<pre><code>RESTORE DATABASE YourDatabase FROM DISK = 'path_to_backup' WITH RECOVERY;<\/code><\/pre>\n<p>\u9019\u5c07\u5f9e\u5099\u4efd\u4e2d\u6062\u5fa9\u6578\u64da\u5eab\uff0c\u4e26\u61c9\u7528\u56de\u6efe\u65e5\u8a8c\u4e2d\u7684\u6240\u6709\u64cd\u4f5c\u3002<\/p>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-DepkffASHD\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<ul>\n<li>\u5b9a\u671f\u5099\u4efd\u56de\u6efe\u65e5\u8a8c\uff0c\u4ee5\u9632\u6b62\u65e5\u8a8c\u6587\u4ef6\u904e\u5927\uff0c\u5f71\u97ff\u6027\u80fd\u3002<\/li>\n<li>\u78ba\u4fdd\u56de\u6efe\u65e5\u8a8c\u7684\u5b58\u5132\u4f4d\u7f6e\u6709\u8db3\u5920\u7684\u7a7a\u9593\uff0c\u4ee5\u907f\u514d\u56e0\u7a7a\u9593\u4e0d\u8db3\u800c\u5c0e\u81f4\u7684\u6578\u64da\u4e1f\u5931\u3002<\/li>\n<li>\u4e86\u89e3\u4e0d\u540c\u6578\u64da\u5eab\u7cfb\u7d71\u7684\u56de\u6efe\u65e5\u8a8c\u7ba1\u7406\u65b9\u5f0f\uff0c\u56e0\u70ba\u4e0d\u540c\u7cfb\u7d71\u7684\u5be6\u73fe\u53ef\u80fd\u6709\u6240\u4e0d\u540c\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-DepkffASHD\">\u7e3d\u7d50<\/h2>\n<p>\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\u662f\u4e00\u500b\u4e0d\u53ef\u6216\u7f3a\u7684\u529f\u80fd\uff0c\u80fd\u5920\u78ba\u4fdd\u6578\u64da\u7684\u5b8c\u6574\u6027\u548c\u53ef\u9760\u6027\u3002\u901a\u904e\u6b63\u78ba\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u7ba1\u7406\u54e1\u53ef\u4ee5\u6709\u6548\u5730\u7ba1\u7406\u6578\u64da\u5eab\u4e8b\u52d9\uff0c\u4e26\u5728\u767c\u751f\u6545\u969c\u6642\u8fc5\u901f\u6062\u5fa9\u6578\u64da\u3002\u5c0d\u65bc\u9700\u8981\u9ad8\u53ef\u7528\u6027\u548c\u7a69\u5b9a\u6027\u7684\u61c9\u7528\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u662f\u81f3\u95dc\u91cd\u8981\u7684\u3002\u4e86\u89e3\u56de\u6efe\u65e5\u8a8c\u7684\u529f\u80fd\u548c\u4f7f\u7528\u65b9\u6cd5\uff0c\u5c07\u6709\u52a9\u65bc\u63d0\u5347\u6578\u64da\u5eab\u7684\u7ba1\u7406\u6548\u7387\u548c\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u6578\u64da\u5eab\u56de\u6efe\u65e5\u8a8c\u529f\u80fd\u53ca\u5176\u4f7f\u7528\u65b9\u6cd5\uff0c\u78ba\u4fdd\u6578\u64da\u5b89\u5168\u8207\u6062\u5fa9\uff0c\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-186686","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186686","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=186686"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186686\/revisions"}],"predecessor-version":[{"id":186687,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/186686\/revisions\/186687"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=186686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=186686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=186686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}