SQL Server2008 Resource Governor简介
Introduction to the SQL Server 2008 Resource Governor
Database Administration, Performance Tuning | January 4, 2010 | 4:05 pm
This is an excerpt from my free eBook, Brad’s Sure Guide to SQL Server 2008.
I think most of us are familiar with this situation: a SQL Server database is the backend of an OLTP (Online Transaction Processing) application, but you are required to allow users to run any reports they want on the production data, any time they want. This often results in long-running reports that negatively affect OLTP performance. Haven’t you ever wished you could limit the amount of hardware resources allocated to reporting, so that normal production activity is not affected?
In SQL Server 2008, you can. The Resource Governor, available only in the Enterprise Edition of SQL Server 2008, is a technology that allows you to selectively control how much CPU and memory resources are assigned to a particular workload. For example, the Resource Governor allows you to specify that no more than 20% (or any figure you designate) of CPU and/or memory resources can be allocated to running reports. When this option is turned on, then no matter how many reports are run, they can never exceed their designated resource allocation. Of course, this will reduce the performance of reporting, but at least now production OLTP activity won’t be as negatively affected by reports.
Currently, Resource Governor only works within the database engine. It does not work with Integration Services, Reporting Services, or Analysis Services.
In this chapter you will learn how you can use the Resource Governor to better prioritize and manage a SQL Server’s workload, how Resource Governor works under the hood, and how to configure it for use.
Uses for Resource Governor
Resource Governor is designed to help DBAs four different ways:
Managing Unpredictable Workloads
As in my reporting example above, it is often difficult to know how your SQL Server resources are
相关文档:
String strServerName = "服务器名或IP";
String strUserID = "数据库用户名";
String strPSW= "数据库密码";
DataTable DBNameTable = new DataTable();
OleDbConnection Connection = new OleDbConnection(String.Format("Provider=SQLOLEDB;Data Source={0};User ID={1};PWD={2}", strServerName, strUserID, strPS ......
--语 句 功 能
--数据操作
SELECT --从数据库表中检索数据行和列
INSERT --向数据库表添加新数据行
DELETE --从数据库表中删除数据行
UPDATE --更新数据库表中的数据
--数据定义
CREATE TABLE --创建一个数据库表
DROP TABLE --从数据库中删除表
ALTER TABLE --修改数据库表结构
CREATE VIEW --创建一个视图
DRO ......
1.字符串函数 :
datalength(Char_expr) 返回字符串包含字符数,但不包含后面的空格
length(expression,variable)指定字符串或变量名称的长度。
substring(expression,start,length) 不多说了,取子串
right(char_expr,int_expr) 返回字符串右边int_expr个字符
concat(str1,str2,...)返回来自于参数连结的字符串。dat ......
查询速度慢的原因很多,常见如下几种:
1、没有索引或者没有用到索引(这是查询慢最常见的问题,是程序设计的缺陷)
2、I/O吞吐量小,形成了瓶颈效应。
3、没有创建计算列导致查询不优化。
4、内存不足
5、网络速度慢
6、查询出的数据量过大(可以采用多次查询,其他的方法降低数据量) ......
刚在看书,提到了sql server的模式匹配运算,接着想到了通配符的转义问题,因为太久没用,Google了搜索了一下才想起来,写几句话记录下。 关于通配符的转义,sql server里边提供了关键字escape来处理。但是escape本身不是什么转义符(刚才我就是在这里搞错了),而是将escape后面的符号定义为转义符。举个例: select ......