{"id":2145,"date":"2012-05-20T07:24:05","date_gmt":"2012-05-20T07:24:05","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=2145"},"modified":"2012-05-31T00:29:04","modified_gmt":"2012-05-31T00:29:04","slug":"%e8%81%9a%e9%9b%86%e7%b4%a2%e5%bc%95%e4%b8%8e%e9%9d%9e%e8%81%9a%e9%9b%86%e7%b4%a2%e5%bc%95-2","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2012\/05\/20\/%e8%81%9a%e9%9b%86%e7%b4%a2%e5%bc%95%e4%b8%8e%e9%9d%9e%e8%81%9a%e9%9b%86%e7%b4%a2%e5%bc%95-2\/","title":{"rendered":"\u805a\u96c6\u7d22\u5f15\u4e0e\u975e\u805a\u96c6\u7d22\u5f15"},"content":{"rendered":"<div>\n\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">1\uff0cCurrent Disk Queue Length:\u957f\u5ea6\u8981\u5c0f\u4e8e\u7b49\u4e8e 2*\u7269\u7406\u78c1\u76d8\u6570\uff0c\u4e0d\u7136\uff0c\u8bf4\u660e\u6709\u4efb\u52a1\u5728\u7b49\u5f85\uff0c\u78c1\u76d8\u5904\u4e8e\u7e41\u5fd9\u4e4b\u4e2d\u3002<\/span><\/p>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">2\uff0c\u5b9e\u65bd\u65b9\u6848\uff1a<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp;1\uff09\u5185\u5b58\uff1a64\u4f4d\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp;2\uff09\u78c1\u76d8\uff1a\u653e\u5728\u78c1\u76d8\u67dc\u4e2d<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp;3\uff09\u65e5\u5fd7\u6587\u4ef6\u653e\u5728\u53e6\u4e00\u78c1\u76d8\u4e0a\uff0c\u65e5\u5fd7\u6587\u4ef6\u4e0e\u6570\u636e\u6587\u4ef6\u5206\u5f00\u5728\u4e0d\u540c\u7684\u7269\u7406\u78c1\u76d8\u4e0a\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp;4\uff09radio,radi5<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp;5) \u5bf9\u4e8e\u5927\u8868\uff0c\u53ef\u8fdb\u884c\u5206\u533a\uff0c\u5e76\u653e\u5230\u591a\u4e2a\u78c1\u76d8\u4e0a\u3002&nbsp;<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">3\uff0c\u7d22\u5f15\uff0c\u5bf9\u6570\u636e\u8fdb\u884c\u4e86\u6392\u5e8f\uff0c\u4e3a\u5b58\u50a8\u8fd9\u79cd\u6392\u5e8f\u7ed3\u6784\uff0c\u9009\u62e9\u7528B-\u6811\u6765\u5b9e\u73b0\uff0c\u5728B-\u6811\u7684\u5206\u652f\u8282\u70b9\u4e2d\u5b58\u50a8\u7740\u6700\u5c0f\u503c\uff0c\u56e0\u4e3a\u662f\u6709\u5e8f\u7684\u6570\u636e\uff0c\u8fd9\u6837\u5728\u67e5\u627e\u7684\u65f6\u5019\u5c31\u53ef\u7528\u6298\u534a\u67e5\u627e\u7b49\u65b9\u6cd5\u6765\u68c0\u7d22\u6570\u636e\uff0c\u6bd4\u5982\u901a\u8fc7\u975e\u805a\u96c6\u7d22\u5f15\u67e5\u627e\u6570\u636e\uff0c\u518d\u901a\u8fc7\u6307\u793a\u7684\u952e\u503c\u53bb\u8868\u4e2d\u68c0\u7d22\u6570\u636e\uff0c\u5e76\u4e0d\u662f\u4e00\u6b65\u5c31\u5230\u805a\u96c6\u7d22\u5f15\u6240\u5728\u7684\u884c\u7684\uff0c\u800c\u662f\u904d\u5386B-\u6811\u7ed3\u6784\uff0c\u627e\u5230\u6307\u793a\u7684\u53f6\u5b50\u8282\u70b9\uff0c\u7136\u540e\u518d\u53d6\u51fa\u76f8\u5173\u6570\u636e\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">4\uff0cSql Server\u4e2d\u6240\u6709\u7684\u805a\u96c6\u7d22\u5f15\u90fd\u662f\u552f\u4e00\u7684\uff0c\u5982\u679c\u5728\u5efa\u7acb\u65f6\u6ca1\u6709\u6307\u5b9aunique\u5173\u952e\u5b57\uff0c SqlServer\u4f1a\u5728\u9700\u8981\u65f6\u901a\u8fc7\u5411\u8bb0\u5f55\u63d2\u5165\u4e00\u4e2a\u552f\u4e00\u6807\u8bc6\u7b26\u5728\u5185\u90e8\u4fdd\u8bc1\u7d22\u5f15\u7684\u552f\u4e00\u6027\uff0c\u8be5\u67d0\u4e00\u6807\u8bc6\u7b26\u662f\u4e00\u4e2a4\u5b57\u8282\u957f\u7684\u503c\uff0c\u9700\u8981\u7684\u65f6\u673a\u6307\u7684\u662f\u51fa\u73b0\u91cd\u590d\u503c\u65f6\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">5\uff0c\u975e\u805a\u96c6\u7d22\u5f15\u4e2d\u7684\u53f6\u7ea7\u522b\u4e2d\u6709\u7d22\u5f15\u5b57\u6bb5\u7684\u503c\uff0c\u540c\u65f6\u8fd8\u5305\u542b\u4e86\u4e00\u4e2a\u5f15\u5411\u8868\u6570\u636e\u7684\u4e66\u7b7e\uff0c\u4e66\u7b7e\u683c\u5f0f\u6309\u8868\u4e2d\u6709\u65e0\u805a\u96c6\u7d22\u5f15\u5206\u4e3a\u4e24\u79cd\uff1a1\uff0cKey\u503c\u3002\u805a\u96c6\u7d22\u5f15\u7684\u5b57\u6bb5\u503c\u3002 &nbsp;2\uff0cRID:\u6587\u4ef6\u53f7\uff1a\u9875\u53f7\uff1a\u69fd\u53f7\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">\u4ece\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c1\uff09\u82e5\u8868\u4e2d\u6709\u805a\u96c6\u7d22\u5f15\uff0c\u90a3\u4e48\u5f53\u805a\u96c6\u7d22\u5f15\u7684\u503c\u53d1\u751f\u66f4\u6539\u65f6\uff0c\u4f1a\u5f71\u54cd\u5230\u975e\u805a\u96c6\u7d22\u5f15\u7684\u503c\u6539\u53d8\uff0c\u975e\u805a\u96c6\u7d22\u5f15\u4f9d\u8d56\u4e8e\u805a\u96c6\u7d22\u5f15\uff0c\u6545\u805a\u96c6\u7d22\u5f15\u7684\u9009\u62e9\u5f88\u91cd\u8981\uff0c\u6700\u597d\u80fd\u591f\u5efa\u7acb\u5728\u5f88\u5c11\u66f4\u65b0\u7684\u5b57\u6bb5\u4e0a\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2\uff09\u901a\u8fc7\u975e\u805a\u96c6\u7d22\u5f15\u67e5\u627e\u6570\u636e\uff0c\u82e5\u6570\u636e\u8fd8\u9700\u8981\u901a\u8fc7\u4e66\u7b7e\u53bb\u67e5\u627e\uff0c\u90a3\u4e48\u4f1a\u6709\u4e00\u90e8\u5206\u5f00\u9500\uff0c\u8fd9\u5c31\u5929\u751f\u51b3\u5b9a\u4e86\u975e\u805a\u96c6\u7d22\u5f15\u7684\u9002\u7528\u573a\u5408\uff0c\u5373\uff1a\u975e\u805a\u96c6\u7d22\u5f15\u9002\u7528\u5728\u5927\u8868\u53d6\u5c11\u91cf\u6570\u636e\u65f6\u6700\u6709\u7528\uff0c\u56e0\u4e3a\u4e66\u7b7e\u67e5\u627e\u5e76\u4e0d\u4f1a\u9020\u6210\u5f88\u5927\u7684\u5f00\u9500\uff0c\u5e76\u4e14\uff0c\u5b83\u7279\u522b\u9002\u7528\u4e8e select\u8981\u6c42\u7684\u5b57\u6bb5\uff0c\u975e\u805a\u96c6\u7d22\u5f15\u90fd\u5305\u542b\u7684\u60c5\u51b5\uff0c\u5373\u7d22\u5f15\u8986\u76d6\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6027\u80fd\u6709\u65f6\u4f1a\u6bd4\u805a\u96c6\u7d22\u5f15\u8fd8\u8981\u9ad8\u6548\uff0c\u56e0\u4e3a\u975e\u805a\u96c6\u7d22\u5f15\u5f15\u7528\u7684\u5b57\u6bb5\u5c11\u7684\uff0c\u5360\u7528\u7684\u7269\u7406\u9875\u6570\u6bd4\u8868\u7684\u9875\u6570\u5c11\u5f88\u591a\uff0c\u6545\u76f8\u5e94\u7684\u68c0\u7d22\u5c31\u5f88\u5feb\u3002\u4f46\u662f\u5728\u5927\u8303\u56f4\u53d6\u6570\u636e\u65f6\uff0c\u5b83\u7684\u4e66\u7b7e\u67e5\u627e\u5c31\u4f1a\u6210\u4e3a\u5236\u7ea6\uff0c\u6b64\u65f6\uff0c\u4e0d\u5982\u76f4\u63a5\u6765\u4e2a\u805a\u96c6\u626b\u63cf\u4f1a\u66f4\u5feb\u4e00\u4e9b\uff0c\u6545 sqlserver\u7684\u6267\u884c\u8ba1\u5212\u4e2d\u4f1a\u770b\u5230\uff0c\u672c\u6765\u6709\u7d22\u5f15\u7684\u5730\u65b9\u4e0d\u7528\uff0c\u800c\u4f7f\u7528\u4e86\u805a\u96c6\u7d22\u5f15\u626b\u63cf\u65b9\u5f0f\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">6\uff0c\u7d22\u5f15\u4f7f\u7528\u8fc7\u7a0b\u4e2d\u7684\u51e0\u79cd\u7c7b\u578b\uff1a<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp;1\uff09\u8986\u76d6\u7d22\u5f15\uff1a select \u4e2d\u7684\u5b57\u6bb5\uff0c\u975e\u805a\u96c6\u7d22\u5f15\u4e2d\u90fd\u5305\u542b\u3002&nbsp;<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp;2\uff09\u7d22\u5f15\u4ea4\u53c9\uff1a\u5e94\u7528\u4e86\u591a\u4e2a\u7d22\u5f15\u8fdb\u884c\u5982where\u6761\u4ef6\u7684\u8fc7\u6ee4\uff0c\u7136\u540e\u8fdb\u884c\u5408\u5e76\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;\">&nbsp; &nbsp; &nbsp;3\uff09\u7d22\u5f15\u8fde\u63a5\uff1a\u4e00\u4e2a\u7528\u4e8e\u8fc7\u6ee4\uff0c\u4ece\u53e6\u4e00\u7d22\u5f15\u4e2d\u53d6\u8981\u6c42\u7684\u5b57\u6bb5\uff0c\u5229\u7528\u4e86\u7d22\u5f15\u7a7a\u95f4\u5c0f\u7684\u7279\u70b9\uff0c\u907f\u514d\u4e86\u4e66\u7b7e\u67e5\u627e\u8868\u3002<\/span><\/div>\n<div>\n\t\t<span style=\"color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; border-collapse: separate; orphans: 2; widows: 2;\">7\uff0c\u67e5\u770b\u7d22\u5f15\uff1a<font color=\"#800000\" face=\"Courier New\" size=\"2\"><span style=\"font-size: 10pt;\">sp_helpindex<\/span><\/font><span>&nbsp;<\/span><font color=\"#010101\" face=\"Courier New\" size=\"2\"><span style=\"font-size: 10pt;\">frmuser<\/p>\n<p>\t\t8,\u7d22\u5f15\u4f7f\u7528\u72b6\u51b5\u7edf\u8ba1\uff1a<\/span><\/font><\/span><\/p>\n<pre class=\"brush:sql;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;\">\r\nSelect  t.object_id, ix.name,user_updates, user_seeks,user_scans,t.name,ix.name,sc.name\r\n    from sys.dm_db_index_usage_stats ius\r\n    JOIN sys.tables t ON ius.object_id = t.object_id\r\n    JOIN sys.indexes ix ON t.object_id = ix.object_id AND ix.index_id = ius.index_id\r\n    JOIN sys.index_columns ixc ON t.object_id = ixc.object_id AND ix.index_id = ixc.index_id\r\n    JOIN sys.columns sc ON t.object_id = sc.object_id AND ixc.column_id = sc.column_id\r\nwhere t.name = &#39;bdorder&#39;    --user_updates &gt; 10 * (user_seeks+user_scans) \u5c31\u662f\u5e94drop\u7684\r\n\r\n<\/pre>\n<p>\t\t&nbsp;<\/p><\/div>\n<div align=\"left\">\n\t\t&nbsp;<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>1\uff0cCurrent Disk Queue Length:\u957f\u5ea6\u8981\u5c0f\u4e8e\u7b49\u4e8e 2*\u7269\u7406\u78c1\u76d8\u6570\uff0c\u4e0d\u7136\uff0c\u8bf4\u660e\u6709\u4efb\u52a1\u5728\u7b49\u5f85 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-2145","post","type-post","status-publish","format-standard","hentry","category-sql-server"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2145","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=2145"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2145\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=2145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=2145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=2145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}