{"id":5026,"date":"2024-01-13T19:29:18","date_gmt":"2024-01-13T11:29:18","guid":{"rendered":"https:\/\/www.kenpai.com\/cms\/5026\/"},"modified":"2024-01-13T19:29:18","modified_gmt":"2024-01-13T11:29:18","slug":"sql-server-%e6%9c%8d%e5%8a%a1%e5%99%a8%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96","status":"publish","type":"post","link":"https:\/\/www.kenpai.com\/cms\/5026\/","title":{"rendered":"SQL server \u670d\u52a1\u5668\u6027\u80fd\u4f18\u5316"},"content":{"rendered":"<\/p>\n<p>\u89e3\u51b3SQL Server\u6027\u80fd\u95ee\u9898\u7684\u5173\u952e\u662f\u786e\u5b9a\u74f6\u9888\u5728\u54ea\u91cc\uff0c\u6700\u5bb9\u6613\u9020\u6210\u74f6\u9888\u7684\u987a\u5e8f\u662f\uff1a<br style=\"font-family:Helvetica,\" \/><br \/>\u78c1\u76d8I\/O&gt;CPU&gt;\u3000RAM&gt;\u7528\u6237\u8fde\u63a5\u6570&gt;\u7f51\u7edc\u5e26\u5bbd<\/p>\n<p style=\"text-align:\"><br style=\"font-family:Helvetica,\" \/><\/p>\n<p>\u5bf9\u4e8e\u5927\u7684\u6570\u636e\u5e93\uff0c\u6709\u4e9b\u5730\u65b9\u8981\u6ce8\u610f\u4e00\u4e0b\uff1a<\/p>\n<p>1)\u5b9a\u671fDBCCCHECKDB  (\u5efa\u8bae\u5728\u670d\u52a1\u5668\u8d1f\u8377\u8f83\u5c11\u7684\u65f6\u5019\u8fd0\u884c DBCC CHECKDB\u3002\u5982\u679c\u5728\u8d1f\u8377\u9ad8\u5cf0\u671f\u8fd0\u884c DBCC CHECKDB\uff0c\u90a3\u4e48\u4e8b\u52a1\u541e\u5410\u91cf\u6027\u80fd\u548c DBCC CHECKDB \u5b8c\u6210\u65f6\u95f4\u6027\u80fd\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002)<\/p>\n<p>2)\u5b9a\u671f\u91cd\u5efa\u7d22\u5f15\uff08\u5bf9\u4e8e\u8fd9\u79cd\u5927\u6570\u636e\u5e93\uff0c\u91cd\u5efa\u7d22\u5f15\u524d\u628a\u65e5\u5fd7\u6a21\u5f0f\u8f6c\u5230bulk_logged\uff0c\u5b8c\u6210\u540e\u518d\u6539\u56defull\uff09<\/p>\n<p>3)\u907f\u514d\u6536\u7f29\u6570\u636e\u5e93\uff08\u5982\u679c\u6570\u636e\u5e93\u5728\u7528\u6237\u67e5\u8be2\u7e41\u5fd9\u65f6\u6269\u5927\uff0c\u5c31\u4f1a\u975e\u5e38\u5fd9\uff0c\u8fd9\u90fd\u53ef\u80fd\u662f\u4f60\u9047\u5230\u7684\u95ee\u9898\u7684\u539f\u56e0\uff09<br style=\"font-family:Helvetica,\" \/><br \/>\u5982\u679c\u53ef\u80fd\uff0c\u6700\u597d\u4e8b\u5148\u6269\u5927\u6570\u636e\u5e93\uff0c\u91cd\u5efa\u7d22\u5f15\u901a\u5e38\u4f1a\u5bfc\u81f4\u65e5\u5fd7\u6587\u4ef6\u66b4\u6da8\uff08\u53c2\u8003\u7b2c2\u70b9\uff09<br style=\"font-family:Helvetica,\" \/><br \/>4)\u5b9a\u671f\u91cd\u542fSQL\u670d\u52a1\uff0c\u6bd4\u5982\u6bcf1\u4e2a\u6708\uff0c\u6bcf2\u5468\u62161\u5468\u91cd\u542f\u4e00\u6b21\uff08\u8fd9\u4e2a\u5f88\u5bb9\u6613\u88ab\u5ffd\u7565\uff0c\u4f46\u975e\u5e38\u6709\u6548\uff09<br style=\"font-family:Helvetica,\" \/><br \/><br style=\"font-family:Helvetica,\" \/><br \/>\u53e6\u5916\u8fd8\u6709\u4e00\u70b9\u6bd4\u8f83\u5bb9\u6613\u88ab\u5ffd\u7565\uff0c<br style=\"font-family:Helvetica,\" \/><br \/>\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u662f\u4e8b\u52a1\u5904\u7406\u548c\u62a5\u8868\u67e5\u8be2\u6df7\u5408\u5728\u4e00\u8d77\u7684\uff0c\u5373<br style=\"font-family:Helvetica,\" \/><br \/>\u540c\u65f6\u6709\u5f88\u591a\u7528\u6237\u66f4\u65b0\u6570\u636e\uff0c\u4e5f\u6709\u7528\u6237\u8fd0\u884c\u4e00\u4e9b\u590d\u6742\u7684\u62a5\u8868\u3002<br style=\"font-family:Helvetica,\" \/><br \/>\u90a3\u4e48\uff0c\u5efa\u8bae\u628a\u4f60SQLServer\u7684\u6700\u5927\u67e5\u8be2\u5e76\u884c\u5ea6\u6539\u4e3a1\uff0c\u9ed8\u8ba4\u4e3a0\uff0c<br style=\"font-family:Helvetica,\" \/><br \/>\u5f53\u6709\u4e2a\u7528\u6237\u8fd0\u884c\u4e00\u4e2a\u5f88\u590d\u6742\u7684\u67e5\u8be2\u65f6\uff0cSQLServer\u4f1a\u628a4\u4e2a\u5904\u7406\u5668\u90fd\u7528\u53bb\u5904\u7406\u8fd9\u4e2a\u67e5\u8be2\uff0c\u5176\u4ed6\u7528\u6237\u5c31\u6162\u5f97\u591a\u4e86\u3002<br style=\"font-family:Helvetica,\" \/><\/p>\n<p>\u5982\u679c\u5e76\u884c\u5ea6\u6539\u4e3a1\uff0cSQLServer\u603b\u662f\u75281\u4e2a\u5904\u7406\u5668\u53bb\u5904\u7406\u4e00\u4e2a\u67e5\u8be2\u3002<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<\/p>\n<p>SQLServer\u505a\u5c0f\u5e94\u7528\u6bd4\u8f83\u65b9\u4fbf\uff0c\u5165\u95e8\u5bb9\u6613\uff0c\u4f46\u5e76\u4e0d\u4ee3\u8868\u5c31\u53ea\u9002\u5408\u505a\u5c0f\u5e94\u7528\u3002<br style=\"font-family:Helvetica,\" \/><br \/><br style=\"font-family:Helvetica,\" \/><br \/>\u5bf9\u4e8e\u7cfb\u7edf\u6709\u70b9\u89c4\u6a21\u7684\uff0c\u591aCPU\uff0c\u78c1\u76d8\u9635\u5217\u90fd\u6709\u3002\u8fd9\u79cd\u786c\u4ef6\u914d\u7f6e\u5c31\u4e0d\u80fd\u4f7f\u7528\u9ed8\u8ba4\u7684SQLServer\u914d\u7f6e\uff0c<br style=\"font-family:Helvetica,\" \/><br \/>\u9ed8\u8ba4\u7684SQLServer\u914d\u7f6e\u53c2\u6570\u53ea\u9002\u5408\u5927\u591a\u6570\u60c5\u51b5\u3002<br style=\"font-family:Helvetica,\" \/><br \/><br style=\"font-family:Helvetica,\" \/><br \/>\u4f60\u67092\u4e2a4\u6838CPU\uff0c\u7b97\u662f8\u4e2a\u6838\uff0c\u90a3\u4e48\u8981\u4e3atempdb\u5efa8\u4e2a\u6570\u636e\u6587\u4ef6(datafile)\uff0c\u9ed8\u8ba4\u53ea\u67091\u4e2a\u6570\u636e\u6587\u4ef6\u3002<br style=\"font-family:Helvetica,\" \/><br \/>\u8fd9\u4e2a\u5728\u591a\u6838\u7cfb\u7edf\u91cc\u9762\u975e\u5e38\u91cd\u8981\uff0c\u5404\u4e2aCPU\u624d\u80fd\u540c\u65f6\u4f7f\u7528\u4e0d\u540c\u7684\u6570\u636e\u6587\u4ef6\u53bb\u64cd\u4f5ctempdb\uff0c\u5426\u5219\u5c31\u53ea\u6709\u6392\u961f\u7b49\u3002<br style=\"font-family:Helvetica,\" \/><br \/>\u5173\u952e\u662f8\u4e2a\u6570\u636e\u6587\u4ef6\u5927\u5c0f\u5fc5\u987b\u4e00\u6837\u3002\u7ec6\u8282\u53c2\u770b\uff1ahttp:\/\/support.microsoft.com\/kb\/328551\/zh-cn<br style=\"font-family:Helvetica,\" \/><br \/><br style=\"font-family:Helvetica,\" \/><br \/>\u4e0a\u9762\u8bbe\u7f6e\u6700\u5927\u5e76\u884c\u5ea6\u4e3a1\u7684\u90e8\u5206\uff0c\u4f60\u53ef\u4ee5\u53c2\u770b\uff1ahttp:\/\/support.microsoft.com\/kb\/329204\/zh-cn<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p><strong>\u6700\u5927\u5e76\u884c\u5ea6\uff08MAXDOP\uff09<\/strong><\/p>\n<p><strong>\u6ce8\u610fMAXDOP<\/strong>\u9009\u9879\u4e0d\u4f1a<em>\u9650\u5236  SQL Server \u4f7f\u7528\u7684\u5904\u7406\u5668\u6570<\/em>\u3002\u4f7f\u7528<strong>\u4eb2\u548c\u529b\u63a9\u7801<\/strong>\u914d\u7f6e\u9009\u9879\u6765\u914d\u7f6e SQL Server \u4f7f\u7528\u7684\u5904\u7406\u5668\u6570\u3002<\/p>\n<p>\u5f53\u60a8\u914d\u7f6e<strong>MAXDOP<\/strong>\u503c\u65f6\uff0c\u8bf7\u9075\u5faa\u4ee5\u4e0b\u51c6\u5219\uff1a<\/p>\n<p>\u5bf9\u4e8e\u4f7f\u7528\u516b\u4e2a\u4ee5\u4e0a\u7684\u5904\u7406\u5668\u7684\u670d\u52a1\u5668\u4f7f\u7528\u4ee5\u4e0b\u914d\u7f6e\uff1a MAXDOP = 8\u3002 \u670d\u52a1\u5668\u7684\u6709\u516b\u4e2a\u6216\u66f4\u5c11\u7684\u5904\u7406\u5668\uff0c\u4f7f\u7528\u4e0b\u5217\u914d\u7f6e\u5176\u4e2dN\u7b49\u4e8e\u5904\u7406\u5668\u6570\uff1a MAXDOP = 0 \u5230N\u3002 \u5bf9\u4e8e\u5177\u6709<strong>NUMA<\/strong>\u914d\u7f6e\u7684\u670d\u52a1\u5668\uff0c<strong>MAXDOP<\/strong>\u4e0d\u5e94\u8d85\u8fc7\u5206\u914d\u7ed9\u6bcf\u4e2a<strong>NUMA<\/strong>\u8282\u70b9\u7684 cpu \u6570\u3002 \u8d85\u7ebf\u7a0b\u5df2\u542f\u7528\u7684\u670d\u52a1\u5668\u7684<strong>MAXDOP<\/strong>\u503c\u4e0d\u5e94\u8d85\u8fc7\u7269\u7406\u5904\u7406\u5668\u7684\u6570\u91cf\u3002\u8fd9\u4e9b\u90fd\u662f<em>\u4e00\u822c\u6307\u5bfc\u539f\u5219<\/em>\u3002\u53ef\u80fd\u6709\u4e00\u4e9b\u4f8b\u5916\u60c5\u51b5\uff0c\u8fd9\u4e9b\u6307\u5bfc\u539f\u5219\u3002\u4f8b\u5982\u5bf9\u4e8e\u5e76\u4e0d\u4f1a\u4f7f\u7528\u5728\u4e0b\u5217\u60c5\u51b5\u4e0b\u7684\u6307\u5bfc\u539f\u5219\uff1a  \u5982\u679c\u670d\u52a1\u5668\u4e0d\u662f\u8054\u673a\u4e8b\u52a1\u5904\u7406 (OLTP) \u57fa\u4e8e\u670d\u52a1\u5668\u3002 \u5982\u679c\u670d\u52a1\u5668\u8fd0\u884c\u7684\u5927\u6279\u91cf\u5904\u7406\u65f6\u6ca1\u6709\u6216\u6700\u5c11\u7684\u7528\u6237\u8d1f\u8f7d\u3002 \u5982\u679c\u670d\u52a1\u5668\u6b63\u5728\u8fd0\u884c\u5927\u91cf\u5360\u7528\u8d44\u6e90\u7684\u64cd\u4f5c\u3002<strong>\u6ce8\u610f<\/strong>\u5728\u751f\u4ea7\u670d\u52a1\u5668\u4e0a\u5b9e\u73b0\u6240\u505a\u7684\u66f4\u6539\u4e4b\u524d\uff0c\u8bf7\u6d4b\u8bd5\u914d\u7f6e\u3002<\/p>\n<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<\/p>\n<p>\u66f4\u591a\u5173\u4e8e\u4e91\u670d\u52a1\u5668\uff0c<span class='wp_keywordlink'><a href=\"https:\/\/www.kenpai.com\/domain.html\" title=\"\u57df\u540d\u6ce8\u518c\" target=\"_blank\">\u57df\u540d<\/a><\/span>\u6ce8\u518c\uff0c\u865a\u62df\u4e3b\u673a\u7684\u95ee\u9898\uff0c\u8bf7\u8bbf\u95ee<span class='wp_keywordlink'><a href=\"https:\/\/www.kenpai.com\/\" title=\"\u57a6\u6d3e\u79d1\u6280\u5b98\u7f51\" target=\"_blank\">\u57a6\u6d3e\u79d1\u6280<\/a><\/span>\u5b98\u7f51\uff1a<span class='wp_keywordlink'><a href=\"https:\/\/www.kenpai.com\/\" title=\"\u57a6\u6d3e\u79d1\u6280\u5b98\u7f51\" target=\"_blank\">www.kenpai.com<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u89e3\u51b3SQL Server\u6027\u80fd\u95ee\u9898\u7684\u5173\u952e\u662f\u786e\u5b9a\u74f6\u9888\u5728\u54ea\u91cc\uff0c\u6700\u5bb9\u6613\u9020\u6210\u74f6\u9888\u7684\u987a\u5e8f\u662f\uff1a\u78c1\u76d8I\/O&gt;CPU&gt; RAM&gt;\u7528\u6237\u8fde\u63a5\u6570&gt;\u7f51\u7edc\u5e26<\/p>\n","protected":false},"author":2,"featured_media":4350,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3322],"tags":[3895],"class_list":["post-5026","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ktougao","tag-sql-server-"],"_links":{"self":[{"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/posts\/5026","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/comments?post=5026"}],"version-history":[{"count":0,"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/posts\/5026\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/media\/4350"}],"wp:attachment":[{"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/media?parent=5026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/categories?post=5026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kenpai.com\/cms\/wp-json\/wp\/v2\/tags?post=5026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}