Microsoft SQL Server 2012 管理 (2): 实例与数据库管理
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): 实例与数据库管理的更多相关文章
- Microsoft SQL Server 2012 管理 (1): 安装配置SQL Server 重点
SQL Server 可以在实例,数据库,列,查询分别指定排序规则 /* Module 1 - working with Clollations */ -- 1.1 Obtain the Instan ...
- Microsoft SQL Server 2012 管理 (2): Auditing
-- Demostratin 2A (Using SQL Server Audit) -- Step 1: Use the master database USE master; GO -- Step ...
- Querying Microsoft SQL Server 2012 读书笔记:查询和管理XML数据 1 -使用FOR XML返回XML结果集
XML 介绍 <CustomersOrders> <Customer custid="1" companyname="Customer NRZBB&qu ...
- 【转】Microsoft® SQL Server® 2012 Performance Dashboard Reports
http://www.cnblogs.com/shanyou/archive/2013/02/12/2910232.html SQL Server Performance Dashboard Repo ...
- Microsoft SQL server 2012数据库学习总结(一)
一.Microsoft SQL Server2012简介 1.基本概要 Microsoft SQL Server 2012是微软发布的新一代数据平台产品,全面支持云技术与平台,并且能够快速构建相应的解 ...
- Microsoft SQL Server 2012安装说明
Microsoft SQL Server 2012安装说明 环境:Windows8, Windows7, WinVista, Win2003, WinXP Microsoft SQL Server 2 ...
- 微软推出的免费新书《Introducing Microsoft SQL Server 2012》
微软推出的免费新书<Introducing Microsoft SQL Server 2012>,该书详细介绍微软SQL 2012数据库服务最新功能以及功能应用和使用技巧. 该书适合SQL ...
- Exam 70-462 Administering Microsoft SQL Server 2012 Databases 复习帖
好吧最近堕落没怎么看书,估计这个月前是考不过了,还是拖到国庆之后考试吧.想着自己复习考试顺便也写点自己的复习的概要,这样一方面的给不准备背题库的童鞋有简便的复习方法(好吧不被题库的同学和我一样看MSD ...
- Microsoft® SQL Server® 2012 功能包
Microsoft® SQL Server® 2012 功能包 http://www.microsoft.com/zh-cn/download/details.aspx?id=29065 Micros ...
随机推荐
- web中的中文乱码处理
1.页面设置pageEncoding="UTF-8" <%@ page contentType="text/html;charset=UTF-8" lan ...
- webElement.text()获取到内容为空
使用webElement.text()方法获取字符串时,有时候会获取失败--获取到的内容为空 使用 webElement.getAttribute("attributeName") ...
- Largest Rectangle in a Histogram(附上几组测试数据)
Largest Rectangle in a Histogram http://acm.hdu.edu.cn/showproblem.php?pid=1506 Time Limit: 2000/100 ...
- centos6.6 下 安装 nginx
1.安装nginx需要pcre的依赖,请安装好pcre.假设安装目录如下: /usr/local/pcre-8.38 源码目录如下: /usr/src/pcre-8.38 2.下载nginx安装压缩包 ...
- 【深度好文】多线程之WaitHandle-->派生-》Semaphore信号量构造
Semaphore 继承自WaitHandle. 信号量说简单点就是为了线程同步,或者说是为了限制线程能运行的数量. //创建一个限制资源类 //资源数为5,开放资源数为2 //主线程自动占有3个资源 ...
- ueditor使用注意
问题1:后端配置项没有正常加载,上传插件不能正常使用! 我用的是开发版,1.4.3.3 .Net版 网上查了很多,后来发现只是配置的问题而已. 1.在根目录下:config.json 其中有Img上传 ...
- inux中Vi不能高亮显示行号的解决办法
适用版本:CentOS,RedHat,UBUNTU,Fedora解决办法如下: 在UBUNTU中vim的配置文件存放在/etc/vim目录中,配置文件名为vimrc 在Fedora中vim的配置文件存 ...
- 对于cnn的理解
对于神经网络就是给他一个网络各个层之见的传导函数, 之所以这里面用卷积来替代普通的放射函数, 就是因为卷积算的快,hadmard 乘机比矩阵乘法的速度快一个次方,可能都不止. 对于高清晰度的图片算矩阵 ...
- 关于多系统跨浏览器 BrowserStack 的使用
偶然在Scott Hanselman Blogs看到一篇关于 BrowserStack 博文,对于前端多浏览器测试. 现在拥有各自内核的浏览器越来越多,各自的特性也千差万别.如果作为一个前端攻城师想要 ...
- C语言基础第三次作业
题目7-1,寻找最小值 1.实验代码: #include<stdio.h> int main() { int i,mark,min,n; scanf("%d", &am ...