{"id":136437,"date":"2024-10-31T11:24:12","date_gmt":"2024-10-31T03:24:12","guid":{"rendered":"https:\/\/server.hk\/cnblog\/136437\/"},"modified":"2024-10-31T11:24:13","modified_gmt":"2024-10-31T03:24:13","slug":"sql-server-2008%e6%95%b8%e6%93%9a%e5%ba%ab%e8%a4%87%e8%a3%bd%e5%af%a6%e7%8f%be%e6%95%b8%e6%93%9a%e5%ba%ab%e5%90%8c%e6%ad%a5%e5%82%99%e4%bb%bd","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/136437\/","title":{"rendered":"SQL Server 2008\u6578\u64da\u5eab\u8907\u88fd\u5be6\u73fe\u6578\u64da\u5eab\u540c\u6b65\u5099\u4efd"},"content":{"rendered":"<h1 id=\"sql-server-2008%e6%95%b8%e6%93%9a%e5%ba%ab%e8%a4%87%e8%a3%bd%e5%af%a6%e7%8f%be%e6%95%b8%e6%93%9a%e5%ba%ab%e5%90%8c%e6%ad%a5%e5%82%99%e4%bb%bd-jZrildRfSm\">SQL Server 2008\u6578\u64da\u5eab\u8907\u88fd\u5be6\u73fe\u6578\u64da\u5eab\u540c\u6b65\u5099\u4efd<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u7684\u5b89\u5168\u6027\u548c\u53ef\u7528\u6027\u81f3\u95dc\u91cd\u8981\u3002\u5c0d\u65bc\u4f7f\u7528SQL Server 2008\u7684\u4f01\u696d\u4f86\u8aaa\uff0c\u6578\u64da\u5eab\u7684\u8907\u88fd\u6280\u8853\u63d0\u4f9b\u4e86\u4e00\u7a2e\u6709\u6548\u7684\u89e3\u6c7a\u65b9\u6848\uff0c\u4ee5\u5be6\u73fe\u6578\u64da\u7684\u540c\u6b65\u5099\u4efd\u3002\u672c\u6587\u5c07\u63a2\u8a0eSQL Server 2008\u7684\u6578\u64da\u5eab\u8907\u88fd\u6280\u8853\uff0c\u4e26\u63d0\u4f9b\u5be6\u73fe\u6578\u64da\u5eab\u540c\u6b65\u5099\u4efd\u7684\u5177\u9ad4\u6b65\u9a5f\u548c\u793a\u4f8b\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af%e6%95%b8%e6%93%9a%e5%ba%ab%e8%a4%87%e8%a3%bd%ef%bc%9f-jZrildRfSm\">\u4ec0\u9ebc\u662f\u6578\u64da\u5eab\u8907\u88fd\uff1f<\/h2>\n<p>\u6578\u64da\u5eab\u8907\u88fd\u662f\u4e00\u7a2e\u5c07\u6578\u64da\u5f9e\u4e00\u500b\u6578\u64da\u5eab\u8907\u88fd\u5230\u53e6\u4e00\u500b\u6578\u64da\u5eab\u7684\u6280\u8853\u3002\u9019\u7a2e\u6280\u8853\u53ef\u4ee5\u7528\u65bc\u591a\u7a2e\u76ee\u7684\uff0c\u5305\u62ec\u6578\u64da\u5099\u4efd\u3001\u6578\u64da\u5206\u767c\u548c\u6578\u64da\u5197\u9918\u3002SQL Server 2008\u652f\u6301\u4e09\u7a2e\u4e3b\u8981\u7684\u8907\u88fd\u985e\u578b\uff1a<\/p>\n<ul>\n<li><strong>\u5feb\u7167\u8907\u88fd<\/strong>\uff1a\u5728\u7279\u5b9a\u6642\u9593\u9ede\u5275\u5efa\u6578\u64da\u7684\u5feb\u7167\uff0c\u9069\u5408\u65bc\u4e0d\u983b\u7e41\u66f4\u65b0\u7684\u6578\u64da\u3002<\/li>\n<li><strong>\u4e8b\u52d9\u8907\u88fd<\/strong>\uff1a\u5be6\u6642\u8907\u88fd\u6578\u64da\uff0c\u9069\u5408\u9700\u8981\u9ad8\u53ef\u7528\u6027\u7684\u61c9\u7528\u3002<\/li>\n<li><strong>\u5408\u4f75\u8907\u88fd<\/strong>\uff1a\u5141\u8a31\u5728\u591a\u500b\u6578\u64da\u5eab\u4e4b\u9593\u9032\u884c\u6578\u64da\u7684\u96d9\u5411\u540c\u6b65\uff0c\u9069\u5408\u65bc\u9700\u8981\u591a\u500b\u7528\u6236\u9032\u884c\u6578\u64da\u66f4\u65b0\u7684\u60c5\u6cc1\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%82%ba%e4%bb%80%e9%ba%bc%e9%81%b8%e6%93%87%e6%95%b8%e6%93%9a%e5%ba%ab%e8%a4%87%e8%a3%bd%ef%bc%9f-jZrildRfSm\">\u70ba\u4ec0\u9ebc\u9078\u64c7\u6578\u64da\u5eab\u8907\u88fd\uff1f<\/h2>\n<p>\u9078\u64c7\u6578\u64da\u5eab\u8907\u88fd\u7684\u539f\u56e0\u6709\u5f88\u591a\uff0c\u4e3b\u8981\u5305\u62ec\uff1a<\/p>\n<ul>\n<li><strong>\u6578\u64da\u5b89\u5168\u6027<\/strong>\uff1a\u901a\u904e\u5728\u4e0d\u540c\u4f4d\u7f6e\u5b58\u5132\u6578\u64da\u7684\u526f\u672c\uff0c\u53ef\u4ee5\u964d\u4f4e\u6578\u64da\u4e1f\u5931\u7684\u98a8\u96aa\u3002<\/li>\n<li><strong>\u9ad8\u53ef\u7528\u6027<\/strong>\uff1a\u5728\u4e3b\u6578\u64da\u5eab\u51fa\u73fe\u6545\u969c\u6642\uff0c\u53ef\u4ee5\u8fc5\u901f\u5207\u63db\u5230\u5099\u4efd\u6578\u64da\u5eab\uff0c\u78ba\u4fdd\u696d\u52d9\u9023\u7e8c\u6027\u3002<\/li>\n<li><strong>\u6027\u80fd\u512a\u5316<\/strong>\uff1a\u901a\u904e\u5c07\u8b80\u53d6\u8acb\u6c42\u5206\u6563\u5230\u591a\u500b\u6578\u64da\u5eab\uff0c\u53ef\u4ee5\u63d0\u9ad8\u7cfb\u7d71\u7684\u6574\u9ad4\u6027\u80fd\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e5%9c%a8sql-server-2008%e4%b8%ad%e5%af%a6%e7%8f%be%e6%95%b8%e6%93%9a%e5%ba%ab%e8%a4%87%e8%a3%bd-jZrildRfSm\">\u5982\u4f55\u5728SQL Server 2008\u4e2d\u5be6\u73fe\u6578\u64da\u5eab\u8907\u88fd<\/h2>\n<p>\u4ee5\u4e0b\u662f\u5be6\u73feSQL Server 2008\u6578\u64da\u5eab\u8907\u88fd\u7684\u57fa\u672c\u6b65\u9a5f\uff1a<\/p>\n<h3 id=\"%e6%ad%a5%e9%a9%9f1%ef%bc%9a%e9%85%8d%e7%bd%ae%e7%99%bc%e8%a1%8c%e8%80%85-jZrildRfSm\">\u6b65\u9a5f1\uff1a\u914d\u7f6e\u767c\u884c\u8005<\/h3>\n<pre><code>-- \u5728\u767c\u884c\u8005\u4e0a\u555f\u7528\u8907\u88fd\nEXEC sp_replicationdboption @dbname = 'YourDatabase', @optname = 'publish', @value = 'true';\n<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f2%ef%bc%9a%e5%89%b5%e5%bb%ba%e5%bf%ab%e7%85%a7-jZrildRfSm\">\u6b65\u9a5f2\uff1a\u5275\u5efa\u5feb\u7167<\/h3>\n<pre><code>-- \u5275\u5efa\u5feb\u7167\u4ee3\u7406\nEXEC sp_addpublication @publication = 'YourPublication', @status = 'active', @allow_push = 'true', @allow_pull = 'true';\n<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f3%ef%bc%9a%e9%85%8d%e7%bd%ae%e8%a8%82%e9%96%b1%e8%80%85-jZrildRfSm\">\u6b65\u9a5f3\uff1a\u914d\u7f6e\u8a02\u95b1\u8005<\/h3>\n<pre><code>-- \u5728\u8a02\u95b1\u8005\u4e0a\u6dfb\u52a0\u8a02\u95b1\nEXEC sp_addsubscription @publication = 'YourPublication', @subscriber = 'YourSubscriber', @destination_db = 'YourDestinationDB';\n<\/code><\/pre>\n<h3 id=\"%e6%ad%a5%e9%a9%9f4%ef%bc%9a%e5%95%9f%e5%8b%95%e8%a4%87%e8%a3%bd-jZrildRfSm\">\u6b65\u9a5f4\uff1a\u555f\u52d5\u8907\u88fd<\/h3>\n<pre><code>-- \u555f\u52d5\u8907\u88fd\u4ee3\u7406\nEXEC sp_startpublication_snapshot @publication = 'YourPublication';\n<\/code><\/pre>\n<h2 id=\"%e6%b3%a8%e6%84%8f%e4%ba%8b%e9%a0%85-jZrildRfSm\">\u6ce8\u610f\u4e8b\u9805<\/h2>\n<p>\u5728\u5be6\u65bd\u6578\u64da\u5eab\u8907\u88fd\u6642\uff0c\u9700\u8003\u616e\u4ee5\u4e0b\u5e7e\u9ede\uff1a<\/p>\n<ul>\n<li>\u78ba\u4fdd\u7db2\u7d61\u9023\u63a5\u7a69\u5b9a\uff0c\u4ee5\u907f\u514d\u6578\u64da\u50b3\u8f38\u904e\u7a0b\u4e2d\u7684\u4e2d\u65b7\u3002<\/li>\n<li>\u5b9a\u671f\u6aa2\u67e5\u8907\u88fd\u72c0\u614b\uff0c\u78ba\u4fdd\u6578\u64da\u7684\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\u3002<\/li>\n<li>\u6839\u64da\u696d\u52d9\u9700\u6c42\u9078\u64c7\u5408\u9069\u7684\u8907\u88fd\u985e\u578b\uff0c\u4ee5\u9054\u5230\u6700\u4f73\u6548\u679c\u3002<\/li>\n<\/ul>\n<h2 id=\"%e7%b8%bd%e7%b5%90-jZrildRfSm\">\u7e3d\u7d50<\/h2>\n<p>SQL Server 2008\u7684\u6578\u64da\u5eab\u8907\u88fd\u6280\u8853\u70ba\u4f01\u696d\u63d0\u4f9b\u4e86\u4e00\u7a2e\u6709\u6548\u7684\u6578\u64da\u540c\u6b65\u5099\u4efd\u89e3\u6c7a\u65b9\u6848\u3002\u901a\u904e\u5408\u7406\u914d\u7f6e\u767c\u884c\u8005\u548c\u8a02\u95b1\u8005\uff0c\u4f01\u696d\u53ef\u4ee5\u78ba\u4fdd\u6578\u64da\u7684\u5b89\u5168\u6027\u548c\u9ad8\u53ef\u7528\u6027\u3002\u5c0d\u65bc\u9700\u8981\u7a69\u5b9a\u548c\u53ef\u9760\u6578\u64da\u7ba1\u7406\u7684\u4f01\u696d\u4f86\u8aaa\uff0c\u9078\u64c7\u5408\u9069\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u5c07\u6709\u52a9\u65bc\u63d0\u5347\u6574\u9ad4\u696d\u52d9\u904b\u71df\u6548\u7387\u3002\u4e86\u89e3\u66f4\u591a\u95dc\u65bc <a href=\"https:\/\/server.hk\">\u9999\u6e2fVPS<\/a> \u7684\u4fe1\u606f\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e86\u89e3\u5982\u4f55\u5728SQL Server 2008\u4e2d\u5be6\u73fe\u6578\u64da\u5eab\u8907\u88fd\uff0c\u4ee5\u78ba\u4fdd\u6578\u64da\u5eab\u7684\u540c\u6b65\u5099\u4efd\u548c\u9ad8\u53ef\u7528\u6027\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-136437","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/136437","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=136437"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/136437\/revisions"}],"predecessor-version":[{"id":136438,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/136437\/revisions\/136438"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=136437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=136437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=136437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}