{"id":64803,"date":"2024-10-14T11:49:21","date_gmt":"2024-10-14T03:49:21","guid":{"rendered":"https:\/\/server.hk\/cnblog\/64803\/"},"modified":"2024-10-14T11:49:21","modified_gmt":"2024-10-14T03:49:21","slug":"mssql-splock%ef%bc%9a%e4%bd%bf%e7%94%a8%e5%ae%83%e5%af%a6%e7%8f%be%e9%ab%98%e6%95%88%e6%95%b8%e6%93%9a%e5%ba%ab%e4%ba%8b%e5%8b%99%e7%ae%a1%e7%90%86%ef%bc%88mssql-splock%ef%bc%89","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/64803\/","title":{"rendered":"MSSQL SPLOCK\uff1a\u4f7f\u7528\u5b83\u5be6\u73fe\u9ad8\u6548\u6578\u64da\u5eab\u4e8b\u52d9\u7ba1\u7406\uff08mssql splock\uff09"},"content":{"rendered":"<h1 id=\"mssql-splock%ef%bc%9a%e4%bd%bf%e7%94%a8%e5%ae%83%e5%af%a6%e7%8f%be%e9%ab%98%e6%95%88%e6%95%b8%e6%93%9a%e5%ba%ab%e4%ba%8b%e5%8b%99%e7%ae%a1%e7%90%86-WsgqVLpGXv\">MSSQL SPLOCK\uff1a\u4f7f\u7528\u5b83\u5be6\u73fe\u9ad8\u6548\u6578\u64da\u5eab\u4e8b\u52d9\u7ba1\u7406<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u5eab\u7684\u6027\u80fd\u548c\u6548\u7387\u5c0d\u65bc\u4f01\u696d\u7684\u6210\u529f\u81f3\u95dc\u91cd\u8981\u3002Microsoft SQL Server\uff08MSSQL\uff09\u4f5c\u70ba\u4e00\u500b\u6d41\u884c\u7684\u95dc\u4fc2\u578b\u6578\u64da\u5eab\u7ba1\u7406\u7cfb\u7d71\uff0c\u63d0\u4f9b\u4e86\u591a\u7a2e\u5de5\u5177\u548c\u529f\u80fd\u4f86\u5e6b\u52a9\u958b\u767c\u8005\u548c\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u6709\u6548\u5730\u7ba1\u7406\u6578\u64da\u5eab\u4e8b\u52d9\u3002\u5176\u4e2d\uff0cSPLOCK\u662f\u4e00\u500b\u91cd\u8981\u7684\u7cfb\u7d71\u5b58\u5132\u904e\u7a0b\uff0c\u80fd\u5920\u5e6b\u52a9\u7528\u6236\u66f4\u597d\u5730\u7406\u89e3\u548c\u7ba1\u7406\u6578\u64da\u5eab\u4e2d\u7684\u9396\u5b9a\u884c\u70ba\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%afsplock%ef%bc%9f-WsgqVLpGXv\">\u4ec0\u9ebc\u662fSPLOCK\uff1f<\/h2>\n<p>SPLOCK\u662f\u4e00\u500b\u7cfb\u7d71\u5b58\u5132\u904e\u7a0b\uff0c\u4e3b\u8981\u7528\u65bc\u986f\u793a\u7576\u524d\u6578\u64da\u5eab\u4e2d\u6240\u6709\u7684\u9396\u5b9a\u4fe1\u606f\u3002\u5b83\u80fd\u5920\u63d0\u4f9b\u6709\u95dc\u9396\u5b9a\u7684\u8a73\u7d30\u8cc7\u8a0a\uff0c\u5305\u62ec\u9396\u5b9a\u985e\u578b\u3001\u9396\u5b9a\u72c0\u614b\u3001\u9396\u5b9a\u7684\u8cc7\u6e90\u7b49\u3002\u9019\u4e9b\u4fe1\u606f\u5c0d\u65bc\u8a3a\u65b7\u6027\u80fd\u554f\u984c\u548c\u512a\u5316\u6578\u64da\u5eab\u4e8b\u52d9\u7ba1\u7406\u81f3\u95dc\u91cd\u8981\u3002<\/p>\n<h2 id=\"splock%e7%9a%84%e4%bd%bf%e7%94%a8%e5%a0%b4%e6%99%af-WsgqVLpGXv\">SPLOCK\u7684\u4f7f\u7528\u5834\u666f<\/h2>\n<p>\u5728\u6578\u64da\u5eab\u64cd\u4f5c\u4e2d\uff0c\u9396\u5b9a\u662f\u78ba\u4fdd\u6578\u64da\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\u7684\u91cd\u8981\u6a5f\u5236\u3002\u7136\u800c\uff0c\u904e\u591a\u7684\u9396\u5b9a\u6216\u4e0d\u7576\u7684\u9396\u5b9a\u7ba1\u7406\u53ef\u80fd\u5c0e\u81f4\u6027\u80fd\u74f6\u9838\u3002\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f7f\u7528SPLOCK\u7684\u5e38\u898b\u5834\u666f\uff1a<\/p>\n<ul>\n<li><strong>\u6027\u80fd\u8a3a\u65b7\uff1a<\/strong>\u7576\u6578\u64da\u5eab\u6027\u80fd\u4e0b\u964d\u6642\uff0c\u4f7f\u7528SPLOCK\u53ef\u4ee5\u5e6b\u52a9\u8b58\u5225\u662f\u5426\u5b58\u5728\u9396\u5b9a\u7af6\u722d\u7684\u554f\u984c\u3002<\/li>\n<li><strong>\u4e8b\u52d9\u7ba1\u7406\uff1a<\/strong>\u5728\u9032\u884c\u8907\u96dc\u7684\u4e8b\u52d9\u6642\uff0c\u4e86\u89e3\u9396\u5b9a\u72c0\u614b\u53ef\u4ee5\u5e6b\u52a9\u958b\u767c\u8005\u512a\u5316\u4e8b\u52d9\u7684\u57f7\u884c\u9806\u5e8f\u3002<\/li>\n<li><strong>\u6545\u969c\u6392\u9664\uff1a<\/strong>\u7576\u51fa\u73fe\u6b7b\u9396\u6216\u9577\u6642\u9593\u7b49\u5f85\u7684\u60c5\u6cc1\u6642\uff0cSPLOCK\u80fd\u5920\u63d0\u4f9b\u5fc5\u8981\u7684\u4fe1\u606f\u4f86\u9032\u884c\u6545\u969c\u6392\u9664\u3002<\/li>\n<\/ul>\n<h2 id=\"%e5%a6%82%e4%bd%95%e4%bd%bf%e7%94%a8splock-WsgqVLpGXv\">\u5982\u4f55\u4f7f\u7528SPLOCK<\/h2>\n<p>\u4f7f\u7528SPLOCK\u975e\u5e38\u7c21\u55ae\uff0c\u53ea\u9700\u5728SQL Server Management Studio\u4e2d\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<pre><code>EXEC sp_lock;<\/code><\/pre>\n<p>\u9019\u500b\u547d\u4ee4\u5c07\u8fd4\u56de\u7576\u524d\u6578\u64da\u5eab\u4e2d\u6240\u6709\u7684\u9396\u5b9a\u4fe1\u606f\u3002\u8fd4\u56de\u7684\u7d50\u679c\u96c6\u5305\u542b\u4ee5\u4e0b\u5e7e\u500b\u91cd\u8981\u7684\u5217\uff1a<\/p>\n<ul>\n<li><strong>SPID\uff1a<\/strong>\u6703\u8a71ID\uff0c\u6a19\u8b58\u7576\u524d\u57f7\u884c\u7684\u6703\u8a71\u3002<\/li>\n<li><strong>DBID\uff1a<\/strong>\u6578\u64da\u5eabID\uff0c\u6a19\u8b58\u9396\u5b9a\u6240\u5c6c\u7684\u6578\u64da\u5eab\u3002<\/li>\n<li><strong>ObjId\uff1a<\/strong>\u5c0d\u8c61ID\uff0c\u6a19\u8b58\u88ab\u9396\u5b9a\u7684\u5c0d\u8c61\u3002<\/li>\n<li><strong>Type\uff1a<\/strong>\u9396\u5b9a\u985e\u578b\uff0c\u4f8b\u5982\u884c\u9396\u3001\u9801\u9396\u6216\u8868\u9396\u3002<\/li>\n<li><strong>Mode\uff1a<\/strong>\u9396\u5b9a\u6a21\u5f0f\uff0c\u4f8b\u5982\u5171\u4eab\u9396\u3001\u6392\u4ed6\u9396\u7b49\u3002<\/li>\n<\/ul>\n<h2 id=\"splock%e7%9a%84%e5%af%a6%e9%9a%9b%e6%87%89%e7%94%a8%e6%a1%88%e4%be%8b-WsgqVLpGXv\">SPLOCK\u7684\u5be6\u969b\u61c9\u7528\u6848\u4f8b<\/h2>\n<p>\u5047\u8a2d\u4e00\u500b\u96fb\u5b50\u5546\u52d9\u5e73\u53f0\u5728\u9ad8\u5cf0\u671f\u51fa\u73fe\u4e86\u6027\u80fd\u554f\u984c\u3002\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u53ef\u4ee5\u4f7f\u7528SPLOCK\u4f86\u6aa2\u67e5\u662f\u5426\u6709\u5927\u91cf\u7684\u6392\u4ed6\u9396\u5c0e\u81f4\u5176\u4ed6\u67e5\u8a62\u7121\u6cd5\u57f7\u884c\u3002\u901a\u904e\u5206\u6790\u9396\u5b9a\u4fe1\u606f\uff0c\u7ba1\u7406\u54e1\u53ef\u4ee5\u8abf\u6574\u67e5\u8a62\u7684\u57f7\u884c\u8a08\u5283\uff0c\u6216\u662f\u512a\u5316\u4e8b\u52d9\u7684\u8a2d\u8a08\uff0c\u4ee5\u6e1b\u5c11\u9396\u5b9a\u7684\u6301\u6709\u6642\u9593\u3002<\/p>\n<h2 id=\"%e7%b5%90%e8%ab%96-WsgqVLpGXv\">\u7d50\u8ad6<\/h2>\n<p>SPLOCK\u662f\u4e00\u500b\u5f37\u5927\u7684\u5de5\u5177\uff0c\u80fd\u5920\u5e6b\u52a9\u6578\u64da\u5eab\u7ba1\u7406\u54e1\u548c\u958b\u767c\u8005\u6709\u6548\u5730\u7ba1\u7406\u6578\u64da\u5eab\u4e8b\u52d9\u3002\u901a\u904e\u4e86\u89e3\u548c\u5206\u6790\u9396\u5b9a\u4fe1\u606f\uff0c\u4f7f\u7528\u8005\u53ef\u4ee5\u512a\u5316\u6578\u64da\u5eab\u6027\u80fd\uff0c\u6e1b\u5c11\u9396\u5b9a\u7af6\u722d\uff0c\u5f9e\u800c\u63d0\u9ad8\u6574\u9ad4\u7cfb\u7d71\u7684\u6548\u7387\u3002\u5728\u7576\u4eca\u7af6\u722d\u6fc0\u70c8\u7684\u5546\u696d\u74b0\u5883\u4e2d\uff0c\u638c\u63e1\u9019\u4e9b\u6280\u8853\u5c07\u6709\u52a9\u65bc\u4f01\u696d\u5728\u6578\u64da\u7ba1\u7406\u4e0a\u53d6\u5f97\u6210\u529f\u3002<\/p>\n<p>\u5982\u9700\u4e86\u89e3\u66f4\u591a\u6709\u95dc\u6578\u64da\u5eab\u7ba1\u7406\u548c\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\uff0c\u8acb\u8a2a\u554f\u6211\u5011\u7684\u7db2\u7ad9\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u63a2\u7d22MSSQL SPLOCK\uff0c\u63d0\u5347\u6578\u64da\u5eab\u4e8b\u52d9\u7ba1\u7406\u6548\u7387\uff0c\u78ba\u4fdd\u6578\u64da\u4e00\u81f4\u6027\u8207\u6027\u80fd\u512a\u5316\uff0c\u52a9\u529b\u4f01\u696d\u6578\u64da\u8655\u7406\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-64803","post","type-post","status-publish","format-standard","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/64803","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=64803"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/64803\/revisions"}],"predecessor-version":[{"id":64804,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/64803\/revisions\/64804"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=64803"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=64803"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=64803"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}