Managing Your SQL Servers

  • 2/15/2012

Managing SQL Server Groups

You use SQL Server groups to organize sets of computers running SQL Server. You define these server groups, and you can organize them by function, department, or any other criteria. Creating a server group is easy. You can even create subgroups within a group, and if you make a mistake, you can delete a group as well.

Introducing SQL Server Groups and the Registered Servers View

In SQL Server Management Studio, you use the Registered Servers view to work with server groups. To use this view, or to display it if it is hidden, press Ctrl+Alt+G.

The top-level groups are already created for you, based on the SQL Server instances. Use the Registered Servers toolbar to switch between the various top-level groups. These groups are organized by SQL Server instance as follows:

  • Database Engine

  • Analysis Services

  • Reporting Services

  • SQL Server Compact Edition

  • Integration Services

Although you can add registered servers directly to the top-level groups (as explained in the Managing Servers section later in this chapter), in a large enterprise with many SQL Server instances, you probably want to create additional levels in the server group hierarchy. These additional levels make it easier to access and work with your servers. You can use the following types of organizational models:

  • Division or business unit model. In this model, group names reflect the divisions or business units to which the computers running SQL Server belong or in which they are located. For example, you could have server groups such as Engineering, IS, Operations, and Support.

  • Geographic location model. In this model, group names reflect the geographic location of your servers, such as North America and Europe. You could have additional levels under North America for USA, Canada, and Mexico, for example, and levels under Europe could include UK, Germany, and Spain.

Figure 1-4 shows an example of using server groups. As the figure shows, subgroups are organized under their primary group. Under Database Engine, you might have Corporate Customers, Engineering, and Enterprise Data groups. Within Engineering, you might have Dev, Test, and Core subgroups.

Figure 1-4

Figure 1-4 Use server groups to organize SQL Server deployments.

Creating a Server Group

You can create a server group or a subgroup by completing the following steps:

  1. In SQL Server Management Studio, display the Registered Servers view by pressing Ctrl+Alt+G. If the view was previously hidden, this step also displays the view.

  2. Use the Registered Servers toolbar to select the top-level group. For example, if you want to create a second-level or third-level group for Database Engine instances, select Database Engine.

  3. As necessary, expand the top-level group node and the Local Server Groups nodes by double-clicking each in turn. You will see the names of the top-level server group and any second-level server groups that you created. You can now do the following:

    • Add a server group to one of the top-level or second-level groups by right-clicking the group name and choosing New Server Group.

    • Add a server group to a lower-level group by expanding the server group entries until the group you want to use is displayed. Right-click the group name, and then choose New Server Group.

  4. In the New Server Group Properties dialog box, shown in Figure 1-5, type a name and description for the new group in the boxes provided. Click OK.

Figure 1-5

Figure 1-5 Enter a name and description in the New Server Group Properties dialog box.

Deleting a Server Group

You can delete a group or subgroup by completing the following steps:

  1. In SQL Server Management Studio, display the Registered Servers view by pressing Ctrl+Alt+G. If the view was previously hidden, this step also displays the view.

  2. Use the Registered Servers toolbar to select the top-level group in which the group you want to delete is located. For example, if you want to delete a second- or third-level group for Database Engine instances, select Database Engine.

  3. Click the plus sign (+) next to the group or subgroup you want to delete. If the group has servers registered in it, move them to a different group. (The steps involved in moving servers to a new group are explained in the Moving a Server to a New Group section later in this chapter.)

  4. Select the group or subgroup entry.

  5. Press Delete. When prompted to confirm the action, click Yes.

Editing and Moving Server Groups

Server groups have several key properties that you can edit: the name, the description, and the location in the Registered Server hierarchy. To edit a group’s name or description, follow these steps:

  1. Right-click the group in the Registered Servers view, and then select Properties.

  2. In the Edit Server Group Properties dialog box, enter the new group name and description. Click OK.

To move a group (and all its associated subgroups and servers) to a new level in the server group hierarchy, follow these steps:

  1. Right-click the group in the Registered Servers view, point to Tasks, and then select Move To.

  2. In the Move Server Registration dialog box, you can now do the following:

    • Move the group to the top-level group by selecting the top-level group. This makes the group a second-level group.

    • Move the group to a different level by selecting a subgroup into which you want to place the group.

  3. Click OK.

Adding SQL Servers to a Group

When you register a computer running SQL Server for use with SQL Server Management Studio, you can choose the group in which you want to place the server. You can even create a new group specifically for the server. The next section covers the topic of server registration.