Chapter 16. SQL Server in the Enterprise

Now that you are armed with the DBA knowledge presented thus far, how do you keep track of all the databases that you create and manage? Better yet, how do you monitor changes and ensure that your best practices are applied throughout the enterprise? It turns out that there's quite a bit of functionality to assist you in managing the data management environment in your enterprise.

Typically, in an enterprise environment, we are faced with managing multiple SQL Server instances and even more databases. Best practices dictate that we use a common approach for our entire environment. In the past, DBAs applied consistent management and monitoring in database environments by using manual processes. Today, certain tools allow you to define policies and collect information about your environment in an automated and consistent manner. In Chapter 15, you learned about a few of these tools that come within SQL Server, including policy-based management. In this chapter, you will learn about another product that is used within enterprises called Microsoft System Center Operations Manager (SCOM). SCOM is an enterprise tool used to capture and monitor information about your entire IT environment. It is not used just for SQL Server but rather for all applications, servers, and desktops within your enterprise.

Systems Center Operations Manager 2007

With the ever-increasing complexity and volume of applications in a typical corporate environment, it is critical that administrators have a way to manage and monitor their business-critical applications in a consistent and standard way. Microsoft System Center Operations Manager is part of Microsoft System Center, which is a suite of products that allows you to capture and aggregate knowledge and information about your IT environment. System Center consists of the following core products:

  • System Center Operations Manager (SCOM): This is an end-to-end service management product. We will be discussing this product in detail in this chapter.

  • System Center Data Protection Manager (DPM): This provides continuous protection for Microsoft applications using seamlessly integrated disk and tape. We will be discussing this product in detail in this chapter.

  • System Center Configuration Manager 2007 R2: This enables enterprise configuration management across physical, virtual, distributed, and mobile environments.

  • System Center Virtual Machine Manager 2008: This provides central management of virtual machine resources including configuration, deployment, and monitoring.

  • System Center Essentials: This is designed for midsize organizations to effectively manage their IT infrastructure.

SCOM 2007 addresses the end-to-end monitoring challenge by providing a comprehensive organizational view of the health of the enterprise IT environment. SCOM is the best manager of Windows-based systems available, and each of the Microsoft Server products, such as SQL Server 2008, provides a plug-in known as a management pack that allows SCOM to provide management and monitoring centrally.

Figure 16-1 shows the System Center Operations Manager Operations Console, which is used to monitor and manage your environment. Notice that the Overview section provides you with tasks, information, and a high-level state of the systems under management.

System Center Operations Manager—Monitoring node

Figure 16.1. System Center Operations Manager—Monitoring node

The SQL Server management pack for SCOM provides end-to-end management for the SQL Server platform, including servers back to SQL 2000. One of the great features of the SCOM is that it allows you to monitor and manage your entire database environment, including the OS, from one console. The intent of this environment is not meant to replace the features of SQL Server Management Studio; however, as mentioned earlier, it does provide you with a mechanism to collect SQL server events and alerts and then perform management activities on those events and alerts.

Note

This discussion of Systems Center Operations Manager assumes that you have installed Systems Center Operations Manager 2007. In addition, this discussion will focus on the features of Systems Center Operations Manger related to SQL Server. The Systems Center platform provides a rich infrastructure that can accommodate all your system management needs. Check to see whether your IT organization already uses Systems Center for management in other areas. For details on installation, see Systems Center Books Online.

The SQL Server SCOM management pack is a culmination of the best practices and design principles from the SQL Server product team. The service pack contains a predefined set of events, alerts, best practices, knowledge, and actions to be performed within SCOM to provide for true enterprise-caliber SQL Server management.

Installing the SQL Server SCOM Management Pack

Installing the SQL Server management pack is largely straightforward. However, you should be aware of one kink. The management pack uses a SQL Server feature called SQL Data Management Objects (SQL-DMO) that is deprecated in SQL Server 2008. To use SCOM to manage a SQL Server 2008 database, you must install SQL-DMO into each SQL Server 2008 database you want to manage from the Microsoft SQL Server 2005 backward-compatibility components available within the SQL Server 2008 Feature Pack. At the time of this writing, the most recent SQL Server 2008 feature pack is dated October 2008. The URL for this feature pack is at http://www.microsoft.com/downloads/details.aspx?familyid=228DE03F-3B5A-428A-923F-58A033D316E1. This limitation requiring SQL-DMO should be addressed in the next major release of Systems Center Operations Manager.

After installing SQL-DMO into any SQL Server 2008 database that you plan to manage, you can proceed to install the management pack as follows:

  1. First start the Operations Manager Console by selecting Start

    Installing the SQL Server SCOM Management Pack
  2. Select the Administration tab in the lower-left pane.

  3. Then in the Administration explorer in the upper left, right-click Management Packs, and select Import Management Packs, as shown in Figure 16-2.

    System Center Operations Manager—Management Packs node

    Figure 16.2. System Center Operations Manager—Management Packs node

  4. Finally, select the management packs you want to use from the directory in which they were installed (the directory you chose while installing the management pack), as shown in Figure 16-3. For SQL Server 2008, select the three management packs listed in Table 16-1.

Table 16.1. System Center Operations Manager—SQL Server 2008 Management Packs

Management Pack Name

Features

Description

Microsoft.SQLServer.Library.mp

SQL Server Core Library

This management pack contains object types and groups that are common among the supported SQL Server version (currently 2000, 2005, and 2008).

Microsoft.SQLServer.2008.Discovery.mp

SQL Server 2008 (Discovery)

This management pack contains the object types and groups that are specific to SQL Server 2008. It also includes the discovery logic to detect all objects defined on servers running SQL Server 2008.

Microsoft.SQLServer.2008.Monitoring.mp

SQL Server 2008 (Monitoring)

This management pack provides all monitoring for SQL Server 2008.

Installing management packs in SCOM

Figure 16.3. Installing management packs in SCOM

Getting Familiar with the SQL Server Management Pack

Administrators and DBAs use SCOM to see their entire application environment, from the front-end clients to the middleware and back-end SQL databases including the server hardware. This allows them to monitor not only the databases but also all the components of the line-of-business applications that SQL Server supports.

Table 16-2 lists the views that are grouped under the Microsoft SQL Server node in the Monitoring pane of the Operations Console, as shown in Figure 16-4. If you need additional capabilities, you can add your own events, alerts, and rules and perform SQL DB engine tasks from the console.

Table 16.2. SQL Server Management Views Available from SCOM

View Folder

View Name

Description

--

Active Alerts

Displays an aggregation of all alerts that are not closed

--

Computers

Displays a state view of all the computers running SQL Server

--

Task Status

Displays a status view of all available tasks

Databases

Database Free Space

Displays the percent of free space for each selected database

Databases

Database State

Lists monitored databases and their current state.

Databases

Transaction Log Free Space

Displays the percent of free space in the transaction log for each selected database

Health Monitoring

Agent Health

Provides a dashboard view that displays the health of SQL Agents and, for each agent, the alerts that have not been closed

Health Monitoring

Database Agent Health

Provides a dashboard view that displays the health of each database engine instance, including a list of the alerts that have not been closed for that database engine instance and for any objects that instance contains

Performance

All Performance Data

Displays the collected statistics for each database selected

Performance

Database Free Space

Displays the percent of free space for each selected database

Performance

Transaction Log Free Space

Displays the percent of free space in the transaction log for each selected database

Performance

User Connections

Displays the number of user connections for the selected databases

Replication

Distributor State

Displays the state of the distributor(s)

Replication

Publication State

Displays the state of the publication(s)

Replication

Publisher State

Displays the state of the publisher(s)

Replication

Subscription State

Displays the state of the subscription(s)

Server Roles

Analysis Services

Lists the instances where Analysis Services is installed

Server Roles

Database Engines

Lists the instances where SQL Server is installed

Server Roles

Integration Services

Lists the instances where Integration Services is installed

Server Roles

Reporting Services

Lists the instances where Reporting Services is installed

SQL Agent

SQL Agent Job State

Lists the agent jobs

SQL Agent

SQL Agent State

Lists the SQL Agents (if agent jobs have been discovered, also contains columns for each agent job and their respective health states)

Monitoring database free space with SCOM

Figure 16.4. Monitoring database free space with SCOM

Finding and Resolving an Issue

So, how do you use the Operations Console to find and resolve an issue? In the following paragraphs, we will show how to do just that. In Figure 16-5, you can see that there is a critical agent alert from SQL Server under Health Monitoring. The alert indicates that the SQL Server Agent has stopped on the server SQL08DEMO.

SCOM Agent health and SQL agent state

Figure 16.5. SCOM Agent health and SQL agent state

If you click the alert in the Agent Alerts window, you will see the alert details (located in the bottom-center pane in Figure 16-6). Notice that the details give you a lot of valuable information. You get detailed information about the alert (the source, path, monitor that detected the issue, and when it was created), as well as additional knowledge such as causes for the alert and, most important, a resolution. In this case, the resolution is to attempt to start the SQL Agent service on the SQL08DEMO server.

Agent health—the alert details

Figure 16.6. Agent health—the alert details

If you click the "Start SQL Agent service" link as indicated in the resolution, SCOM will open a task window that will allow you to execute the resolution recommendation (in this case, starting SQLSERVERAGENT), as shown in Figure 16-7.

Starting SQL Server Agent from SCOM

Figure 16.7. Starting SQL Server Agent from SCOM

You can modify any parameters here and then click Run. You will see the result in the Task Status window, as shown in Figure 16-8. In this case, you can see the successful completion and detailed output from the execution of the task.

Run Task execution status

Figure 16.8. Run Task execution status

We've covered only a small portion of the features available in SCOM with the SQL Server management pack. Refer to Books Online for more detailed information. You'll find a wealth of it—enough to fill a small book.

Using System Center Data Protection Manager

We have talked a lot about SCOM in this chapter since it plays a key role in providing a centralized administration and management environment. There is a parallel utility that is part of the core products in the System Center suite called System Center Data Protection Manager (DPM). DPM extends the basic data protection capabilities in SQL Server by guarding databases with more granular control over recovery time and recovery points (the last time you took a backup).

The recovery time is a function of the time it takes to recover the transactions that have been lost since the last recovery point. Under normal circumstances, the frequencies of standard backups you perform with SQL Server 2008 are limited by the speed of the backup system and the volume of data being backed up. This prevents you from creating frequent recovery points and thus minimizing your recovery time. DPM provides much more granular protection by combining SQL Server's transaction log architecture with DPM's block-level synchronization.

After the initial setup, DPM can provide synchronization as often as every 15 minutes. Online snapshots represent differential backups that leverage transaction log replication and block-level synchronization in conjunction with the SQL Server VSS Writer as part of the DPM backup technology. DPM can maintain up to 512 snapshots or differential backups. See Figure 16-9 for the architecture of a DPM solution.

Data Protection Manager architecture

Figure 16.9. Data Protection Manager architecture

Another way that DPM extends the protection solution for SQL Server is by allowing you to mix disk and tape as recovery media. Recovery with DPM is provided at the database level, and an entire protected server can be restored with DPM if you capture system state. The main features of DPM for SQL Server are as follows:

  • Disk-to-disk-to-tape backups can be performed seamlessly.

  • You can perform recoveries within minutes instead of hours.

  • The unified policy allows protection of multiple data types to any media, in one schedule and with common tuning options.

  • Backup windows are virtually eliminated.

  • Data loss can be as small as 15 minutes.

  • You can recover directly from the console, with no need to stage data.

  • You can remove tapes from branch offices and centralize backups at the data center.

To illustrate the benefit of DPM, we will show how to set up a protection group, run a status report on the group, and finally recover a database.

Setting Up a Protection Group

To use DPM, you begin by organizing one or more databases into a protection group. You then define goals on a group-by-group basis. This is much more efficient than managing each database as a separate entity.

For example, the following steps show how to create a protection group:

  1. Open the DPM Administrator Console (Start

    Setting Up a Protection Group
  2. The Create Protection Group window will open. Click Next to continue beyond the welcome page. Select the group members from the "Available members" list. In this case, we selected the Engineering database, as shown in Figure 16-10. Click Next.

    Selecting members for a protection group

    Figure 16.10. Selecting members for a protection group

  3. Next, give your protection group a name, and select a protection method. In this case, we selected Disk, as shown in Figure 16-11. Click Next.

    Selecting the data protection method

    Figure 16.11. Selecting the data protection method

  4. Select your short-term protection goals. In this case, we selected a retention range of 30 days and a synchronization frequency of every 15 minutes. The express full backup will be performed at 8 p.m. every day, as shown in Figure 16-12. Click Next.

    Selecting short-term goals

    Figure 16.12. Selecting short-term goals

  5. In the next step, DPM will show you the recommended disk allocation. You can change the disk space allocated in DPM if you want by clicking the Modify button. In this example, just click Next.

  6. To start the protection process, an initial replica of the data must be copied to the DPM server. In this step, you select the method you want to use. In this example, select Automatically and Now. Then click Next.

  7. At this point, you need to review your selections prior to executing the creation of the protection group. If they meet your expectations, click Create Group.

  8. This is the final step in the Create Group process, and it might take a little while for the replica to be copied to the DPM server. Once the group has been created successfully, you will see a result, as shown in Figure 16-13.

Results of creating a Data Protection Manager group

Figure 16.13. Results of creating a Data Protection Manager group

Executing DPM Reports

Data Protection Manager comes with a series of reports that will help you understand various aspects of your protection environment. See Figure 16-14 for the categories of reports.

Data Protection Manager reports

Figure 16.14. Data Protection Manager reports

If you execute the Status report, you will see the result in Figure 16-15, which shows you the status of all your recovery points. In this example, we have not been running very long and have only two recovery points.

Data Protection Manager Status report

Figure 16.15. Data Protection Manager Status report

Recovering a Databases

Recovering a database in DPM is a straightforward process. The Recovery tab in the Administrator Console lists the protected data. In the case of restoring a SQL Server database, navigate down the tree structure to locate the database that you want to restore. Figure 16-16 shows an example of a recovery selection.

Reviewing recovery selection for a database restore

Figure 16.16. Reviewing recovery selection for a database restore

The process of recovering protected SQL Server data with DPM provides several choices:

  • Recover a database to its original location: Recovers the SQL data directly where it was originally hosted by allowing DPM to restore the data directly.

  • Recover a database to an alternate location on the same server: Provides a database administrator with the ability to recover a database to a different location. This is particularly useful for ad hoc recoveries of data without affecting the production environment.

  • Recover database files to an alternate server: Delivers the database files to a different server running the DPM agent.

  • Recover database files to tape: Packages the database files to offline tape media.

DPM allows you to extend the backup and recovery capabilities of SQL Server 2008 by leveraging a combination of transaction log replication and block-level synchronization via SQL Server Volume Shadow Service (VSS) Writer to guarantee your databases are backed up with integrity. DPM provides continuous data protection, which allows you to easily recover SQL Server 2008 databases to their original or any other location quickly and efficiently.

Summary

In this chapter, we introduced some very important topics related to using SQL Server 2008 in the enterprise. We covered how each of those topics relate to SQL Server 2008 and gave you some practical examples and recommendations as to which tools and techniques you can use to successfully deploy and manage SQL Server 2008 in your enterprise.

Our coverage in this chapter has been brief and shallow by necessity. Systems Center, auditing, and compliance are subjects on which entire books have been written.

We hope we've give you a good taste of what is available to help you when faced with larger numbers of databases to manage, but you should read more before charging forward too far with any of the tools we've discussed. Table 16-3 lists a number of additional resources where you can find more detail on the topics introduced in this chapter.

Table 16.3. Further Reading on Enterprise Management Features

Resource

Description

SQL Server Books Online

http://msdn.microsoft.com/en-us/library/ms130214.aspx

SQL Server 2008 Enterprise Features

http://www.microsoft.com/sqlserver2008/en/us/enterprise.aspx

Enterprise Policy Management Framework with SQL Server 2008

http://msdn.microsoft.com/en-us/library/dd542632.aspx

Enterprise Policy Management Framework download:

http://www.codeplex.com/EPMFramework

Accelerated SQL Server 2008

http://www.apress.com/book/view/1590599691

System Center Configuration Manager R2

http://www.microsoft.com/configmgr

System Center Virtual Machine Manager 2008

http://www.microsoft.com/systemcenter/scvmm

System Center Essentials

http://www.microsoft.com/systemcenter/sce

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset