1.加密数据库

/*
Module 2 Implementing Transparent Data Encryption
*/ -- 2.1 Create DataBase Master Key
USE Master;
GO Create Master Key Encryption By Password='SuperKey@currentMachine'
-- The password above must adhere to the windows password policy
-- could also use a hardware encryption module. -- 2.2 Create a Srever Certificate Derived from Database Master Key
USE master;
GO Create Certificate TDE_Cert with subject='TDE_Encryption_Cert' -- 2.3 Create Database Encryption key for a User Database
USE TinyDB
GO Create Database Encryption Key with Algorithm=AES_256
Encryption by Server Certificate TDE_Cert
-- The are other algorithm choices but AES_256 is the STRONGEST -- 2.4 Protect User Database
USE TinyDB
GO Alter Database TinyDB
Set ENCRYPTION ON -- 2.5 FollowUp
/*
Back up all keys in the hierarchy to a safe place
In practice TEST moving/restoring the database to another instance.
*/

2. 压缩数据

/*
Implementing Data Compression
*/ Create Database DBWithRedundantData
GO USE DBWithRedundantData
GO --Create a Table Assigning Row Compression Create Table GreatForRowCompression
(
Col1 int
,Col2 char(5)
,Col3 char(3)
,Col4 char(2)
) WITH (DATA_Compression=ROW) --Create a Table Assigning Page Compression Create Table GreatForPageCompression
(
Col1 int
,Col2 char(5)
,Col3 char(3)
,Col4 char(2)
) WITH (DATA_Compression=PAGE) /*
Keep in mind ALTER TABLE and ALTER INDEX can be used
to implement compression when those obects already exist.
*/

3. 数据库可用性

/*
Change various database option and refresh the Mgmt
*/ -- 2.1 Setup: Add a Table and a couple of rows.
USE TinyDB;
GO Create Table dbo.T1 (Col1 int Identity, COl2 Varchar(20) default 'T1')
Insert T1 default values
GO 5 -- 2.2 Chnage Avalablity options
Alter database TinyDB
Set OFFLINE
-- The Database is Absolutely inaccessible
--Cleanly shus down the database without having to DETACH
--Refresh the Databasees node in Mgmt Studio to notice the change --Try this query to see what happens... Select * from T1 Alter database TinyDB
Set EMERGENCY
-- limited access (Only SysAdmins). This might be useful for
-- Transaction Log repairs with DBCC.
--Try this query to see what happens... Select * from T1 Alter database TinyDB
Set ONLINE -- The Default Option Alter database TinyDB
Set READ_ONLY
-- Cannot make changes to the database -- Try this query to see what happens... UPDATA T1 set Col2='dd' where Col1=1 Alter database TinyDB
Set READ_WRITE -- the Default Option Alter database TinyDB
Set SINGLE_USER
-- Only one authoritative user can connect to the database
-- Userd when DBCC CheckD repair_allow_data_loss is used Alter database TinyDB
Set RESTRICTED_USER Alter database TinyDB
Set MULTI_USER -- the Default Option

Microsoft SQL Server 2012 管理 (2): 实例与数据库管理的更多相关文章

  1. Microsoft SQL Server 2012 管理 (1): 安装配置SQL Server 重点

    SQL Server 可以在实例,数据库,列,查询分别指定排序规则 /* Module 1 - working with Clollations */ -- 1.1 Obtain the Instan ...

  2. Microsoft SQL Server 2012 管理 (2): Auditing

    -- Demostratin 2A (Using SQL Server Audit) -- Step 1: Use the master database USE master; GO -- Step ...

  3. Querying Microsoft SQL Server 2012 读书笔记:查询和管理XML数据 1 -使用FOR XML返回XML结果集

    XML 介绍 <CustomersOrders> <Customer custid="1" companyname="Customer NRZBB&qu ...

  4. 【转】Microsoft® SQL Server® 2012 Performance Dashboard Reports

    http://www.cnblogs.com/shanyou/archive/2013/02/12/2910232.html SQL Server Performance Dashboard Repo ...

  5. Microsoft SQL server 2012数据库学习总结(一)

    一.Microsoft SQL Server2012简介 1.基本概要 Microsoft SQL Server 2012是微软发布的新一代数据平台产品,全面支持云技术与平台,并且能够快速构建相应的解 ...

  6. Microsoft SQL Server 2012安装说明

    Microsoft SQL Server 2012安装说明 环境:Windows8, Windows7, WinVista, Win2003, WinXP Microsoft SQL Server 2 ...

  7. 微软推出的免费新书《Introducing Microsoft SQL Server 2012》

    微软推出的免费新书<Introducing Microsoft SQL Server 2012>,该书详细介绍微软SQL 2012数据库服务最新功能以及功能应用和使用技巧. 该书适合SQL ...

  8. Exam 70-462 Administering Microsoft SQL Server 2012 Databases 复习帖

    好吧最近堕落没怎么看书,估计这个月前是考不过了,还是拖到国庆之后考试吧.想着自己复习考试顺便也写点自己的复习的概要,这样一方面的给不准备背题库的童鞋有简便的复习方法(好吧不被题库的同学和我一样看MSD ...

  9. Microsoft® SQL Server® 2012 功能包

    Microsoft® SQL Server® 2012 功能包 http://www.microsoft.com/zh-cn/download/details.aspx?id=29065 Micros ...

随机推荐

  1. 了解大数据的特点、来源与数据呈现方式以及用Python写Mad Libs游戏

    作业的要求来自于:https://edu.cnblogs.com/campus/gzcc/GZCC-16SE2/homework/2620. 1.浏览2019春节各种大数据分析报告,例如: 这世间,再 ...

  2. 前端基础之Bootstrap

    1. 页面加载完之后才执行的JS代码        1. DOM方式            window.onload = function(){}        2. jQuery方式       ...

  3. DAO层注入HibernateTemplate的两种方式

    -------------------------siwuxie095                                         DAO 层注入 HibernateTemplat ...

  4. IIS7web服务器调试ASP.net程序遇到的一些故障的解决办法

    1. [由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页面] 故障描述:[由于 Web 服务器上的“ISAPI 和 CGI 限制”列表设置,无法提供您请求的页面] ...

  5. 单词拆分 I · Word Break

    [抄题]: 给出一个字符串s和一个词典,判断字符串s是否可以被空格切分成一个或多个出现在字典中的单词. s = "lintcode" dict = ["lint" ...

  6. discuz回贴通知插件实现-显示用户状态设置

    一.完善用户是否开启回贴通知 回贴通知插件建立模块时,指定了核心文件post_set.inc.php   1.创立好数据库 建立独立数据表(不建议直接修改原有的discuz数据库,防止discuz升级 ...

  7. centos6.6中修改yum源

    1.进入设置yum源的目录 > cd /etc/yum.repos.d 2.复制或重命名CentOS-Base.repo文件 > mv CentOS-Base.repo CentOS-Ba ...

  8. yii2中的rules 自定义验证规则详解

    yii2的一个强大之处之一就是他的Form组件,既方便又安全.有些小伙伴感觉用yii一段时间了,好嘛,除了比tp"难懂"好像啥都没有. 领导安排搞一个注册的功能,这家伙刷刷刷的又是 ...

  9. 读书笔记---改善c#编程的157个建议

    1.在拼接string时,如果牵涉到其他类型,先tostring一下会减少装箱操作:频繁操作字符串变量的话,使用stringbuilder效率较高. 2.tryParse相对于parse而言效率高,t ...

  10. asp.net (jquery easy-ui datagrid)通用Excel文件导出(NPOI)

    http://www.cnblogs.com/datacool/archive/2013/03/12/easy-ui_datagrid_export_excel_asp_net.html