Professional Documents
Culture Documents
By
The Technocrats
SQL Server Agent cannot access system tables in the msdb database, which is where operator definitions and notification
lists are stored.
All pager notifications to designated operators have failed, or the designated operators are off duty (as defined in the
pager schedule).
When the number of CPUs is greater than the number of active connections.
When the estimated cost for the serial execution of a query is higher than the query plan threshold (The estimated cost
refers to the elapsed time in seconds required to execute the query serially.)
Certain types of statements cannot be processed in parallel unless they contain clauses, however. For example, UPDATE, INSERT,
and DELETE are not normally processed in parallel even if the related query meets the criteria. But if the UPDATE or DELETE
statements contain a WHERE clause, or an INSERT statement contains a SELECT clause, WHERE and SELECT can be executed in
parallel. Changes are applied serially to the database in these cases.
To configure parallel processing, simply do the following:
1. In the Server Properties dialog box, go to the Advanced page.
2. By default, the Max Degree Of Parallelism setting has a value of 0, which means that the maximum number of processors used
for parallel processing is controlled automatically. Essentially, SQL Server uses the actual number of available processors,
depending on the workload. To limit the number of processors used for parallel processing to a set amount (up to the maximum
supported by SQL Server), change the Max Degree Of Parallelism setting to a value greater than 1. A value of 1 tells SQL Server
not to use parallel processing.
3. Large, complex queries usually can benefit from parallel execution. However, SQL Server performs parallel processing only when
the estimated number of seconds required to run a serial plan for the same query is higher than the value set in the cost threshold
for parallelism. Set the cost estimate threshold using the Cost Threshold For Parallelism box on the Advanced page of the Server
Properties dialog box. You can use any value from 0 through 32,767. On a single CPU, the cost threshold is ignored.
4. Click OK. These changes are applied immediately. You do not need to restart the server.
You can use the stored procedure sp_configure to configure parallel processing. The Transact-SQL commands are:
exec sp_configure "max degree of parallelism", <integer value>
exec sp_configure "cost threshold for parallelism", <integer value>
Configure SQL Server 2008 to Automatically Manage File
Size
With SQL Server 2008, you can manage database and log size either automatically or manually. You can use SQL Server
Management Studio or Transact-SQL to configure database or log size.
Using SQL Server Management Studio, you can configure automatic management of database and log size by performing the
following steps:
1. Start SQL Server Management Studio. In the Object Explorer view, connect to the appropriate server, and then work your way
down to the Databases folder.
2. Right-click the database you want to configure, and then select Properties from the shortcut menu.
3. Select Files from the Select A Page list in the Database Properties dialog box. Each data and log file associated with the database
is listed under Database Files. For each data and log file, do the following:
Click the button to the right of the file’s Autogrowth box to adjust the related settings. This will display the Change
Autogrowth For dialog box.
Set the file to grow using a percentage or an amount in megabytes, and then either restrict the maximum file growth to a
specific size or allow unrestricted file growth.
Click OK.
4. Optionally, access the Options page and set Auto Shrink to True. Auto Shrink compacts and shrinks the database periodically.
5. Click OK when you have finished. Your changes take effect immediately without restarting the server.
The total amount of free memory (when the system is idle and SQL Server is running)
The average number of simultaneous queries running in separate user connections
The average query size
The query response time you hope to achieve
A compromise is often necessary when setting these values. You cannot always get an instant response, but you can optimize
performance based on available resources. Use the following equation to get a starting point for the optimization:
FreeMemory / (AvgQuerySize * AvgNumSimulQueries)
For example, if the system has 2200 MB of free memory, the average query size is 2 MB, and the average number of simultaneous
queries is 50, then the optimal value for the query size is 2200 MB / (2 * 50), or 22 MB. Generally, this value represents the
maximum you should assign given the current environment, and you will want to lower this value if possible.
To allocate memory for queries, complete the following steps:
1. In the Server Properties dialog box, go to the Memory page and set a value for the Minimum Memory Per Query box. This value
is set in kilobytes.
2. Click OK.
You can also use the stored procedure sp_configure to set the minimum query size. The related command is:
exec sp_configure "min memory per query", <number of kilobytes>