Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

²éѯSQL·þÎñÆ÷ËùÓÐÊý¾Ý¿âÃû

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 ......

SQL Server 2005 ÖÐ ROW_NUMBER() º¯ÊýµÄ¼òµ¥Ó÷¨

±íÃû£ºd_ClientInfo
Óï¾ä×÷ÓãºÈ¡³öµÚ100-120ÌõÊý¾Ý
 SELECT *
from (SELECT ROW_NUMBER() OVER (ORDER BY ClientID ASC) AS ROWID, * from d_ClientInfo) AS tmpTable
WHERE ROWID BETWEEN 100 AND 120
´Ëº¯Êý»áΪÊý¾Ý±íÖØÐ±àºÅ²¢Ð½¨Êý¾ÝÁÐROWID£¬²»ÐèÒªµÄÆÁ±Îµô¾ÍOKÁË¡£ ......

Oracle DBAÊÖ¼ÇÖ®¡°V$SQLÊÓͼÏÔʾ½á¹ûÒì³£µÄÕï¶Ï¡±

±¾ÎĽÚÑ¡×Ô¡¶Oracle DBAÊּǗ—Êý¾Ý¿âÕï¶Ï°¸ÀýÓëÐÔÄÜÓÅ»¯Êµ¼ù¡·µÚ2Õ“YangtingkunµÄDBA¹¤×÷Êּǔ £¨×÷ÕߣºÑîÍ¢çû£©
V$SQLÊÓͼÏÔʾ½á¹ûÒì³£µÄÕï¶Ï
ÓÐÒ»´ÎÅöµ½Ò»¸öºÜÆæ¹ÖµÄÎÊÌ⣬ÔÚ¼ì²é»á»°ËùÖ´ÐеÄSQLʱ£¬·¢ÏÖV$SQLÊÓͼÖÐSQL_TEXTÁÐÖеÄÊý¾ÝÊDz»Õý³£µÄ¡£
ÓÉÓÚV$SQLÊǶ¯Ì¬ÐÔÄÜÊÓͼ£¬ÀïÃæ±£´æµÄÊǵ± ......

SQLÓï¾ä´óÈ«(3)

--Óï ¾ä¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¹¦ ÄÜ
--Êý¾Ý²Ù×÷
SELECT¡¡¡¡¡¡--´ÓÊý¾Ý¿â±íÖмìË÷Êý¾ÝÐкÍÁÐ
INSERT¡¡¡¡¡¡--ÏòÊý¾Ý¿â±íÌí¼ÓÐÂÊý¾ÝÐÐ
DELETE¡¡¡¡¡¡--´ÓÊý¾Ý¿â±íÖÐɾ³ýÊý¾ÝÐÐ
UPDATE¡¡¡¡¡¡--¸üÐÂÊý¾Ý¿â±íÖеÄÊý¾Ý
--Êý¾Ý¶¨Òå
CREATE TABLE¡¡¡¡--´´½¨Ò»¸öÊý¾Ý¿â±í
DROP TABLE¡¡¡¡ --´ÓÊý¾Ý¿âÖÐɾ³ý±í
ALTER ......

SQL PL ¼ò½é

----start
     SQL(Structured Query Language)£¬Ò²¾ÍÊǽṹ»¯²éѯÓïÑÔ£¬Ëü±»Éè¼ÆÓÃÀ´²Ù×÷¼¯ºÏµÄ£¬ÊǷǹý³Ì»¯µÄÓïÑÔ¡£Ëæ×ÅÓ¦ÓóÌÐòµÄ·¢Õ¹£¬ÒµÎñÂß¼­Ô½À´Ô½¸´ÔÓ£¬´«Í³µÄSQLÒѾ­²»ÄÜÂú×ãÈËÃǵÄÒªÇó£¬ÓÚÊÇÈËÃǶÔSQL½øÐÐÁËÀ©Õ¹£¬Ê¹Ëü¾ßÓÐÁ˹ý³Ì»¯µÄÂß¼­£¬¼´£ºSQL PL¡£SQL PLµÄÈ«³ÆÊÇ SQL Procedural Language£ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ