Logo
CAR REVIEW
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
PREGNANCY
 
 
Windows Server

SQL Server 2008 : Configuring the Instance (part 3)

6/26/2011 4:14:36 PM

7. Enabling Dedicated Administrator Connections

SQL Server 2008 provides a method for members of the sysadmin group to connect to an unresponsive instance of SQL Server, even when other connections are failing. This feature improves the database administrator's ability to troubleshoot problems within SQL Server.

By default, in order to utilize a dedicated administrator connection, you must connect on the server itself through SQLCMD or SQL Server Management Studio. Luckily, Microsoft allows you to enable remote dedicated administrator connections, which will allow you to connect to the dedicated administrator connection from across the network. Enable remote dedicated connections for administrators by executing the following code from a query window:

EXEC sys.sp_configure 'remote admin connections' ,1
GO

RECONFIGURE
GO

You should now be able to log in as an administrator, not only locally but across the network as well. This ability is invaluable when your server is in trouble and normal logins are not going through.

8. Disabling Default Trace

By default, SQL Server 2008 enables a server-side trace to start when the SQL Server service starts for an instance. When you start a SQL Server instance, the trace captures some database options, errors and warnings, full-text information, objects creation, deletion and alters, as well as security and memory changes on the server. The trace is light-weight and should not cause performance problems. However, if for some reason you do not want this trace running, then you can disable it by executing the following commands:

EXEC sys.sp_configure 'default trace enabled' ,0
GO

RECONFIGURE
GO

Think twice before disabling the trace because it can help you capture events when they occur. How many times have you been asked questions about who performed a certain action or at what time the action occurred? If you do not have a trace running at the time the action occurred, you will be unable to provide an adequate answer to such questions. With the default trace, however, such questions may be easily answered.

9. Enabling Use of the CLR (Common Language Runtime)

The clr enabled option within SQL Server 2008 allows SQL Server to run assemblies. By default, the option is disabled, or set to zero. That means assembly executions aren't allowed or permitted to run within SQL Server 2008. You can enable the use of the CLR as follows:

EXEC sys.sp_configure 'clr enabled' ,1
GO

RECONFIGURE
GO

Changes to the clr enabled option are effective immediately. You do not need to restart your service. Disabling CLR after it has been enabled causes any application domains that include user assemblies to unload immediately following the RECONFIGURE statement.

10. Choosing Lightweight Pooling

Lightweight pooling is an option available in SQL Server 2008 that can potentially help in multiprocessor environments that experience heavy context switching. Lightweight pooling potentially increases throughput, which can increase performance.

Enable lightweight pooling by executing the following code:

EXEC sys.sp_configure sp_configure 'lightweight pooling', '1'
GO

RECONFIGURE
GO

Unfortunately, you cannot enable common language runtime after the enabling of lightweight pooling. So spend a little time contemplating your need for the CLR prior to enabling lightweight pooling. If you do enable the feature, SQL Server will generate a message to remind you that you also must disable the use of the CLR.

We have experienced problems with our linked server queries failing after our having enabled lightweight pooling. Our particular problems became apparent upon restart of our services. If you are working in an environment with linked servers, then make sure you test thoroughly before enabling lightweight pooling.


11. Enabling a Query Governor Cost Limit

Have you ever identified resource-intensive queries on your system that cause all sorts of performance problems? We especially get annoyed with users who execute queries and forget the where clause and the nolock hint on the largest table in our Very Large Databases (VLDB). To avoid such problems, you can specify a maximum limit in seconds for queries executed against your server. Such a limit is termed a query governor cost limit. Before you can specify a limit in seconds, you must enable the option as follows:

EXEC sys.sp_configure 'query governor cost limit' ,1
GO

RECONFIGURE
GO

We know this option sounds great, and it can definitely be a method for improving performance. However, we encourage you to consider the consequences of preventing certain processes from running against your server. Believe me, we're on your side—we would love to make developers write better code, and preventing a process from running is one way to force developers to write that code better. Unfortunately, your boss's boss, who really needs the results from a long-running query, may not be as understanding. Make sure you set a query limit decision wisely. The Resource Governor that was added in SQL Server 2008 actually provides much more flexibility when dealing with resource-intensive queries.

12. xp_cmdshell

xp_cmdshell is a configurable option that allows you to disable or enable the use of the extended stored procedure xp_cmdshell. xp_cmdshell is used to execute command-line statements from within the database engine. If you need it though, you can enable xp_cmdshell by executing the following code:

EXEC sys.sp_configure 'xp_cmdshell' ,1
GO

RECONFIGURE
GO

Be careful! By default, the xp_cmdshell stored procedure is disabled during install and should remain disabled if it is not required by the application. Think about it—once a user gains access to your system, he has the power to cause all sorts of havoc on your server.

13. Miscellaneous Configuration Options

In this section, we describe a set of configuration options requiring more expertise before enabling on your SQL Server. Most of these setting have a direct impact on how your SQL Server will process queries, and we strongly recommend testing, and hopefully load testing, before enabling these options in your production environment. To be honest, we do not tweak all of the configuration options we describe here, but we think they are important to know about. Here's the list:

  • Blocked Process Threshold: Amount of time a process is blocked before a blocked process report is generated. The threshold is measured in seconds, and alerts can be generated when these events are triggered.

    EXEC sys.sp_configure 'blocked process threshold' ,1
    GO

    RECONFIGURE
    GO

  • Cursor Threshold: Threshold used to determine if the cursor will be processed synchronously (wait on all the rows to be returned) or asynchronously (allows users to get data from cursor while it retrieves the data), depending on the amount of rows returned for the result set.

    EXEC sys.sp_configure 'cursor threshold' ,1
    GO

    RECONFIGURE
    GO

  • Cost Threshold for Parallelism: Threshold used to figure out when a query should be executed in parallel versus serially. In other words, when this threshold is surpassed, the query will be executed using parallelism.

    EXEC sys.sp_configure 'cost threshold for parallelism' ,1
    GO

    RECONFIGURE
    GO

  • Maximum Degree of Parallelism: Threshold used to determine the maximum number of processors that can be used to process a single query during a parallel execution.

    EXEC sys.sp_configure 'max degree of parallelism' ,1
    GO

    RECONFIGURE
    GO

  • Query Wait: Threshold in seconds that determines the amount of time a query waits on resources before it times out. By default, the query wait time is set to wait 25 times of the estimated cost of query.

    EXEC sys.sp_configure 'query wait' ,60
    GO

    RECONFIGURE
    GO

  • User Connections: Sets the number of user connections for an instance of SQL Server.

    EXEC sys.sp_configure 'user connections' ,1000
    GO

    RECONFIGURE
    GO
Other -----------------
- SQL Server 2008 : Configuring the Instance (part 2) - Specifying the Backup Compression Default & Enabling Login Failure Auditing
- SQL Server 2008 : Configuring the Instance (part 1) - Viewing Configuration Settings & Specifying Maximum and Minimum Server Memory
- Microsoft PowerPoint 2010 : Expanding PowerPoint Functionality - Loading and Unloading Add-ins
- Microsoft PowerPoint 2010 : Expanding PowerPoint Functionality - Viewing and Managing Add-ins
- Microsoft Dynamics CRM 2011 : Sending and Tracking Email Messages in Microsoft Dynamics CRM for Outlook
- Microsoft Dynamics CRM 2011 : Using Microsoft Dynamics CRM for Outlook - Using the Add Contacts Wizard
- Microsoft Dynamics CRM 2011 : Using Microsoft Dynamics CRM for Outlook - Creating and Tracking Contacts
- Windows Server 2008 R2 : Managing Disks and Disk Storage - Understand the Basics (part 2) - Work with Partitions & Use DiskPart
- Windows Server 2008 R2 : Managing Disks and Disk Storage - Understand the Basics (part 1) - Work with Your Storage
- SharePoint 2010 : Securing a SharePoint Farm
- SharePoint 2010 : Introducing SharePoint Security
- SQL Server 2008 : SQL Server Configuration Manager (part 2) - SQL Server Network Configuration
- SQL Server 2008 : SQL Server Configuration Manager (part 2) - SQL Server Network Configuration
- SQL Server 2008 : SQL Server Configuration Manager (part 1) - SQL Server Services
- BizTalk 2009 : WCF LOB Adapter SDK - WCF LOB Adapter Vivisected
- BizTalk 2009 : WCF LOB Adapter SDK - WCF LOB Adapters vs. WCF Services
- BizTalk 2009 : Understanding the WCF LOB Adapter
- SQL Server 2008 High Availability : Database Clustering
- SQL Server 2008 High Availability : Database Mirroring (part 2) - SharePoint and Database Mirroring
- SQL Server 2008 High Availability : Database Mirroring (part 1) - How to Configure Database Mirroring
 
 
Most view of day
- Microsoft Exchange Server 2007 : Load Balancing in Exchange Server 2007
- Programming Drivers for the User Mode Driver Framework - Driver Dynamic-Link Library and Exports
- Microsoft Exchange Server 2010 : Working with SMTP Connectors, Sites, and Links (part 7) - Viewing and Managing Receive Connectors
- Adobe InDesign CS5 : Managing Pages and Books - Working with Master Pages
- Windows Phone 8 : Configuring Basic Device Settings - Accessing the Device Settings Screen - Changing the Device Theme
- QuarkXPress 8 : Checking spelling (part 2) - Searching and replacing, Exporting text
- Duplicating and Copying DVDs (part 3) - Ripping DVDs in H.264 Format
- SQL Server 2008 R2 : Creating and Managing Stored Procedures - Startup Procedures
- Windows Server 2008 Server Core : Renaming a File with the Ren and Rename Commands, Sorting File Content with the Sort Utility
- Microsoft Visio 2010 : Linking External Data to Shapes (part 4) - Using the Database Wizard - Taking the Data-Linked Light Bulb Shape for a Spin
Top 10
- Windows Phone 8 : Scheduled Tasks - Scheduled Task API Limitations
- Windows Phone 8 : Scheduled Tasks - Updating Tiles Using a Scheduled Task Agent
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 5) - Editing an Existing To-Do Item
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 4) - Creating the To-Do Item Shell Tile, Saving a To-Do Item
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 3) - Debugging Scheduled Tasks
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 2) - TodoService, TodoItemViewModel
- Windows Phone 8 : Scheduled Tasks - To-Do List Scheduled Task Sample (part 1) - TodoItem,TodoDataContext
- Windows Phone 8 : Scheduled Tasks - Using Scheduled Tasks
- Windows Phone 8 : Scheduled Tasks - Background Agent Types
- Windows Phone 8 : Windows Phone Toolkit Animated Page Transitions - Reusing the Transition Attached Properties
 
 
Windows XP
Windows Vista
Windows 7
Windows Azure
Windows Server
Windows Phone
2015 Camaro