{"id":3228,"date":"2015-12-03T03:30:51","date_gmt":"2015-12-03T03:30:51","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=3228"},"modified":"2015-12-03T04:38:55","modified_gmt":"2015-12-03T04:38:55","slug":"%e6%95%b0%e6%8d%ae%e5%ba%93%e5%8a%a0%e5%af%86","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2015\/12\/03\/%e6%95%b0%e6%8d%ae%e5%ba%93%e5%8a%a0%e5%af%86\/","title":{"rendered":"\u6570\u636e\u5e93\u52a0\u5bc6"},"content":{"rendered":"<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25.2px; background-color: rgb(255, 255, 255);\">\n\t<strong style=\"margin: 0px; padding: 0px;\"><font size=\"4\" style=\"margin: 0px; padding: 0px;\">\u5bf9\u6570\u636e\u5e93\u542f\u7528 \u900f\u660e\u6570\u636e\u52a0\u5bc6\uff08TDE\uff09\u3010\u6b64\u65b9\u6cd5\u9002\u7528\u4e8e sql server 2008 \u53ca\u4ee5\u540e\u7684\u7248\u672c\uff08\u542b2008\uff09\u3011<\/font><\/strong><\/p>\n<p style=\"margin: 10px auto; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25.2px; background-color: rgb(255, 255, 255);\">\n\t<strong style=\"margin: 0px; padding: 0px;\">\u6ce8\uff1a\u4ec5 sql server enterprise\uff08\u4f01\u4e1a\u7248\uff09\u652f\u6301\u6b64\u529f\u80fd\u3002<\/strong><\/p>\n<p><span style=\"color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25.2px; background-color: rgb(255, 255, 255);\">\u5b83\u662f\u5bf9\u6574\u4e2a\u6570\u636e\u5e93\u8fdb\u884c\u4e86\u52a0\u5bc6\uff0c\u800c\u4e14\u65e2\u7136\u662f&ldquo;\u900f\u660e&rdquo;\uff0c\u4e5f\u5c31\u662f\u8bf4\u4e0d\u4f1a\u5f71\u54cd\u5230\u4efb\u4f55\u5bf9\u6570\u636e\u5e93\u7684\u64cd\u4f5c\uff0c\u6b63\u5e38\u7684\u5bf9\u6570\u636e\u5e93\u64cd\u4f5c\uff08\u589e\u5220\u6539\u67e5\u4ec0\u4e48\u7684\uff09\uff0c\u8fd8\u6709\u5907\u4efd\u6062\u590d\u4ec0\u4e48\u7684\uff0c\u90fd\u4e0d\u9700\u8981\u7279\u522b\u7684\u8003\u8651\u52a0\u5bc6\u95ee\u9898\u3002\u53ea\u6709\u79bb\u5f00\u4e86\u5f53\u524d\u7684\u6570\u636e\u5e93\u670d\u52a1\u5668\uff0c\u5c31\u4f1a\u53d1\u73b0\uff0c\u4ec0\u4e48\u90fd\u505a\u4e0d\u4e86\u3002<br \/>\n\u5bf9bak\u8fdb\u884c\u8fd8\u539f\u7684\u65f6\u5019\uff0c\u5728UI\u4e0a\u4f1a\u63d0\u793a\u4ecb\u8d28\u627e\u4e0d\u5230\uff0c\u7528sql restore\u65f6\u4f1a\u63d0\u793a<\/span>\u627e\u4e0d\u5230\u6307\u7eb9\u4e3a &#39;0xBAA127AA4C8BE3F4BAD4E1369DB9F2D0910D40BA&#39; \u7684\u670d\u52a1\u5668 \u8bc1\u4e66\u3002<br \/>\n<span style=\"color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; font-size: 14px; line-height: 25.2px; background-color: rgb(255, 255, 255);\">\u9700\u8981\u5728\u65b0\u7684\u670d\u52a1\u5668\u4e2d\u5bfc\u5165\u539f\u6765\u7684\u52a0\u5bc6\u8bc1\u4e66\u5373\u53ef\u6b63\u5e38\u4f7f\u7528\u3002<\/p>\n<p>\u5f15\u81ea\uff1a<\/span><a href=\"http:\/\/blog.csdn.net\/ws_hgo\/article\/details\/6927152\">SQLServer Transparent Data Encryption<\/a><\/p>\n<pre class=\"brush:sql;first-line:1;pad-line-numbers:true;highlight:null;collapse:false;\">\r\n\r\nSELECT DB_NAME(database_id) AS DatabaseName, * FROM sys.dm_database_encryption_keys;\r\n\r\n--\u6574\u4e2a\u52a0\u5bc6\r\n--1\u3001\u5728 master \u6570\u636e\u5e93\u4e2d\uff0c\u6dfb\u52a0 \u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff1a\r\nUSE master;\r\nCREATE MASTER KEY ENCRYPTION BY PASSWORD = &#39;helloworld&#39;;\r\n\r\n--2\u3001\u5728 master \u6570\u636e\u5e93\u4e2d\uff0c\u6dfb\u52a0 \u52a0\u5bc6\u6570\u636e\u5e93\u7528\u7684\u8bc1\u4e66\uff1a\r\nUSE master;\r\nCREATE CERTIFICATE A9Safe WITH SUBJECT = &#39;A9Safe&#39;;\r\n\r\n-- 3\u3001\u5728 \u8981\u52a0\u5bc6\u7684\u6570\u636e\u5e93 \u4e2d\uff0c\u8bbe\u7f6e \u8bc1\u4e66\u4ee5\u53ca\u52a0\u5bc6\u7b97\u6cd5\uff1a\r\nUSE Authorize\r\ngo\r\nCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_128\r\nENCRYPTION BY SERVER CERTIFICATE A9Safe;\r\n\r\n--\u5bf9 \u8981\u52a0\u5bc6\u7684\u6570\u636e\u5e93 \u542f\u7528\u52a0\u5bc6\uff1a\r\nALTER DATABASE Authorize SET ENCRYPTION ON WITH ROLLBACK IMMEDIATE\r\n\r\nUSE CedarLog\r\ngo\r\nCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_128\r\nENCRYPTION BY SERVER CERTIFICATE A9Safe;\r\n\r\nALTER DATABASE CedarLog SET ENCRYPTION ON WITH ROLLBACK IMMEDIATE\r\n\r\nUSE S60623\r\ngo\r\nCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_128\r\nENCRYPTION BY SERVER CERTIFICATE A9Safe;\r\n\r\nALTER DATABASE S60623 SET ENCRYPTION ON WITH ROLLBACK IMMEDIATE\r\n\r\nUSE SMSDB\r\ngo\r\nCREATE DATABASE ENCRYPTION KEY WITH ALGORITHM = AES_128\r\nENCRYPTION BY SERVER CERTIFICATE A9Safe;\r\n\r\nALTER DATABASE SMSDB SET ENCRYPTION ON WITH ROLLBACK IMMEDIATE\r\n\r\n\r\n--5\u3001\u9996\u5148\u8981\u4ece master \u6570\u636e\u5e93\u4e2d\uff0c\u5907\u4efd\u52a0\u5bc6\u8bc1\u4e66\uff1apaswword \u6b64\u5bc6\u7801\u7528\u4e8e\u4fdd\u62a4\u79c1\u94a5\uff0c\u6062\u590d\u65f6\u4f7f\u7528\r\nUSE master;\r\nBACKUP CERTIFICATE A9Safe TO FILE = &#39;D:A9Safe.cer&#39;  \r\nWITH PRIVATE KEY ( FILE = &#39;D:A9Safe.pkey&#39;, ENCRYPTION BY PASSWORD = &#39;$$helloworld$$&#39; );\r\n\r\n\r\n--6\u3001\u5728\u5176\u4ed6\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e2d\uff0c\u4ecd\u7136\u9996\u5148\u5efa\u7acb \u6570\u636e\u5e93\u4e3b\u5bc6\u94a5\uff0c\u540c\u7b2c1\u6b65\u64cd\u4f5c\uff1b\r\nUSE master;\r\nCREATE MASTER KEY ENCRYPTION BY PASSWORD = &#39;23987hxJ#KL95234nl0zBe&#39;;\r\n\r\n--7\u3001\u7136\u540e\uff0c\u5f00\u59cb\u4ece\u6587\u4ef6\u4e2d\u6062\u590d\u8bc1\u4e66\uff1a\r\nUSE master;\r\nCREATE CERTIFICATE A9Safe FROM FILE = &#39;D:A9Safe.cer&#39;\r\nWITH PRIVATE KEY ( FILE = &#39;D:A9Safe.pkey&#39;, DECRYPTION BY PASSWORD = &#39;$$helloworld$$&#39;);\r\n\r\n--\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6570\u636e\u5e93\u52a0\u5bc6\u7684\u5173\u952e\u662f \u90a3\u4e2a\u8bc1\u4e66\uff0c\u6570\u636e\u5e93\u4e3b\u5bc6\u94a5 \u662f\u7528\u6765\u4fdd\u62a4\u6570\u636e\u5e93\u4fe1\u606f\u7684\uff0c\u6bd4\u5982\u8bc1\u4e66\u7684\u5b58\u653e\u4ec0\u4e48\u7684\uff0c\u5e76\u4e0d\u76f4\u63a5\u5173\u7cfb\u5230\u6570\u636e\u5e93\u7684\u52a0\u5bc6\u3002\r\n--\u6240\u4ee5\uff0c\u4e00\u5b9a\u8981\u5907\u4efd\u597d\u8bc1\u4e66\uff01\uff01\uff01\u4e0d\u7136\u522b\u5230\u65f6\u5019\u54ed\u7740\u89e3\u5bc6\u4e0d\u4e86\u6570\u636e\u5e93\u3002\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5bf9\u6570\u636e\u5e93\u542f\u7528 \u900f\u660e\u6570\u636e\u52a0\u5bc6\uff08TDE\uff09\u3010\u6b64\u65b9\u6cd5\u9002\u7528\u4e8e sql server 2008 \u53ca\u4ee5\u540e\u7684\u7248\u672c\uff08\u542b2008\uff09 [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-3228","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\/3228","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=3228"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/3228\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=3228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=3228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=3228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}