{"id":311337,"date":"2024-01-19T01:17:41","date_gmt":"2024-01-18T17:17:41","guid":{"rendered":"https:\/\/www.idc.net\/help\/311337\/"},"modified":"2024-01-19T01:17:41","modified_gmt":"2024-01-18T17:17:41","slug":"sql-server-2008%e4%b8%ad%e7%9a%84%e4%bb%a3%e7%a0%81%e5%ae%89%e5%85%a8%e4%b9%8b%e4%b8%bb%e5%af%86%e9%92%a5%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/311337\/","title":{"rendered":"SQL Server 2008\u4e2d\u7684\u4ee3\u7801\u5b89\u5168\u4e4b\u4e3b\u5bc6\u94a5\u8be6\u89e3"},"content":{"rendered":"<p><strong>SQL Server 2008<\/strong>\u4e2d\u7684\u4ee3\u7801\u5b89\u5168\u4e4b<strong>\u4e3b\u5bc6\u94a5<\/strong>\u7684\u76f8\u5173\u77e5\u8bc6\u662f\u672c\u6587\u6211\u4eec\u4e3b\u8981\u8981\u4ecb\u7ecd\u7684\u5185\u5bb9\uff0c\u5728SQL Server\u4e2d\u7684\u52a0\u5bc6\u7531\u5c42\u6b21\u7ed3\u6784\u5f62\u5f0f\u8fdb\u884c\u5904\u7406\u4ee5\u63d0\u4f9b\u591a\u7ea7\u522b\u7684\u5b89\u5168\u3002SQL Server\u5305\u542b\u4e24\u4e2a\u7528\u4e8e\u52a0\u5bc6\u6570\u636e\u7684\u5bc6\u94a5\u7c7b\u578b\u3002\u5982\u4e0b\u56fe\uff1a<\/p>\n<\/p>\n<p>1\u3001\u670d\u52a1\u5668\u4e3b\u5bc6\u94a5\uff08Service Master Key\uff09\uff1a\u4f4d\u4e8e\u5c42\u6b21\u7ed3\u6784\u7684\u6700\u9876\u7aef\uff0c\u5e76\u4e14\u5728\u5b89\u88c5SQL Server\u65f6\u81ea\u52a8\u521b\u5efa\uff0c\u7528\u4e8e\u52a0\u5bc6\u7cfb\u7edf\u6570\u636e\u3001\u94fe\u63a5\u7684\u670d\u52a1\u5668\u767b\u5f55\u540d\u4ee5\u53ca\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u3002\u5728***\u6b21\u901a\u8fc7SQL Server\u4f7f\u7528\u670d\u52a1\u4e3b\u5bc6\u94a5\u6765\u52a0\u5bc6\u8bc1\u4e66\u3001\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u6216\u94fe\u63a5\u7684\u670d\u52a1\u5668\u4e3b\u5bc6\u7801\u65f6\uff0c\u670d\u52a1\u4e3b\u5bc6\u94a5\u4f1a\u81ea\u52a8\u751f\u6210\uff0c\u5e76\u4e14\u4f7f\u7528SQL Server\u670d\u52a1\u8d26\u6237\u7684Windows\u8bc1\u4e66\u6765\u751f\u6210\u5b83\u3002\u5982\u679c\u5fc5\u987b\u6539\u53d8SQL Server\u670d\u52a1\u8d26\u53f7\uff0c\u5fae\u8f6f\u5efa\u8bae\u4f7f\u7528SQL Server\u914d\u7f6e\u7ba1\u7406\u5668\uff0c\u56e0\u4e3a\u8fd9\u4e2a\u5de5\u5177\u5c06\u6267\u884c\u751f\u6210\u65b0\u670d\u52a1\u4e3b\u5bc6\u94a5\u9700\u8981\u7684\u5408\u9002\u7684\u89e3\u5bc6\u548c\u52a0\u5bc6\u65b9\u6cd5\uff0c\u800c\u4e14\u53ef\u4ee5\u4f7f\u52a0\u5bc6\u5c42\u6b21\u7ed3\u6784\u4fdd\u6301\u5b8c\u6574\u3002\u670d\u52a1\u4e3b\u5bc6\u94a5\u4e5f\u7528\u4e8e\u52a0\u5bc6\u5176\u4e0b\u7684\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u3002<\/p>\n<p>2\u3001\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff08Database Master Key\uff09\uff1a\u7528\u4e8e\u52a0\u5bc6\u8bc1\u4e66\uff0c\u4ee5\u53ca\u975e\u5bf9\u79f0\u5bc6\u94a5\u548c\u5bf9\u79f0\u5bc6\u94a5\u3002\u6240\u6709\u6570\u636e\u5e93\u90fd\u53ef\u4ee5\u53ea\u5305\u542b\u4e00\u4e2a\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff0c\u5728\u521b\u5efa\u5b83\u65f6\uff0c\u901a\u8fc7\u670d\u52a1\u4e3b\u5bc6\u94a5\u5bf9\u5176\u52a0\u5bc6\u3002\u521b\u5efa\u975e\u5bf9\u79f0\u5bc6\u94a5\u65f6\uff0c\u53ef\u4ee5\u51b3\u5b9a\u5728\u52a0\u5bc6\u975e\u5bf9\u79f0\u5bc6\u94a5\u5bf9\u5e94\u7684\u79c1\u94a5\u662f\u5426\u5305\u542b\u5bc6\u7801\u3002\u5982\u679c\u793a\u5305\u542b\u5bc6\u7801\uff0c\u5c06\u4f7f\u7528\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u6765\u52a0\u5bc6\u79c1\u94a5\u3002<\/p>\n<p>\u6211\u4eec\u770b\u4e00\u7ec4\u4f8b\u5b50\uff1a<\/p>\n<p><strong>\u793a\u4f8b\u4e00\u3001\u5907\u4efd\u53ca\u8fd8\u539f\u670d\u52a1\u4e3b\u5bc6\u94a5<\/strong><\/p>\n<p>\u7528\u5230\u4ee5\u4e0b\u4e24\u4e2asql\u547d\u4ee4\uff1a<\/p>\n<p>BACKUP SERVICE MASTER KEY&nbsp; \u5bfc\u51fa\u670d\u52a1\u4e3b\u5bc6\u94a5\u3002\uff08http:\/\/msdn.microsoft.com\/zh-cn\/library\/ms190337.aspx\uff09<\/p>\n<p>RESTORE SERVICE MASTER KEY\u4ece\u5907\u4efd\u6587\u4ef6\u4e2d\u5bfc\u5165\u670d\u52a1\u4e3b\u5bc6\u94a5\u3002\uff08http:\/\/msdn.microsoft.com\/zh-cn\/library\/ms187972.aspx\uff09<\/p>\n<p>--\u4ee5\u4e0b\u8bed\u53e5\u5907\u4efd\u670d\u52a1\u4e3b\u5bc6\u94a5\u5230C:\\SqlBackup\\SMK.bak.<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>BACKUP&nbsp;SERVICE&nbsp;MASTER&nbsp;KEY &nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>TO&nbsp;<\/span><span>FILE<\/span><span>&nbsp;=&nbsp;<\/span><span>'C:\\SqlBackup\\SMK.bak'<\/span><span>&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>ENCRYPTION&nbsp;BY&nbsp;<\/span><span>PASSWORD<\/span><span>&nbsp;=&nbsp;<\/span><span>'MakeItAGoodOne!1AB'<\/span><span>----\u6ce8\u610f\u8be5\u5bc6\u7801\u53ef\u4ee5\u4f7f\u7528\u5355\u5f15\u53f7 &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>go&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>--\u6062\u590d\u670d\u52a1\u4e3b\u5bc6\u94a5<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>RESTORE&nbsp;SERVICE&nbsp;MASTER&nbsp;KEY &nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>FROM&nbsp;<\/span><span>FILE<\/span><span>&nbsp;=&nbsp;<\/span><span>'H:\\SqlBackup\\SMK.bak'<\/span><span>&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>DECRYPTION&nbsp;BY&nbsp;<\/span><span>PASSWORD<\/span><span>&nbsp;=&nbsp;<\/span><span>'MakeItAGoodOne!1AB'<\/span><span>&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>go&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>\u5982\u679c\u8be5\u5bc6\u94a5\u6ca1\u6709\u5b9e\u9645\u53d8\u5316\uff0c\u800c\u6267\u884c\u5bc6\u94a5\u6062\u590d\u65f6\uff0c\u4f1a\u6536\u5230\u63d0\u793a\uff1a--The old and new master keys are identical. No data re-encryption is required.<\/p>\n<p><strong>\u793a\u4f8b\u4e8c\u3001\u521b\u5efa\u3001\u518d\u751f\u6210\u548c\u5220\u9664\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5<\/strong><\/p>\n<p>\u7528\u5230\u4ee5\u4e0b\u4e24\u4e2asql\u547d\u4ee4:<\/p>\n<p>CREATE MASTER KEY \u521b\u5efa\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff08http:\/\/technet.microsoft.com\/zh-cn\/library\/ms174382.aspx\uff09<\/p>\n<p>ALTER MASTER KEY \u91cd\u65b0\u751f\u6210\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff08http:\/\/msdn.microsoft.com\/en-us\/library\/ms186937%28SQL.90%29.aspx\uff09<\/p>\n<p>DROP MASTER KEY \u5220\u9664\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff08http:\/\/msdn.microsoft.com\/en-us\/library\/ms180071.aspx\uff09<\/p>\n<p>\u5f53\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u88ab\u663e\u5f0f\u521b\u5efa\u65f6\uff0c\u4f1a\u540c\u65f6\u81ea\u52a8\u751f\u6210\u4e00\u4e2a\u989d\u5916\u751f\u6210\u7684\u5b89\u5168\u5c42\uff0c\u7528\u4e8e\u52a0\u5bc6\u6570\u636e\u5e93\u4e2d\u7684\u65b0\u8bc1\u4e66\u548c\u975e\u5bf9\u79f0\u5bc6\u94a5\uff0c\u66f4\u8fdb\u4e00\u6b65\u4fdd\u62a4\u5df2\u52a0\u5bc6\u7684\u6570\u636e\u3002<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>IF&nbsp;NOT&nbsp;EXISTS&nbsp;(SELECT&nbsp;name &nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>FROM&nbsp;sys.databases &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>WHERE&nbsp;<\/span><span>name<\/span><span>&nbsp;=&nbsp;<\/span><span>'BookStore'<\/span><span>) &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>BEGIN &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>CREATE&nbsp;DATABASE&nbsp;BookStore &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>END &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>GO &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>USE&nbsp;BookStore &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>GO&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>--\u521b\u5efa\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>CREATE&nbsp;MASTER&nbsp;KEY&nbsp;ENCRYPTION&nbsp;BY&nbsp;<\/span><span>PASSWORD<\/span><span>&nbsp;=&nbsp;<\/span><span>'password'<\/span><span>&nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>go &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>USE&nbsp;BookStore &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>GO&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>--\u91cd\u65b0\u751f\u6210\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>ALTER&nbsp;MASTER&nbsp;KEY &nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>[FORCE]&nbsp;REGENERATE&nbsp;WITH&nbsp;ENCRYPTION&nbsp;BY&nbsp;<\/span><span>PASSWORD<\/span><span>&nbsp;=&nbsp;<\/span><span>'password'<\/span><span>&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>--\u5220\u9664\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>USE&nbsp;BookStore &nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>GO &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>DROP&nbsp;MASTER&nbsp;KEY&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>\u6ce8\u610f\uff1a\u5982\u679c\u8be5\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u4ecd\u7136\u88ab\u5176\u4ed6\u6570\u636e\u5e93\u5bf9\u8c61\u4f7f\u7528\uff0c\u5219\u4e0d\u80fd\u88ab\u5220\u9664\uff0c\u8fd9\u70b9\u4e0e\u67b6\u6784\u7c7b\u4f3c\u3002\u540c\u65f6\u4e00\u65e6\u521b\u5efa\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff0c\u5c31\u7acb\u523b\u5907\u4efd\u5b83\u662f\u4e00\u4e2a\u597d\u7684\u4e60\u60ef\u3002<\/p>\n<p><strong>\u793a\u4f8b\u4e09\u3001\u5907\u4efd\u3001\u6062\u590d\u4e00\u4e2a\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5<\/strong><\/p>\n<p>\u8bed\u6cd5\uff1a<\/p>\n<p>BACKUP MASTER KEY\u5bfc\u51fa\u670d\u52a1\u4e3b\u5bc6\u94a5\u3002\uff08http:\/\/technet.microsoft.com\/en-us\/library\/ms174387.aspx\uff09<\/p>\n<p>RESTORE MASTER KEY\u4ece\u5907\u4efd\u6587\u4ef6\u4e2d\u5bfc\u5165\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u3002\uff08http:\/\/msdn.microsoft.com\/en-us\/library\/ms186336.aspx\uff09<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u5b8c\u6574\u793a\u4f8b\uff1a<\/p>\n<p>--\u5907\u4efd\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>USE&nbsp;BookStore &nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>GO &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>CREATE&nbsp;MASTER&nbsp;KEY&nbsp;ENCRYPTION&nbsp;BY&nbsp;<\/span><span>PASSWORD<\/span><span>&nbsp;=&nbsp;<\/span><span>'MagneticFields!'<\/span><span>&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>GO &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>BACKUP&nbsp;MASTER&nbsp;KEY&nbsp;TO&nbsp;<\/span><span>FILE<\/span><span>&nbsp;=&nbsp;<\/span><span>'H:\\SqlBackup\\BookStore_Master_Key.BAK'<\/span><span>&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>ENCRYPTION&nbsp;BY&nbsp;<\/span><span>PASSWORD<\/span><span>&nbsp;=&nbsp;<\/span><span>'4D280837!!!'<\/span><span>&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>--\u6062\u590d\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>RESTORE&nbsp;MASTER&nbsp;KEY&nbsp;FROM&nbsp;<\/span><span>FILE<\/span><span>&nbsp;=&nbsp;<\/span><span>'H:\\SqlBackup\\BookStore_Master_Key.BAK'<\/span><span>&nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>DECRYPTION&nbsp;BY&nbsp;<\/span><span>PASSWORD<\/span><span>&nbsp;=&nbsp;<\/span><span>'4D280837!!!'<\/span><span>&nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>ENCRYPTION&nbsp;BY&nbsp;<\/span><span>PASSWORD<\/span><span>&nbsp;=&nbsp;<\/span><span>'MagneticFields!'<\/span><span>&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>\u4e0e\u670d\u52a1\u4e3b\u5bc6\u94a5\u7c7b\u4f3c\uff0c\u5982\u679c\u6ca1\u6709\u4fee\u6539\uff0c\u5219\u4f1a\u6536\u5230\u5982\u4e0b\u63d0\u793a\uff1aThe old and new master keys are identical. No data re-encryption is required.<\/p>\n<p><strong>\u793a\u4f8b\u56db\u3001\u4ece\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u5220\u9664\u670d\u52a1\u4e3b\u5bc6\u94a5<\/strong><\/p>\n<p>\u5f53\u4e00\u4e2a\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u88ab\u521b\u5efa\u65f6\uff0c\u5b83\u88ab\u9ed8\u8ba4\u4f7f\u7528\u4e24\u79cd\u65b9\u5f0f\u52a0\u5bc6\uff1a\u670d\u52a1\u4e3b\u5bc6\u94a5\u548c\u88ab\u4f7f\u7528CREATE MASTER KEY \u547d\u4ee4\u4e2d\u4f7f\u7528\u7684\u5bc6\u7801\u3002\u5982\u679c\u4f60\u4e0d\u60f3\u4f7f\u7528\u670d\u52a1\u4e3b\u5bc6\u7801\u52a0\u5bc6\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff08\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u62e5\u6709sysadmin\u7279\u6743\u7684login\u5728\u4e0d\u77e5\u9053\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u7684\u524d\u63d0\u4e0b\u5c06\u4e0d\u80fd\u8bbf\u95ee\u52a0\u5bc6\u6570\u636e\uff09\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528ALTER MASTER KEY \u547d\u4ee4\u5220\u9664\u670d\u52a1\u4e3b\u5bc6\u94a5\u3002<\/p>\n<p>\u7b80\u7565\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n<pre>\n \n \n \n <ol>\n  \n  \n  \n  <li><span><span>ALTER&nbsp;MASTER&nbsp;KEY &nbsp;<\/span><\/span><\/li>\n  \n  \n  \n  <li><span>ADD&nbsp;ENCRYPTION&nbsp;BY&nbsp;SERVICE&nbsp;MASTER&nbsp;KEY&nbsp;| &nbsp;<\/span><\/li>\n  \n  \n  \n  <li><span>DROP&nbsp;ENCRYPTION&nbsp;BY&nbsp;SERVICE&nbsp;MASTER&nbsp;KEY&nbsp;<\/span><\/li>\n \n \n \n <\/ol><\/pre>\n<p>\u7531\u4e8e\u670d\u52a1\u4e3b\u5bc6\u94a5\u5141\u8bb8\u62e5\u6709\u8db3\u591f\u8bb8\u53ef\uff08\u5982sysadmin\uff09\u7684\u7528\u6237\u81ea\u52a8\u4f7f\u7528\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u89e3\u5bc6\uff0c\u56e0\u6b64\uff0c\u4e00\u65e6\u5220\u9664\u4e86\u670d\u52a1\u4e3b\u5bc6\u94a5\u7684\u52a0\u5bc6\uff0c\u800c\u518d\u60f3\u4fee\u6539\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u65f6\uff0c\u4f60\u5fc5\u987b\u4f7f\u7528\u4e00\u4e2a\u65b0\u7684\u547d\u4ee4\u8bbf\u95ee\u5b83\u3002OPEN MASTER KEY, \u8bed\u6cd5\u5982\u4e0b\uff1aOPEN MASTER KEY DECRYPTION BY PASSWORD = 'password'<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<p>ALTER MASTER KEY DROP ENCRYPTION BY SERVICE MASTER KEY\u4e00\u65e6\u6267\u884c\uff0c\u4efb\u4f55\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u7684\u4fee\u6539\u9700\u8981\u4f7f\u7528OPEN MASTER KEY\u7684\u53e3\u4ee4\u8bbf\u95ee\uff0c\u8fd9\u6837\u662f\u4e3a\u4e86\u91cd\u65b0\u5e94\u7528\u670d\u52a1\u4e3b\u5bc6\u94a5\u7684\u52a0\u5bc6.<\/p>\n<p>OPEN MASTER KEY DECRYPTION BY PASSWORD = 'MagneticFieldS!'\u4e00\u65e6\u670d\u52a1\u4e3b\u5bc6\u94a5\u88ab\u7528\u4e8e\u52a0\u5bc6\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff0c\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\u4e0d\u518d\u9700\u8981\u88ab\u663e\u5f0f\u6253\u5f00\u6216\u5173\u95ed\u3002<\/p>\n<p>ALTER MASTER KEY ADD ENCRYPTION BY SERVICE MASTER KEY\u5173\u95ed\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5CLOSE MASTER KEY.<\/p>\n<p><strong>\u5c0f\u7ed3\uff1a<\/strong><\/p>\n<p>1\u3001\u672c\u6587\u4e3b\u8981\u4ecb\u7ecd\u670d\u52a1\u4e3b\u5bc6\u94a5\u7684\u5907\u4efd\u4e0e\u8fd8\u539f\uff0c\u6570\u636e\u5e93\u7684\u4e3b\u5bc6\u94a5\u7684\u521b\u5efa\u3001\u91cd\u65b0\u751f\u6210\u3001\u5220\u9664\u548c\u5907\u4efd\u3001\u8fd8\u539f\u3002<\/p>\n<p>2\u3001\u4e00\u65e6\u521b\u5efa\u4e3b\u5bc6\u94a5\uff0c\u7acb\u523b\u5907\u4efd\u5b83\u662f\u4e00\u4e2a\u5f88\u597d\u7684\u4e60\u60ef\u3002<\/p>\n<p>\u5173\u4e8eSQL Server 2008\u4e2d\u7684\u4ee3\u7801\u5b89\u5168\u4e4b\u4e3b\u5bc6\u94a5\u7684\u77e5\u8bc6\u5c31\u4ecb\u7ecd\u5230\u8fd9\u91cc\u4e86\uff0c\u5e0c\u671b\u672c\u6b21\u7684\u4ecb\u7ecd\u80fd\u591f\u5bf9\u60a8\u6709\u6240\u6536\u83b7\uff01<\/p>\n<p>\u3010\u7f16\u8f91\u63a8\u8350\u3011<\/p>\n<ol>\n<li><font>SQL Server\u591a\u8868\u67e5\u8be2\u4f18\u5316\u65b9\u6848\u603b\u7ed3<\/font><\/li>\n<li><font>SQL Server\u6570\u636e\u5e93ISNULL\u51fd\u6570\u7684\u5e94\u7528\u5b9e\u4f8b<\/font><\/li>\n<li><font>SQL Server\u6570\u636e\u5e93DATEPART\u7684\u8bed\u6cd5\u53ca\u4f7f\u7528\u5b9e\u4f8b<\/font><\/li>\n<li><font>SQL Server\u6839\u636e\u5b50\u8282\u70b9\u67e5\u8be2\u6240\u6709\u7236\u8282\u70b9\u7684\u4ee3\u7801\u793a\u4f8b<\/font><\/li>\n<li><font>SQL Server\u810f\u8bfb\u65b9\u5f0f\u6570\u636e\u63d0\u53d6\u4e4bNOLOCK\u548cREADPAST<\/font><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>SQL Server 2008\u4e2d\u7684\u4ee3\u7801\u5b89\u5168\u4e4b\u4e3b\u5bc6\u94a5\u7684\u76f8\u5173\u77e5\u8bc6\u662f\u672c\u6587\u6211\u4eec\u4e3b\u8981\u8981\u4ecb\u7ecd\u7684\u5185\u5bb9\uff0c\u5728SQL Server [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":311338,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7038],"tags":[],"class_list":["post-311337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/311337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=311337"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/311337\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/311338"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=311337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=311337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=311337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}