You are on page 1of 64

SQL defrag manager

User Guide

Legal Notice

Idera a division of BBS Technologies, Inc. IntelliCompress, DTx, SQL change manager, SQLcheck, SQLconfig, SQL compliance manager, SQLcompliance, SQL defrag manager, SQL diagnostic manager, SQLdm, SQL mobile manager, SQLsafe, SQLscaler, SQLschedule, SQL schema manager, SQLsecure, SQLsmarts, SQLstats, SQLtool, Idera, BBS Technologies and the Idera logo are trademarks or registered trademarks of BBS Technologies, Inc., or its subsidiaries in the United States and other jurisdictions. All other company and product names may be trademarks or registered trademarks of their respective companies. 2007 BBS Technologies, Inc., all rights reserved. THIS DOCUMENT AND THE SOFTWARE DESCRIBED IN THIS DOCUMENT ARE FURNISHED UNDER AND ARE SUBJECT TO THE TERMS OF A LICENSE AGREEMENT. EXCEPT AS EXPRESSLY SET FORTH IN SUCH LICENSE AGREEMENT, BBS TECHNOLOGIES, INC., PROVIDES THIS DOCUMENT AND THE SOFTWARE DESCRIBED IN THIS DOCUMENT AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SOME STATES DO NOT ALLOW DISCLAIMERS OF EXPRESS OR IMPLIED WARRANTIES IN CERTAIN TRANSACTIONS; THEREFORE, THIS STATEMENT MAY NOT APPLY TO YOU. YOU ARE ENCOURAGED TO READ THE LICENSE AGREEMENT BEFORE INSTALLING OR USING THIS DOCUMENTATION OR SOFTWARE. Some companies, names, and data in this document are used for illustration purposes and may not represent real companies, individuals, or data. This document could include technical inaccuracies or typographical errors. Changes are periodically made to the information herein. These changes may be incorporated in new editions of this document. BBS Technologies, Inc., may make improvements in or changes to the software described in this document at any time. 2003-2007 BBS Technologies, Inc., all rights reserved. U.S. Government Restricted Rights: The software and the documentation are commercial computer software and documentation developed at private expense. Use, duplication, or disclosure by the Government is subject to the terms of the BBS Technologies, Inc., standard commercial license for the software, and where applicable, the restrictions set forth in the Rights in Technical Data and Computer Software clauses and any successor rules or regulations. SQL defrag manager User Guide Version 1.2

Contents
Documentation Conventions .............................................vi About Idera......................................................................vii

Chapter 1
Welcome to SQL defrag manager ..................................... 1
How SQL defrag manager Helps You............................................. 2 Understanding Fragmentation ....................................................... 3 SQL defrag manager Architecture ................................................. 8 Requirements .............................................................................. 10 Getting Started............................................................................ 12

Chapter 2
Configuring SQL defrag manager ................................... 14
Workflow for Configuration ......................................................... 14 Manage Your Licenses ................................................................. 15 Connect the Console to the Repository ....................................... 15 Add a SQL Server Instance to Manage ........................................ 16 Select the Registration Type ...............................................................16 Select the Instances to Register ..........................................................18 Confirm the SQL Servers and Databases to Register .........................19 Define Your Management Settings .............................................. 19 Define Fragmentation Ranges.............................................................20 Contents
iii

Schedule Analysis and Defragmentation Activities ............................ 22 Define Automated Responses ............................................................ 24 Add Objects to Manage............................................................... 27 Add a Database to Manage................................................................ 27 Add a Table or Index to Manage........................................................ 27 Remove and Ignore Objects......................................................... 28

Chapter 3
Automating Defragmentation ......................................... 29
Workflow for Automation ............................................................ 29 Define Custom Management Settings.......................................... 29 Schedule Automation................................................................... 30 View Scheduled Activity .............................................................. 33 View To Do Items ........................................................................ 35

Chapter 4
Using SQL defrag manager ............................................. 38
Workflow for Ad Hoc Defragmentation ....................................... 38 Analyze Database Fragmentation ................................................ 39 View Analysis Results in Fragmentation Explorer......................... 40 Optimize Performance and Space Usage ..................................... 44 View Recent Activity .................................................................... 47 Other Common Tasks .................................................................. 49 Cancelling an Activity.......................................................................... 50

iv

Contents

Refreshing the Displayed Information.................................................50 Changing the Console Style ................................................................51

Index

Contents

Documentation Conventions
Idera documentation uses consistent conventions to help you identify items throughout the printed and online library. Convention Bold Italics Specifying Window items Book and CD titles Variable names New terms Fixed Font File and directory names Commands and code examples Text typed by you Straight brackets, as in [value] Curly braces, as in {value} Logical OR, as in value1|value2 Optional command parameters Required command parameters Exclusive command parameters where only one of the options can be specified

vi

Documentation Conventions

About Idera
At Idera, we have engineered a new generation of tools for managing and administering the worlds fastest growing database management system Microsoft SQL Server. Headquartered in Houston, Texas, Idera boasts numerous systems and database management industry veterans devoted to bringing proven solutions to you, the database professional. We provide products that install in minutes, configure in hours, and deploy worldwide in days to dramatically increase the performance, availability, and efficiency of SQL Server operations, and the productivity of database administrators.

Idera Products
Our tools are engineered to scale from managing a single server to enterprise deployments with thousands of servers. Idera products combine ease of use with a design that installs in minutes, configures in hours, and deploys worldwide in days. To learn more about Idera products, visit www.idera.com/products.

Contacting Idera
Please contact us with your questions and comments. We look forward to hearing from you. For support around the world, please contact us or your local partner. For a complete list of our partners, please see our Website. Sales 713.523.4433 1.877.GO.IDERA (464.3372) (only in the United States and Canada) Sales Email Support sales@idera.com 713.533.5144 1.877.GO.IDERA (464.3372) (only in the United States and Canada) www.idera.com/support Support Email Website support@idera.com www.idera.com

About Idera

vii

Chapter 1

Welcome to SQL defrag manager


SQL defrag manager is a powerful solution that automates and optimizes your SQL Server database defragmentation. SQL defrag manager improves server performance by detecting fragmentation hot spots and automatically defragmenting them using the optimal method and schedule.

What is fragmentation and its related issues?


As data is modified in a database, the database and its indexes become fragmented. As indexes become fragmented, ordered data retrieval becomes less efficient and reduces database performance. For more information, see Understanding Fragmentation on page 3.

What does SQL defrag manager provide?


SQL defrag manager helps you improve server performance and optimize disk I/O. The automation built into SQL defrag manager enables you to implement a set it and forget it approach to managing fragmentation on your production SQL Servers. SQL defrag manager allows you to use automated, semi-automated, and ad hoc defragmentation processes to address your specific needs. For information about SQL defrag manager installation and initial setup, see the Quick Start Guide.

Chapter 1

Welcome to SQL defrag manager

How can I use SQL defrag manager? manager?


SQL defrag manager provides several workflows to help you achieve your goals: Workflow for Configuration on page 14 Workflow for Automation on page 29 Workflow for Ad Hoc Defragmentation on page 38

How SQL defrag manager Helps You


SQL defrag manager helps you obtain unparalleled speed and optimized workload performance across your SQL Server environment. Performing proper defragmentation is time consuming, often risky, and requires complex analysis and in-depth understanding. SQL defrag manager solves these issues by providing a proactive solution that safely defragments your databases and continuously optimizes performance, avoiding future issues related to database delays. SQL defrag manager remediates both logical order and page density fragmentation. Both types of fragmentation cause slow response times and can degrade performance up to the point that SQL Server discards its indexes and uses table scans for data retrieval. Diligent DBAs often employ mass defragmentation on their SQL Servers through self-made scripts or maintenance plans. Unfortunately, this approach falls short because no two tables or indexes have identical tuning requirements. Using this mass approach can also be problematic, since it often acquires unnecessary table and index locks during defragmentation, which can cause deadlocks. SQL defrag manager incorporates proven DBA experience and knowledge in a comprehensive, automated, and effective solution. SQL defrag manager resolves and comprehensively optimizes your SQL Server performance by managing your fragmentation issues.

Centralized M anagement
The SQL defrag manager Console provides a real-time window into fragmentation levels, and the ability to manage and control automated analysis and defragmentation activity for databases across your enterprise.

Welcome to SQL defrag manager

Chapter 1

Automated Analysis Analysis and Increased DBA Productivity


Fragmentation analysis and defragmentation are complicated, time consuming tasks. SQL defrag manager improves productivity for DBAs of all experience levels. Automated detection, analysis, and display of fragmentation hot spots allows you to assess many key items to pinpoint highly fragmented areas that severely hinder performance.

Continuous Improvement
Increased fragmentation of databases over time translates into slower response times, degraded performance, and excessive resource consumption. SQL defrag manager keeps your databases running at peak performance and eliminates costly application downtime by automatically correcting problems due to fragmentation.

Comprehensive Reporting
Comprehensive reporting of analysis and defragmentation activity provides both DBAs and managers with the information they need to ensure database performance is continuously optimized.

Understanding Fragmentation
This section provides information about database fragmentation and the related issues. As fragmentation increases over time, performance degrades and I/O suffers. SQL defrag manager addresses both logical order and page density fragmentation issues.

Chapter 1

Welcome to SQL defrag manager

What are the different types of fragmentation?


There are several types of fragmentation that can occur and impact SQL Server performance and space usage: File fragmentation at the operating system level When deletes and inserts are performed over time, pages become fragmented as the physical sequence of data pages no longer matches their logical order. This fragmentation happens at the file allocation level and can be addressed with system tools. On larger systems, such as a storage area network (SAN), the disk subsystem automatically maintains low fragmentation levels. If you have a small to medium size system and you do not have a SAN, you should run a system defragmentation tool before addressing logical order and page density fragmentation within SQL Server. Logical order fragmentation This issue, also known as external fragmentation within SQL Server, is similar to file fragmentation at the operating system level. When data is deleted, inserted, and modified over time, an index can cause pages to be out of order, where the next logical page is not the same as the next physical page. Page density fragmentation This issue, also known as internal fragmentation, occurs as pages split, causing suboptimal use of the capacity of each page. There may be excessive free space left on the pages. SQL Server may need to read more pages than necessary to satisfy a query or perform other activities. Logical order and page density issues exist on tables and indexes within SQL Server. These issues cannot be resolved by operating system level defragmentation tools because the fragmentation exists within the files, rather than at the file level itself.

How does fragmentation happen?


File fragmentation at the operating system level occurs during the normal operation of your computer when you create, delete, and modify files. When you delete a file, newly freed disk space is left behind. Then, when you create a file or install a program, the operating system needs to use that space. The new file may be larger than the free space left from a prior deletion, so it puts part of the file into the space left by the deletion, and the rest of the file somewhere else on the disk, leaving a fragmented file.

Welcome to SQL defrag manager

Chapter 1

Fragmentation within SQL Server occurs in much the same way. When data is inserted, deleted, and modified over time in a table, an index can cause the pages to be out of order. The next logical page may not be the same as the next physical page. This issue is known as logical order fragmentation. When page splits occur to make room for information added to a page, there may be excessive free space left on the pages. This extra space can cause SQL Server to read more pages than necessary to perform certain tasks. This issue is known as page density fragmentation.

What is an example of fragmentation?


Imagine there are two data pages for a table with a clustered index. The data is ordered and the pages are full as shown in the following figure.

A new row with a primary key of "5" needs to be inserted, and since it is a clustered index, the new row is inserted in order. Since the target page is full enough that the new row does not fit, SQL Server splits the page roughly in half and inserts the new data on the new page, as shown in the following figure.

Chapter 1

Welcome to SQL defrag manager

Now, the logical order of the index does not match the physical order, and the index has become fragmented.

Why is defragmenting indexes and tables important?


SQL defrag manager defragments the leaf level of an index so the physical order of the pages matches the left-to-right logical order of the leaf pages. The leaf pages of a clustered index contain the table data. This process improves index scanning performance and all data retrieval activities.

How does SQL defrag manager defragment indexes?


Depending on the management settings you select, SQL defrag manager defragments tables and indexes in one of the following ways: Rebuild This defragmentation type uses the DBCC DBREINDEX command to rebuild the indexes on the tables. The rebuild operation creates new, contiguous pages. However, because this defragmentation type completely rebuilds the indexes, the tables are not available until the operation is finished. Reorganize This defragmentation type uses the DBCC INDEXDEFRAG command to reorder the leaf pages of the index in-place. This process is similar to a bubble sort. Although the pages are physically reordered, they may not be contiguous within the data file. This issue can cause interleaved indexes, which need to be rebuilt to store them in contiguous pages.

What is an example of defragmenting an index?


Consider a simplified example of pages after many inserts, updates, and deletes, as shown in the following figure.

The page numbering represents the logical sequence of the pages. However, the physical sequence, as shown in the figure from left to right, does not match the logical sequence.

Welcome to SQL defrag manager

Chapter 1

The following figure illustrates multiple passes during the Reorganize defragmentation process, which causes the physical pages to be reordered by having the first logical page swapped with the first physical page, and then the second logical page swapped with the second physical page, and so on.

On the first pass, SQL Server finds the first physical page (4) and the first logical page (1). SQL Server then swaps these pages in a discrete transaction. On the second pass, SQL Server swaps the next physical page (7) with the next logical page (2). On the third pass, SQL Server swaps the next physical page (4) with the next logical page (3). On the fourth pass, SQL Server swaps the next physical page (5) with the next logical page (4). Sorting is now complete, as all the remaining physical pages match their logical positions.

Chapter 1

Welcome to SQL defrag manager

Does SQL defrag manager compact the data?


In addition to reordering the leaf pages of the index, SQL defrag manager compacts the data in the pages using the original fillfactor value specified for the table, and then removes any empty pages. Consider the following conditions related to this compaction phase: Compaction is completely skipped if the Inhibit Page Locks property is set for the index. There are various algorithms built into the compaction phase to stop unnecessary work. For example, if the first page in the index is empty and all the other pages are full, SQL Server will not repeatedly move all the data forward one page. SQL Server will only compact pages back to the fillfactor value defined for the index. Make sure this value is not set too high. For more information, see the SQL Server documentation. If a lock cannot be obtained on a page during the compaction phase of DBCC INDEXDEFRAG, SQL Server skips that page.

What is an interleaved index?


Interleaving occurs when an index extent, which is a group of eight index pages, is not physically contiguous because an extent for another index is intermingled with it. This condition can happen even when there is no logical fragmentation in the index. Although the pages may be physically and logically ordered, they are not necessarily contiguous. Switching between extents can impact performance as data access is inefficient. To resolve this issue, use SQL defrag manager to rebuild the indexes to store them in contiguous pages and reduce the need to switch between extents.

SQL defrag manager Architecture


SQL defrag manager provides a robust, easy-to-use SQL Server solution. Behind a friendly user interface, SQL defrag manager offers a unique architecture that is both flexible and extremely powerful. SQL defrag manager fits your environment, no matter how simple or complex. SQL defrag manager consists of a light, unobtrusive architecture that easily runs in your SQL Server environment with minimal configuration. All SQL defrag manager components run outside and separate from SQL Server processes. SQL defrag manager does not add to or modify any of your native SQL Server files or services.

Welcome to SQL defrag manager

Chapter 1

The following diagram illustrates the components of the SQL defrag manager architecture.

SQL defrag manager Console


The SQL defrag manager Console is the interface you use to configure SQL defrag manager, view analysis and defragmentation results, schedule automation activities, and perform other related functions.

SQL defrag manager Repository


The SQL defrag manager Repository is a central storage area for configuration information, as well as fragmentation data and statistics collected by the Management Service.

Management Service
The SQL defrag manager Management Service (Management Service) gathers fragmentation data from your managed SQL Server instances and stores the information in the SQL defrag manager Repository database. The Management Service also controls scheduling activities.

Chapter 1

Welcome to SQL defrag manager

Managed Instances
The managed instances are the SQL Server instances you registered with SQL defrag manager. SQL defrag manager periodically analyzes and optimizes these instances based on the management settings you specified. SQL defrag manager stores this collected data in the SQL defrag manager Repository and displays the data in the SQL defrag manager Console.

Requirements
You can easily and quickly install SQL defrag manager on any computer that meets or exceeds the following hardware, software, and permission requirements. Consider the following requirements when installing SQL defrag manager in a typical environment.

General Product Requirements


All SQL defrag manager components require the following software: Microsoft .NET Framework version 2.0 MDAC 2.8 or later Windows Installer 3.1 or later

Typical Installation
A typical installation sets up all SQL defrag manager components on the same computer. The following table lists the requirements for a typical installation. Type
CPU Memory Hard Disk Space Operating System

Requirement
2 GHz 2 GB 30 GB for Repository One of the following operating systems: Windows 2000 Server SP4 or later Windows Server 2003 or later Windows Vista Enterprise or Business

10

Welcome to SQL defrag manager

Chapter 1

Type
Microsoft SQL Server (Repository)

Requirement
One of the following versions of Microsoft SQL Server: MS SQL Server 2000 Standard Edition SP4 or later MS SQL Server 2000 Enterprise Edition MS SQL Server 2005 Standard or Enterprise MS SQL Server 2005 SP2 or later on Vista

Microsoft SQL Server (Managed Instance)

One of the following versions of Microsoft SQL Server: MS SQL Server 2000 Standard or Enterprise MS SQL Server 2005 Standard or Enterprise

Console Only Installation


A Console-only installation installs the SQL defrag manager Console. The Console-only installation assumes that a full installation has already been completed on another computer. The following table lists the requirements for a Console-only installation. Type
CPU Memory Operating System

Requirement
2 GHz 2 GB One of the following operating systems: Windows 2000 Server SP4 or later Windows Server 2003 Windows Vista Enterprise or Business Windows XP SP2

Chapter 1

Welcome to SQL defrag manager

11

Management Service Permission Requirements


The Windows user account used by the Management Service requires the following permissions to access the SQL Server instances you want to manage. Type
Windows Permissions SQL Server Privileges

Requirement
Local Administrator permissions on the computer hosting the Management Service. A member of the sysadmin fixed server role on the SQL Server instance hosting the Repository and on each managed SQL Server instance.

Getting Started
This procedure guides you through your initial start up process, including your license and registering your local SQL Server instance. For more information about managing all your SQL Server instances, see the online Help.

Open the SQL defrag manager Console


The SQL defrag manager Console allows you to perform all configuration and defragmentation tasks. To open the SQL defrag manager Console: 1. Log on with an administrator account to the computer on which you installed SQL defrag manager. 2. Select SQL defrag manager from the Programs menu.

Specify your SQL defrag defrag manager license information


To use SQL defrag manager, you must specify a valid license. When you first start the SQL defrag manager Console, the SQL defrag manager License window is displayed. For an evaluation, you can generate a trial license. To specify your SQL defrag manager license key: 1. Type your production license key value, or click Generate Trial License. 2. Click OK.
12

Welcome to SQL defrag manager

Chapter 1

Register your local SQL Server instance


To begin managing your SQL Server instances, you must first register each instance with SQL defrag manager. When you start the SQL defrag manager Console the first time, the Welcome window prompts you to register one or more instances. Register your local SQL Server instance to start managing it. To register your local SQL Server instance: 1. Click Next on the Welcome window. 2. Click Quickly register your SQL Servers with default settings. 3. Specify your local SQL Server instance using the Add by Name button or locate it using the Retrieve SQL Servers button. 4. Select your local SQL Server instance, and then click Next. 5. Select the databases you want to manage, and then click Finish. Chapter End

Chapter 1

Welcome to SQL defrag manager

13

Chapter 2

Configuring SQL defrag manager


After you install SQL defrag manager, identify the databases you want to manage. If you want to automate the management process, you can set the options for how to manage those databases.

Workflow for Configuration


To begin managing databases in your organization, you must first register each instance with SQL defrag manager. SQL defrag manager then registers the existing databases, tables, and indexes in those instances. SQL defrag manager allows you to use automated, semi-automated, and ad hoc defragmentation processes. If you want to automate part or all of the defragmentation process, you can define management settings for the database objects to refine the automated processes to meet your specific needs. For more information, see Workflow for Automation on page 29. Use the following checklist to ensure you have properly configured SQL defrag manager to identify and manage your SQL Server databases. Workflows
Manage Your Licenses Connect the Console to the Repository Add a SQL Server Instance to Manage Define Your Management Settings

14

Configuring SQL defrag manager

Chapter 2

Manage Manage Your Licenses


The Manage Licenses window provides an intuitive interface for license key management. You can view the status of your license keys and add licenses to manage additional instances. Each license allows you to manage a predetermined number of SQL Server instances. When you reach your license limit, SQL defrag manager will not let you add new instances. If your trial period expires, SQL defrag manager will not continue to run.

How do I open the Manage Licenses window?


To display the Manage Licenses window, click Manage Licenses on the SQL defrag manager command menu of the SQL defrag manager Console. To display the command menu, click the SQL defrag manager logo in the top left corner of the SQL defrag manager Console, as shown in the following figure.

Connect the Console to the Repository


The Connect to Repository window allows you to specify the SQL Server instance where the SQL defrag manager Repository resides. Specify the instance name in the following format:
server-name\instance-name

Chapter 2

Configuring SQL defrag manager

15

How do I open the Connect to Repository window?


To open the Connect to Repository window, click the Connect icon along the top left edge of the SQL defrag manager Console, as shown in the following figure.

Add a SQL Server I nstance to Manage


Before you can begin managing a SQL Server instance, you must register that instance with SQL defrag manager. The Register SQL Servers wizard allows you to add SQL Server instances to SQL defrag manager. You can also specify defragmentation management settings for those instances. Your license defines how many instances you can manage. For more information, see Manage Your Licenses on page 15. To register a SQL Server instance with SQL defrag manager: 1. Click Register on the Fragmentation Explorer tab of the SQL defrag manager Console. 2. Follow the instructions until you have finished registering the SQL Server instances you want to manage. For more information about options on a window, click Tell me more.

Select the Registration Type


The Register SQL Servers wizard allows you to designate which SQL Server instances to manage with SQL defrag manager. Using this wizard, you can also specify the defragmentation management settings for the instances you register. If you prefer, you can simply register the instances using this wizard, and then specify the management settings at a later time. For more information, see Define Your Management Settings on page 19.

16

Configuring SQL defrag manager

Chapter 2

How do I open the Register Register SQL Servers Servers window?


To display the Register SQL Servers window, click Register on the Fragmentation Explorer tab of the SQL defrag manager Console.

When do I need to use the Register SQL Servers Servers wizard?


This wizard makes the SQL Server instances you register available in the SQL defrag manager Console. You must register a SQL Server instance before you can manage, analyze, or defragment the databases, tables, and indexes in that instance.

What happens when I quickly register?


The Quickly register your SQL Servers with default settings option registers the selected instances and databases with SQL defrag manager so you can analyze and defragment those databases. This option does not allow you to define the management settings while you register the instances and databases. You can specify these management settings at a later time. SQL defrag manager uses the management settings to guide how it performs automated analysis and defragmentation processes. For more information, see Workflow for Automation on page 29.

What does custom registration offer?


In addition to registering the selected instances and databases with SQL defrag manager, the Custom register your SQL Servers and define automation settings option allows you to specify management settings for these database objects. SQL defrag manager uses these management settings during automated processes, such as scheduled analysis activities and automated defragmentation based on the levels of fragmentation identified. You can also customize the fragmentation threshold levels that define Acceptable, Caution, and Critical levels of fragmentation. For more information, see Define Fragmentation Ranges on page 20.

Chapter 2

Configuring SQL defrag manager

17

How does the Register SQL Servers Servers wizard work?


The Register SQL Servers wizard prompts you for the information it needs to register the selected instances and databases with SQL defrag manager. You can quickly register the instances with the default management settings, or you can also customize the management settings while you register the instances. Once you have registered an instance with SQL defrag manager, you can view the instance on the Fragmentation Explorer tab, analyze and defragment the databases in that instance, and customize the management settings. SQL defrag manager registers each table with an index in the selected instances.

Select the Instances I nstances to Register


The Select SQL Servers to Register window lets you select the SQL Server instances to manage. Select the instances you want to register, and then click Next.

How do I open the Select SQL SQL Servers to Register window?


To display the Select SQL Servers to Register window, click Register on the Fragmentation Explorer tab of the SQL defrag manager Console. Then, select the quick or custom registration type based on your specific needs.

How do I add a specific instance to the list?


To add an instance to the list by name, click Add By Name.

How do I view a list of available instances?


To list the available instances on your network, click Retrieve SQL Servers.

18

Configuring SQL defrag manager

Chapter 2

What should I do if an instance is not in the list?


If an instance is not in the list, check your network access and the availability of the instance on the network. Then, click Retrieve SQL Servers to list the available instances on your network. If the instance is still not listed, contact your network administrator. You can add an instance by name, but that instance must be available on the network for SQL defrag manager to add it to the list of managed instances.

Confirm the SQL Servers Servers and Databases Databases to Register


The SQL Server and Database Confirmation window lets you review and select the instances and databases to manage. This window lists the instances you previously selected and the databases in those instances. Make sure all the instances and databases you want to register are selected, and then click Finish.

Why would I choose to not select a database?


If you do not want to manage a database with SQL defrag manager, you can clear the check box for that database. For example, you may not want to defragment development databases used for testing and impact analysis.

Can I add or remove databases later? later?


Yes. You can add databases in previously registered instances, and you can remove databases to ignore them during analysis and defragmentation activities. For more information, see Add Objects to Manage on page 27 and Remove and Ignore Objects on page 28.

Define Your Management Settings Setting s


After you register a SQL Server instance with SQL defrag manager, you can define the management settings for that instance and database objects in that instance. These settings specify how to handle automated analysis and defragmentation operations for those database objects. You can also specify these management settings when you initially register an instance.

Chapter 2

Configuring SQL defrag manager

19

Do I have to define the management settings?


No. If you want to perform ad hoc defragmentation activities, you do not need to define the management settings. These settings define how SQL defrag manager handles automated analysis activities and the defragmentation activities related to the results of those automated analyses. When you schedule an analysis, you can define the management settings at that time. If you want to define custom settings for specific database objects, such as creating To Do items for fragmentation issues identified in a very large index instead of attempting to automatically defragment that index, you should define the management settings for those specific database objects.

How are management settings inherited and applied?


Management settings are initially inherited by objects lower in the hierarchy. For example, when you specify management settings for a database, those settings apply to all tables and indexes in that database. You can override inherited settings for an object and all the objects it contains. For example, if you specify custom management settings for a table, those settings override the settings defined for the database that contains the table. The management settings for the table apply to the table and all indexes on the table, unless custom management settings are defined for an index on that table.

Define Fragmentation Fragmentation Ranges Ranges


The Fragmentation Range window allows you to set the threshold values that define Acceptable, Caution, and Critical fragmentation levels. By setting these threshold values, you define what fragmentation levels are Acceptable, what levels are Caution, and what levels are Critical. Once you specify these threshold levels, SQL defrag manager uses these values to determine how fragmentation levels are displayed in the Console. SQL defrag manager also uses these values when performing automated responses based on fragmentation levels found during scheduled analysis activities.

20

Configuring SQL defrag manager

Chapter 2

How do I open the Fragmentation Fra gmentation Range window?


To display the Fragmentation Range window, right-click the database object you want to specify management settings for, and then click Edit configuration for this object-type. This window displays a tab for each type of management settings for the selected database object. The Fragmentation Range window is also available when you click Automate on the Fragmentation Explorer tab to schedule an automated analysis activity.

What is the fragmentation fragmentation range? range?


The fragmentation level identifies the amount of fragmentation of a database object. The fragmentation range allows you to define what range of fragmentation levels are Acceptable, Caution, and Critical.

How does SQL defrag manager use these values?


SQL defrag manager displays objects with an Acceptable fragmentation level as green, objects with a Caution fragmentation level as yellow, and objects with a Critical fragmentation level as red. SQL defrag manager also uses the Caution and Critical fragmentation levels to perform automated responses as defined on the Fragmentation Responses window. These responses range from creating a To Do item on the To Do tab to automatically rebuilding indexes with the associated fragmentation level. You can specify custom threshold levels for different database objects. If you have a table that impacts productivity with low levels of fragmentation, you may want to lower the threshold levels for that table. Although you can manage multiple threshold levels across many objects, use standard fragmentation levels across most objects to reduce complexity and to present data consistently in the Console.

How are management settings inherited and applied?


Management settings apply to that database object and any objects contained by that object, unless the settings are overridden at a lower level. For example, you can specify the fragmentation threshold settings at the instance level and those settings apply to all objects in all databases in that instance. You can then specify custom fragmentation threshold values for a specific object in that instance, such as a very large index that is prone to fragmentation issues and needs lower threshold levels to proactively identify potential issues. Chapter 2 Configuring SQL defrag manager
21

How do I change these values?


This window provides a slider control that allows you to adjust the threshold value between Acceptable and Caution, and between Caution and Critical. To change the current threshold value, click on the divider button between two levels and drag it left or right to decrease or increase that threshold value.

What happens if I leave the default values?


The default fragmentation ranges provide standard ranges that show fragmentation levels as Acceptable until they reach 31%. An object does not reach the critical level until fragmentation reaches 61%. Leave the default values until you identify specific performance issues related to the fragmentation levels of specific tables and indexes.

Schedule Analysis and Defragmentation Activities


The Automation Schedule window allows you to define scheduling options for analyzing the selected objects. If you schedule analysis, SQL defrag manager can then perform the automated responses you define on the Fragmentation Responses window based on the fragmentation levels identified during the analysis.

How do I open the Automation Schedule window? window?


To display the Automation Schedule window, right-click the database object you want to specify management settings for, and then click Edit configuration for this object-type. This window displays a tab for each type of management settings for the selected database object. The Automation Schedule window is also available when you select the Custom registration option for registering a SQL Server instance. A window for each group of management settings is displayed in the Register SQL Server wizard during a custom registration.

22

Configuring SQL defrag manager

Chapter 2

What types of automation can I use?


Based on the management settings you specify, SQL defrag manager analyzes registered instances and can also defragment the hot spots it finds. The schedule you specify in this window defines how often SQL defrag manager analyzes the selected database objects. You can use SQL defrag manager in several ways: You can schedule SQL defrag manager to analyze your registered instances on a regular basis and automatically defragment database objects as needed. SQL defrag manager uses your defined responses and threshold levels to determine what type of defragmentation tasks to perform. For more information, see Define Your Management Settings on page 19. You can schedule SQL defrag manager to analyze your registered instances on a regular basis. You can define the automated responses so SQL defrag manager creates To Do items when it finds Caution or Critical levels of fragmentation. Then, you can review the To Do items on a regular basis and run the defragmentation tasks when appropriate. You can analyze the database objects when you want updated analysis information. Then, you decide what to do based on the data collected and displayed. You can review the results and defragment objects that have high levels of fragmentation. For more information about manually analyzing and defragmenting databases, see Workflow for Ad Hoc Defragmentation on page 38.

What happens if I do not schedule activity?


If you do not schedule activity on any database objects, SQL defrag manager does not automatically analyze or defragment the registered instances or databases. You can manually analyze these instances or databases by clicking Analyze on the Fragmentation Explorer tab of the SQL defrag manager Console. This option allows you to immediately analyze database fragmentation and control all defragmentation activities.

Chapter 2

Configuring SQL defrag manager

23

What should I consider when defining a schedule?


SQL defrag manager allows you to define a custom schedule for database fragmentation analysis. You can define the exact schedule you want to use when analyzing the associated database objects. Scheduling is ideal when you have specific time constraints for analysis and defragmentation tasks, or when there are only certain hot spot areas you want to analyze and defragment on a regular basis. For example, since an analysis can use system resources needed for other database activity, you may want to schedule this analysis during periods of low database activity or demand. You can schedule an analysis on a single date and time, or at specified intervals, such as daily or weekly. The Interval option defines the period of time to wait from the end of an analysis before running the next analysis. For example, if you select the Interval option and specify 60 minutes as the repeat interval, SQL defrag manager waits 60 minutes from the end of an analysis before running the next analysis. If you select the Interval or Daily option, you can specify the time period during which analysis activities can start. SQL defrag manager runs the analysis activities and then the associated defragmentation activities based on the defined automated responses. SQL defrag manager does not stop these automated analysis and defragmentation activities when the end time specified for the between option is reached.

How are management settings inherited and applied?


Management settings apply to that database object and any objects contained by that object, unless the settings are overridden at a lower level. For example, you can schedule analysis for specific tables and indexes. That schedule overrides the schedule you define for the database that contains those tables and indexes.

Define Automated Responses


The Fragmentation Responses window allows you to define automated responses for objects identified with Caution or Critical fragmentation levels. These responses are applied only during automated, scheduled analysis activities.

24

Configuring SQL defrag manager

Chapter 2

How do I open the Fragmentation Responses Responses window?


To display the Fragmentation Responses window, right-click the database object you want to specify management settings for, and then click Edit configuration for this object-type. This window displays a tab for each type of management settings for the selected database object. The Fragmentation Responses window is also available when you click Automate on the Fragmentation Explorer tab to schedule an automated analysis activity.

How do these settings relate to automation?


These responses define what SQL defrag manager does when it identifies a fragmented index during an automated, scheduled analysis. For example, if you select Add To Do item for Caution fragmentation levels, when SQL defrag manager performs a scheduled analysis activity, SQL defrag manager will create a To Do item on the To Do tab of the SQL defrag manager Console for each index it finds with a fragmentation level in the Caution range. If you select Reorganize only for Critical fragmentation levels, when SQL defrag manager performs a scheduled analysis activity, SQL defrag manager will attempt to defragment each index it finds with a fragmentation level in the Critical range using the reorganize method. You can use SQL defrag manager to perform ad-hoc analysis and defragmentation tasks, to identify defragmentation activities needed, and to perform automated defragmentation activities. For more information, see Workflow for Ad Hoc Defragmentation on page 38 and Workflow for Automation on page 29.

What should I specify?


The fields on this window are defined as follows: Option
Add To Do item

Result
Creates a To Do item on the To Do tab when SQL defrag manager identifies an index with the associated level of fragmentation during a scheduled analysis. Starts a Reorganize defragmentation activity when SQL defrag manager identifies an index with the associated level of fragmentation during a scheduled analysis.

Reorganize only

Chapter 2

Configuring SQL defrag manager

25

Option
Reorganize. If fails, rebuild.

Result
Starts a Reorganize defragmentation activity when SQL defrag manager identifies an index with the associated level of fragmentation during a scheduled analysis. If the Reorganize defragmentation activity fails, SQL defrag manager starts a Rebuild defragmentation activity on that index. Starts a Rebuild defragmentation activity when SQL defrag manager identifies an index with the associated level of fragmentation during a scheduled analysis.

Rebuild only

For more information about Reorganize and Rebuild defragmentation activities, see Optimize Performance and Space Usage on page 44.

How are the Caution and Critical levels determined?


The threshold values for these fragmentation levels are defined on the Fragmentation Range window. You can set these threshold values at any object level. These values can be inherited by objects at lower levels in the hierarchy.

How are management settings inherited and applied?


Management settings apply to that database object and any objects contained by that object, unless the settings are overridden at a lower level. For example, you can automatically reorganize specific tables and indexes with a Critical fragmentation level. That automated response overrides the responses you define for the database that contains those tables and indexes.

What happens if I leave the default default values?


By default, SQL defrag manager creates a To Do item on the To Do tab of the SQL defrag manager Console for each database object it identifies as having a Caution or Critical fragmentation level during a scheduled analysis. This approach is the semi-automated process. You can then review the items on the To Do tab and start the identified defragmentation activities at appropriate times.

26

Configuring SQL defrag manager

Chapter 2

Add Objects to Manage


When you register an instance, you can select which databases in that instance you want to manage. SQL defrag manager registers all indexes that exist in those databases and all tables with at least one index. You can also register individual databases at a later time. SQL defrag manager allows you to add and remove individual tables and indexes within your registered databases. This flexibility allows you to manage and focus on only the critical database objects in your environment.

Add a Database to Manage


When you register an instance, you can select which databases in that instance you want to manage. If you did not register all databases in that instance, or if you removed databases in that instance, you can add those databases. You can also add databases created since the instance was registered. SQL defrag manager uses the management settings defined for the instance that contains the newly-registered databases. To add a database in a registered instance: 1. On the Fragmentation Explorer tab of the SQL defrag manager Console, right-click the name of the instance that contains the database you want to add. 2. Click Add database from this server. 3. Select the database you want to add, and then click Finish.

Add a Table or Index to Manage


When you register an instance, you can select which databases in that instance to manage. SQL defrag manager registers all indexes that exist in those databases and all tables with at least one index. If you removed a table or index from SQL defrag manager, you can add that table or index. You can also add tables and indexes not registered when the database was registered. SQL defrag manager uses the management settings defined for the database that contains the newly-registered table.

Chapter 2

Configuring SQL defrag manager

27

To add a table or index in a managed database: 1. On the Fragmentation Explorer tab of the SQL defrag manager Console, right-click the name of the database or table that contains the table or index you want to add. 2. Click Add table from this database or Add index from this table. 3. Select the table or index you want to add, and then click Finish.

Remove and Ignore Objects Objects


When you register an instance, you can select which databases in that instance you want to manage. SQL defrag manager registers all indexes that exist in those databases and all tables with at least one index. You can remove specific databases, tables, and indexes from SQL defrag manager. During analysis and defragmentation activities, SQL defrag manager ignores these objects and manages only the objects currently registered. To ignore a database, table, or index: 1. On the Fragmentation Explorer tab of the SQL defrag manager Console, right-click the name of the database object that you want to remove from SQL defrag manager. 2. Click Remove this object-type. 3. Review the confirmation message, and then click Yes. Chapter End

28

Configuring SQL defrag manager

Chapter 2

Chapter 3

Automating Defragmentation
You can use SQL defrag manager to analyze database index fragmentation across your enterprise. You can then defragment hot spots to improve performance. SQL defrag manager provides ways to automate this process and maintain your databases with minimal time and effort.

Workflow for Automation Automation


Use the following checklist to automate the analysis and defragmentation processes for your registered databases. Check this item
Define Custom Management Settings Schedule Automation View Scheduled Activity View To Do Items

Define Custom Management Settings Settings


You may want to define custom management settings for specific database objects, such as very large indexes that are prone to fragmentation issues and may require lower fragmentation thresholds to proactively manage potential issues. You may also want to automatically rebuild database objects that can be locked with minimal impact across your enterprise. SQL defrag manager also allows you to define custom automation schedules for individual database objects. For more information about management settings, see Define Your Management Settings on page 19.

Chapter 3

Automating Defragmentation

29

How are management settings inherited and applied?


Management settings are initially inherited by objects lower in the hierarchy. For example, when you specify management settings for a database, those settings apply to all tables and indexes in that database. You can override these inherited settings for an object and all the objects it contains. For example, if you specify custom management settings for a table, those settings override the settings defined for the database that contains the table. The management settings for the table apply to the table and all indexes on the table, unless custom management settings are defined for an index on that table.

What do the management settings specified specified in the Automation wizard control?
When you click Automate on the Fragmentation Explorer tab of the SQL defrag manager Console, SQL defrag manager allows you to schedule an automated analysis. You can also specify management settings in this Automation wizard. These management settings serve as default values for the selected instances and databases without custom management settings defined. If a database object has management settings defined, SQL defrag manager uses the inheritance model to apply those custom settings for that object instead of the management settings specified in the Automation wizard.

Schedule Automation
The Automate SQL Server Optimization window allows you to schedule analysis for the selected databases. If you schedule analysis, SQL defrag manager can perform the automated responses you define based on the fragmentation levels identified during the analysis.

How do I open the Automate SQL Server Optimization window?


To display the Automate SQL Server Optimization window, click Automate on the Fragmentation Explorer tab of the SQL defrag manager Console.

30

Automating Defragmentation

Chapter 3

What types of automation can I use?


Based on the management settings you specify, SQL defrag manager analyzes registered instances and can also defragment the hot spots it finds. The schedule you specify in this window defines how often SQL defrag manager analyzes the selected instances and databases. You can use SQL defrag manager in several ways: You can schedule SQL defrag manager to analyze your registered instances on a regular basis and automatically defragment database objects as needed. SQL defrag manager uses your defined responses and threshold levels to determine what type of defragmentation tasks to perform. For more information, see Define Your Management Settings on page 19. You can schedule SQL defrag manager to analyze your registered instances on a regular basis. You can define the automated responses so SQL defrag manager creates To Do items when it finds Caution or Critical levels of fragmentation. Then, you can review the To Do items on a regular basis and run the defragmentation tasks when appropriate. You can analyze the database objects when you want updated analysis information. Then, you decide what to do based on the data collected and displayed. You can review the results and defragment objects that have high levels of fragmentation. For more information about manually analyzing and defragmenting databases, see Workflow for Ad Hoc Defragmentation on page 38.

How do I select the instances and databases I want to automatically analyze?


The SQL Servers and Databases field lists all the registered instances and databases. You can select an instance, which also selects all the databases in that instance. You can also select specific databases to schedule analysis for those individual databases.

Chapter 3

Automating Defragmentation

31

What should I do if a database is not listed?


If the instance or database you want to schedule analysis for is not listed in the SQL Servers and Databases field, you may not have registered it with SQL defrag manager. To register an instance with SQL defrag manager, click Register on the Fragmentation Explorer tab of the SQL defrag manager Console. To register a database in a managed instance, right-click the instance on the Fragmentation Explorer tab, and then click Add database from this server.

What happens if I do not schedule activity?


If you do not schedule activity on any database objects, SQL defrag manager does not automatically analyze or defragment the registered instances or databases. You can manually analyze these instances or databases by clicking Analyze on the Fragmentation Explorer tab of the SQL defrag manager Console. This option allows you to immediately analyze database fragmentation and control all defragmentation activities.

What should I consider when defining a schedule?


SQL defrag manager allows you to define a custom schedule for database fragmentation analysis. You can define the exact schedule you want to use when analyzing the associated database objects. Scheduling is ideal when you have specific time constraints for analysis and defragmentation tasks, or when there are only certain hot spot areas you want to analyze and defragment on a regular basis. For example, since a thorough analysis can use system resources needed for other database activity, you may want to schedule this analysis during periods of low database activity or demand. You can schedule a custom analysis on a single date and time, or at specified intervals, such as daily or weekly. The Interval option defines the period of time to wait from the end of an analysis before running the next analysis. For example, if you select the Interval option and specify 60 minutes as the repeat interval, SQL defrag manager waits 60 minutes from the end of an analysis before running the next analysis.

32

Automating Defragmentation

Chapter 3

If you select the Interval or Daily option, you can specify the time period during which analysis activities can start. SQL defrag manager runs the analysis activities and then the associated defragmentation activities based on the defined automated responses. SQL defrag manager does not stop these automated analysis and defragmentation activities when the end time specified for the between option is reached.

How are management settings inherited inherited and applied?


Management settings apply to that database object and any objects contained by that object, unless the settings are overridden at a lower level. For example, you can schedule analysis for specific tables and indexes. That schedule overrides the schedule you define for the database that contains those tables and indexes.

View Scheduled Activity


The Scheduled Activity tab of the SQL defrag manager Console shows you each currently scheduled analysis or defragmentation activity. These activities have not yet occurred. You can review and modify the scheduled activities, export the list to a file, and print the list.

How do I display the Scheduled Activity tab? tab ?


To display the Scheduled Activity tab, click the Scheduled Activity tab of the SQL defrag manager Console.

How can I display details for an activity?


To view the details of an activity, click the plus sign icon to the left of the activity. SQL defrag manager lists expanded information about each index in the databases scheduled for analysis. You can select an item in the list and then review the information displayed in the Details section of the tab.

What do the details mean?


The information in the Details section of the window provides complete information about the item selected in the main section of the window. Item Description

Chapter 3

Automating Defragmentation

33

Item
SQL Server Name Database Name

Description
Specifies the name of the instance that contains the database. Specifies the name of the database to analyze. If you select a scheduled activity for more than one database, this field identifies the total number of databases included in the scheduled activity. Specifies the name of the table to analyze. If you select a scheduled activity for more than one table, this field identifies the total number of tables included in the scheduled activity. Specifies the name of the index to analyze. If you select a scheduled activity for more than one index, this field identifies the total number of indexes included in the scheduled activity. Identifies when the analysis will occur. Specifies the recurrence schedule type, such as Interval, Daily, or RunOnce.

Table Name

Index Name

Take Action On Schedule Type

How do items get created on this window?


When you schedule analysis activities in the Automate SQL Server Optimization window, SQL defrag manager adds those activities to the Scheduled Activity tab of the SQL defrag manager Console. When SQL defrag manager performs a scheduled analysis activity, it can also start defragmentation activities based on the automated responses and threshold levels defined in the management settings.

How does grouping information help me?


You can group activities by when they are scheduled, the actions scheduled to take place, or by the name of the instance, database, table, or index. To group the displayed activities by a column value, drag that column heading to the gray bar above the column headings.

34

Automating Defragmentation

Chapter 3

Grouping scheduled activities allows you to quickly scan and evaluate your current schedules. For example, you can group and view activities for a specific database, table, or index, which lets you focus on the scheduled activities for that database object to make sure they are the activities you need to run.

How do I schedule a new activity? activity?


To schedule a new activity for a registered database, click Add on the Scheduled Activity tab, or click Automate on the Fragmentation Explorer tab of the SQL defrag manager Console.

How do I sort activities activities listed on this window?


To sort the activities by a column value, click the heading of that column. You can also group activities by a column value by dragging that column heading to the gray bar just above the column headings.

How do I save the displayed information? information?


To save the information displayed in the Scheduled Activity tab, click Export near the top of the window, and then select the appropriate format. SQL defrag manager saves the items displayed in the Scheduled Activity tab as a file.

How do I print the list of scheduled activities?


To print the list of activities displayed on the Scheduled Activity tab, click Print near the top of the window. With this feature, you can report on your scheduled activities and review them to ensure you have the management plan you want.

View To Do Items
The To Do tab of the SQL defrag manager Console lists the automatically-generated activities that require your attention. When you define the management settings, you specify threshold levels and automated responses for these fragmentation levels. Then, when SQL defrag manager performs a scheduled analysis, it can create To Do items for each analyzed index based on your management settings. You can review the displayed activities and choose which activities to perform. These activities help you defragment the objects that have serious or critical levels of fragmentation.

Chapter 3

Automating Defragmentation

35

How do I open the To Do tab? tab ?


To display the To Do tab, click the To Do tab of the SQL defrag manager Console.

What do the details mean?


The data in the Details section of the window provides complete information about the item selected in the main section of the window. Item
Server Name Database Name Table Name Index Name Clustered Index Detected On Problem Recommendation

Description
Specifies the name of the instance that contains the database. Specifies the name of the database that contains the table. Specifies the name of the table that has the identified index to defragment. Specifies the name of the index to defragment. Indicates whether the index is a clustered index. Identifies when the analysis that created this To Do item occurred. Describes the issue identified by SQL defrag manager. Provides a recommendation for how to resolve the identified fragmentation issue.

How does grouping information help me?


You can group activities by the scheduled analysis that generated the To Do activity, the identified problem or related recommendation, or by the name of the instance, database, table, or index. To group the displayed activities by a column value, drag that column heading to the gray bar above the column headings. Grouping To Do activities allows you to quickly scan and evaluate the recommended activities. For example, you can group and view activities for a specific database, table, or index, which lets you focus on the recommended activities for that database object to make sure they are the activities you want to run.
36

Automating Defragmentation

Chapter 3

How do I perform an action listed on this window?


Select the item, and then click Auto Fix near the top of the window. To analyze the object again, select the To Do item for that object, and then click Analyze.

How do I sort actions listed on this window?


To sort the activities by a column value, click the heading of that column. You can also group activities by a column value by dragging that column heading to the gray bar just above the column headings.

How do I remove an a n activity listed on this window?


Select the item, and then click Clear near the top of the window. Chapter End

Chapter 3

Automating Defragmentation

37

Chapter 4

Using SQL defrag manager


This section provides step-by-step descriptions of many common SQL defrag manager tasks.

Workflow for Ad Hoc Defragmentation


When you initially use SQL defrag manager, first analyze databases to collect updated fragmentation information. Then, review that information and defragment the highly-fragmented areas. As you become familiar with SQL defrag manager, you may choose to automate this process. This section describes how to manually analyze, view, and correct fragmentation issues on tables and indexes. For more information about automating the analysis and defragmentation process, see Workflow for Automation on page 29. Use the following checklist to guide you through the manual defragmentation process. Check this item
Analyze Database Fragmentation View Analysis Results in Fragmentation Explorer Optimize Performance and Space Usage View Recent Activity

38

Using SQL defrag manager

Chapter 4

Analyze Database Fragmentation


The Analyze Fragmentation window allows you to investigate the fragmentation levels of tables and indexes in the registered databases and instances. The SQL Servers and Databases field lists all the registered instances and databases. Select the appropriate databases and then specify the type of analysis for SQL defrag manager to perform.

How do I open the Analyze Analyze Fragmentation window?


To display the Analyze Fragmentation window, click Analyze on the Fragmentation Explorer tab of the SQL defrag manager Console.

How do I select the instances and databases to analyze?


The SQL Servers and Databases field lists all the registered instances and databases. You can select an instance, which also selects all the databases in that instance. You can also select specific databases to analyze tables and indexes in those individual databases.

What should I do if a database is not listed?


If the instance or database you want to analyze is not listed in the SQL Servers and Databases field, you may not have registered it with SQL defrag manager. To register an instance with SQL defrag manager, click Register on the Fragmentation Explorer tab of the SQL defrag manager Console. To register a database in a managed instance, right-click the instance on the Fragmentation Explorer tab, and then click Add database from this server.

What is the the difference between fast and thorough analysis? analysis?
Fast analysis provides base-level analysis information, including statistics about logical order fragmentation. Logical order fragmentation occurs when the physical order of pages does not match the logical order of the pages. A fast analysis runs five to eight times quicker than a thorough analysis because SQL defrag manager does not scan the leaf pages of an index. Therefore, SQL defrag manager does not gather page density information during a fast analysis. You can perform a fast analysis on a database that is in use, since it consumes less time and resources than a thorough analysis.

Chapter 4

Using SQL defrag manager

39

Thorough analysis provides comprehensive analysis information, including page density statistics. This analysis type requires more time and resources than a fast analysis and may block active processes while it collects analysis information. Therefore, you should run a thorough analysis only during times when the databases are not needed. For more information, see Understanding Fragmentation on page 3.

How long will this process take?


The time required to perform an analysis depends on the number of pages used by the databases, the activity level on those databases, the performance of the computer where the database resides, and the type of analysis you choose to perform. In general, an analysis can require from one minute to several hours. Automation allows you to define a custom schedule for analyzing and potentially defragmenting databases during periods of low activity. You can also set SQL defrag manager to analyze databases on a regular schedule, such as daily or weekly. Since an analysis can use system resources needed for other common database processes, you may want to schedule this analysis during periods of low database activity or demand.

Can I analyze an individual table or index?


Yes. The Fragmentation Explorer tab allows you to analyze and defragment individual objects, such as specific tables and indexes. For more information, see View Analysis Results in Fragmentation Explorer on page 40.

View Analysis Results Results in Fragmentation Explorer


Once SQL defrag manager analyzes the registered instances and databases, you can use the Fragmentation Explorer tab to view the latest analysis information. In the navigation tree, select a database object. SQL defrag manager displays the analysis details for the objects in the database object you selected. For example, if you select a table, SQL defrag manager displays the analysis details for each index on that table.

40

Using SQL defrag manager

Chapter 4

You should regularly monitor fragmentation levels on indexes. You can schedule SQL defrag manager to analyze database fragmentation on a regular basis. You can also define management settings to automatically reorganize or rebuild indexes when specific fragmentation levels are identified by the scheduled analysis. For more information about automatically defragmenting your databases, see Workflow for Automation on page 29.

How do I open Fragmentation Explorer?


To display Fragmentation Explorer, click the Fragmentation Explorer tab of the SQL defrag manager Console.

What is SQL defrag manager and its workflows? workflows?


SQL defrag manager is a powerful solution that automates and optimizes your SQL Server database defragmentation. SQL defrag manager improves server performance by detecting fragmentation hot spots and automatically defragmenting them using the best defragmentation method and schedule. SQL defrag manager provides several workflows to help you achieve your goals: Workflow for Configuration on page 14 Workflow for Automation on page 29 Workflow for Ad Hoc Defragmentation on page 38

What is fragmentation and its related issues?


As data is modified in a database, the tables and indexes become fragmented. Data may no longer be stored in a contiguous space, which causes more disk head movement during database read activity. As tables and indexes become fragmented, the server needs to swap pages during ordered data retrieval. These activities reduce database performance and space usage. For more information about these concepts and related issues, see Understanding Fragmentation on page 3.

Chapter 4

Using SQL defrag manager

41

What should I do if a database is not listed?


If the instance or database you want to view is not listed, you may not have registered it with SQL defrag manager. To register an instance with SQL defrag manager, click Register on the Fragmentation Explorer tab of the SQL defrag manager Console. To register a database in a managed instance, right-click the instance on the Fragmentation Explorer tab, and then click Add database from this server.

Why are some tables not listed? listed?


SQL defrag manager helps you manage fragmentation levels for tables with at least one index. If a table does not have an index, SQL defrag manager does not register that table when you register the database.

What do the icons i cons and fragmentation statistics mean?


You can mouse over any icon to display a tip that identifies what that icon represents. The fragmentation statistics are defined as follows: Average Fragmentation Displays the total fragmentation of all indexes on the associated object and the objects it contains divided by the total number of indexes on those objects. This calculation is weighted based on the size of each index. For example, if you have 3 similar-sized indexes with 10%, 10%, and 70% fragmentation levels respectively, this value is 90% divided by 3, which is 30%. The logical fragmentation level for each index is the percentage of outof-order pages in that index when the index was last analyzed. The Average Fragmentation value can help you identify critical fragmentation levels as you drill-down to details on individual tables and indexes. You can compare logical fragmentation levels across indexes to identify hot spots. You may see performance gains after defragmenting indexes with as little as 10% fragmentation. In general, consider defragmenting indexes with 20% or more fragmentation. Pages Read Displays the total number of pages used by the associated object and the objects it contains. For example, when you view this value for a database, it displays the total number of pages used by the database, including all pages used by all the tables and indexes in that database.
42

Using SQL defrag manager

Chapter 4

Fragmentation impacts disk I/O. Since larger indexes are less likely to be cached by SQL Server, fragmentation impacts the performance of large indexes more than small indexes. In general, focus on indexes with 1,000 pages or more. Pages Per Fragments Displays the average number of pages per fragment. This value is the total number of pages identified by the Pages Read value divided by the number of those pages that are not in logical order. Page Density Displays how much data is stored in the pages, identified by the Pages Read value, compared to the maximum amount of data that can be stored in those pages. Only a thorough analysis collects or updates this information. If no page density information has been collected for these pages, this value is set to N/A (not available). Low page density can cause SQL Server to read more pages than necessary when using an index, such as when performing a query. When data is initially stored on the pages, SQL Server uses the fillfactor value to determine how much data to store on each page. At this point, page density is relatively high, but the page density becomes lower as data is inserted and pages are split to make room for the additional data. SQL defrag manager can reorganize or rebuild indexes to increase page density and reduce the number of reads when using the index. Indexes Displays the total number of indexes on the associated object and the objects it contains.

How does does the Show/Hide filter work?


The Show/Hide filter options allow you to refine which objects SQL defrag manager displays on the Fragmentation Explorer tab. When you clear the check box for a group of objects, such as the Excluded check box, SQL defrag manager does not display those objects and updates the displayed fragmentation statistics, such as Average Fragmentation and Relative Fragmentation to not include those objects. The Criteria option defines which objects are represented by the Excluded group. If you clear the Excluded check box, SQL defrag manager does not display objects that match the specified criteria.

Chapter 4

Using SQL defrag manager

43

Can I perform actions on individual tables or indexes?


In addition to analyzing and defragmenting objects from the database or instance level, this window allows you to analyze and defragment individual objects, such as specific tables and indexes. When you right-click an object in the navigation tree, the context menu provides several options. You can schedule activities for an individual table or index by selecting the Edit configuration option on the right-click menu, and then specifying the management settings. To analyze or defragment a specific table: 1. In the navigation tree, click the database that contains the table you want to analyze or defragment. 2. In the right pane, click the Analyze or Defragment option in the panel for the table you want to analyze or defragment.

3. Select the Analysis Type or Defragmentation Type you want to perform.

Optimize Performance and Space Usage


The Defragment and Optimization window allows you to defragment one or more instances and databases. The SQL Servers and Databases field lists all the registered instances and databases. You can select the databases you want to defragment, and then select the type of defragmentation approach you want SQL defrag manager to use. SQL defrag manager can simply reorganize indexes for optimal performance, or defragment indexes by completely rebuilding them.
44

Using SQL defrag manager

Chapter 4

How do I open the Defragment and Optimization window?


To display the Defragment and Optimization window, click Defragment on the Fragmentation Explorer tab of the SQL defrag manager Console.

How do I select the instances and databases to defragment?


The SQL Servers and Databases field lists all the registered instances and databases. You can select an instance, which also selects all the databases in that instance. You can also select specific databases to defragment indexes in those individual databases.

What should I do if a database is not listed?


If the instance or database you want to defragment is not listed in the SQL Servers and Databases field, you may not have registered it with SQL defrag manager. To register an instance with SQL defrag manager, click Register on the Fragmentation Explorer tab of the SQL defrag manager Console. To register a database in a managed instance, right-click the instance on the Fragmentation Explorer tab, and then click Add database from this server.

What is the difference between reorganize and rebuild? rebuild ?


The type of defragmentation you choose depends on many considerations: Database availability Logical fragmentation level Parallel processor availability Page compaction Can you stop and restart process without losing data Can you untangle interleaved indexes Is additional disk space available in the data file Is the index large Do you need to rebuild statistics Should busy pages be skipped

Chapter 4

Using SQL defrag manager

45

Reorganize directs SQL defrag manager to defragment the tables and indexes online. This defragmentation can be stopped without losing progress. The amount of log space used varies with the amount of work done. During reorganization, SQL defrag manager skips pages that are in use. In general, select this defragmentation type when the instance or database must be available during defragmentation or when you defragment a small index. Rebuild directs SQL defrag manager to defragment the tables and indexes offline by completely rebuilding the indexes. This defragmentation type requires sufficient free space on your server and the amount of log space used can be extensive in full recovery mode. On large, fragmented indexes, this defragmentation type is significantly faster than a reorganization. In general, select Rebuild when the database can be unavailable during the time that the indexes are rebuilt. For more information, see Understanding Fragmentation on page 3.

How long will this process process take?


The time required to defragment a database depends on the number of pages used by the database, the activity level on that database, the performance of the computer where the database resides, and the type of defragmentation you choose to perform. Automation allows you to define a custom schedule for analyzing and potentially defragmenting databases during periods of low activity. You can also set SQL defrag manager to analyze databases on a regular schedule, such as daily or weekly. Since the database is not available while SQL defrag manager rebuilds one or more indexes in the database, you should run this defragmentation during periods when the database can be offline and unavailable.

Can I defragment an individual table ta ble or index?


Yes. The Fragmentation Explorer tab allows you to analyze and defragment individual objects, such as specific tables and indexes. For more information, see View Analysis Results in Fragmentation Explorer on page 40.

46

Using SQL defrag manager

Chapter 4

View Recent Activity


The Recent Activity tab of the SQL defrag manager Console displays the analysis and defragmentation tasks SQL defrag manager has performed. You can view the improvements accomplished during each defragmentation task.

How do I open the the Recent Activity tab? tab ?


To display the Recent Activity tab, click the Recent Activity tab of the SQL defrag manager Console.

How can I display details for an activity?


To view the details of an activity, click the plus sign icon to the left of the activity. SQL defrag manager lists expanded information about each index. You can select an item in the list and then review the information displayed in the Details section of the window.

What do the details mean?


The information in the Details section of the window provides complete information about the recent activity selected in the main section of the window. The Fragmentation and Page comparison statistics are available only when you click the plus sign icon to the left of an activity and select an individual index. Item
Action

Description
Specifies whether the action was an analysis or a defragmentation, and the type of analysis (fast or thorough), or the type of defragmentation (reorganize or rebuild) that occurred. Identifies whether the action was scheduled or run manually. Identifies amount of time required for the action to finish. Specifies the final result of the action, such as whether it was completed. Identifies any errors that occurred during the action. Specifies the name of the instance that contains the database.

Job Type Process Time Result Error Detail SQL Server Name

Chapter 4

Using SQL defrag manager

47

Item
Database Name

Description
Specifies the name of the database that was analyzed or defragmented. If you select an activity for more than one database, this field identifies the total number of databases included in the recent activity. Specifies the name of the table that was analyzed or defragmented. If you select an activity for more than one table, this field identifies the total number of tables included in the recent activity. Specifies the name of the index that was analyzed or defragmented. If you select an activity for more than one index, this field identifies the total number of indexes included in the recent activity.

Table Name

Index Name

What are escalations?


When SQL defrag manager performs a scheduled analysis, it may determine that it needs to rebuild or reorganize a database based on the management settings. These automated defragmentation activities are known as escalations.

How do items get created on this window?


When SQL defrag manager finishes performing an analysis or defragmentation activity, it adds that activity to the Recent Activity tab of the SQL defrag manager Console.

How does grouping information help me?


You can group activities by when they occurred, the action that occurred, or by the name of the instance, database, table, or index. To group the displayed activities by a column value, drag that column heading to the gray bar above the column headings. Grouping recent activities allows you to quickly scan and evaluate your management activities. For example, you can group and view activities for a specific database, table, or index, which lets you focus on the activities for that database object to make sure they are the activities you need to run.

48

Using SQL defrag manager

Chapter 4

How do I sort activities activities listed on this window?


To sort the activities by a column value, click the heading of that column. You can also group activities by a column value by dragging that column heading to the gray bar just above the column headings.

How do I remove an a n activity listed on this window?


To remove an activity listed on the Recent Activity tab, select the activity, and then click Clear. You can also select Clear All to remove all activities listed on this window.

How do I save the displayed information?


To save the information displayed in the Recent Activity tab, click Export near the top of the window. SQL defrag manager saves the items displayed in the Recent Activity tab as a file.

How do I print the list of recent activities?


To print the list of activities displayed on the Recent Activity tab, click Print near the top of the window. With this feature, you can report on the activities SQL defrag manager has performed and review them to ensure you have the management approach you want.

Other Common Tasks


The SQL defrag manager Console provides many capabilities to effectively manage fragmentation levels across your SQL Server databases. This section provides descriptions of several additional tasks available through the Console.

Chapter 4

Using SQL defrag manager

49

Cancelling an Activity
Some SQL defrag manager activities, such as analyzing several large databases, can require an extended period of time. While the activity is running, SQL defrag manager displays an option on the status bar of the SQL defrag manager Console that allows you to cancel that activity. To cancel the running activity, click the Cancel Activity icon shown on the status bar in the following figure.

Refreshing the Displayed Information


To improve performance, each SQL defrag manager Console caches some information about objects in the database. SQL defrag manager maintains and updates this cached information based on activities in the Console. When multiple SQL defrag manager Consoles connect to the same Repository, some changes made in one Console may not be displayed in the other Consoles. For example, if one Console registers a new instance, that instance may not be immediately displayed in other, open Consoles. To refresh the information displayed in the Console, click the Refresh icon along the top left edge of the SQL defrag manager Console, as shown in the following figure.

To refresh all the cached database information in a Console, display the Fragmentation Explorer tab and then click the Refresh icon in that Console.

50

Using SQL defrag manager

Chapter 4

Changing the Console Style


The SQL defrag manager Console provides several styles that change the appearance of the Console. You can choose which style you prefer to use. To select a style, click the Style icon along the top left edge of the SQL defrag manager Console, as shown in the following figure.

Chapter End

Chapter 4

Using SQL defrag manager

51

Index
A
Acceptable level, 20 ad hoc defragmentation, 23, 31 adding database objects, 27 server, 18 server instance, 16 analysis automation, 22, 30 analysis types, 39 analyze a table, 44 analyze manually, 39 architecture, 8 automated responses, 24 automatic defragmentation, 23, 31 automation management settings, 20, 30 overview, 29 response rules, 25 schedule, 22, 30 types, 23, 31 average fragmentation, 42 cancel, 50 capacity issues, 4 Caution and Critical levels, 20 centralized management, 2 change Console appearance, 51 fragmentation ranges, 22 checklist ad hoc defragmentation, 38 automation, 29 configuration, 14 choose automation type, 23, 31 common tasks, 38, 49 compaction considerations, 8 configuration getting started, 12 overview, 14 workflow, 14 confirm servers, 19 connect to Repository, 15 Console style, 51 contacting Idera, vii contiguous pages, 8

B
benefits, 2

continuous improvement, 3 conventions in documentation, vi creating recent activities, 48 scheduled activities, 34, 35

C
cached information, 50
52

Index

To Do items, 25 custom management settings, 29 custom registration, 17

Fragmentation Range window, 21 Fragmentation Responses window, 25 Manage Licenses window, 15

D
database confirm registration, 19 ignore, 19 DBCC INDEXDEFRAG command, 6 DBCC REINDEX command, 6 default fragmentation ranges, 22 defragment database, 44 index, 44 types, 6, 45 delete recent activities, 49 To Do items, 37 density, 43 display Analyze Fragmentation window, 39 Automate SQL Server Optimization window, 30 Automation Schedule window, 22 Connect to Repository window, 16 Defragment and Optimization window, 45 Fragmentation Explorer tab, 41

Recent Activity tab, 47 Register SQL Servers window, 17 Scheduled Activity tab, 33 SQL Servers to Register window, 18 To Do tab, 36 documentation conventions, vi

E
edit management settings, 19 escalation, 48 example defragmentation types, 6 page insert fragmentation, 5 exclude filter, 43 export, 35, 49 external fragmentation, 4

F
fast analysis, 39 file fragmentation, 4 fillfactor, 43 filter Fragmentation Explorer, 43 format conventions, vi fragmentation how it happens, 4 overview, 3 Index
53

ranges, 20 statistics, 42 types, 4 fragmented pages, 43 future activity, 33

list servers, 18 logical order fragmentation, 4 logical page order, 7 low page density, 43

M
manage licenses, 15 new databases, 27 new objects, 27 management settings automation schedule, 22, 30 automation wizard, 30 custom, 29 defining, 19 fragmentation ranges, 20 inheritance, 20 responses, 24 missing instances, 16, 19

G
getting started, 12 grouping recent activities, 48 scheduled activities, 34 To Do items, 36

H
how registration works, 18

I
Idera about, vii contacting, vii products, vii ignore objects, 28 increased productivity, 3 index count, 43 index pages, 42 inherit management settings, 20 interleaved index, 8 internal fragmentation, 4

O
operating system, 4 optimize performance, 44

P
page density description, 43 fragmentation, 4 statistics, 40 pages fragments, 43 read, 42

L
leaf-level reordering, 7 licenses, 15

54

Index

past activity, 47 perform To Do items, 37 physical page swaps, 7 print recent activities, 49 scheduled activities, 35

recent activities, 49 scheduled activities, 35 schedule considerations, 24, 32 scheduled activity details, 33 semi-automated To Do items, 35 semi-automatic defragmentation, 23, 31 skip database, 19 sorting recent activities, 49 scheduled activities, 35 To Do items, 37 statistic explanations, 42 stop activity, 50 storage area network impact, 4 style appearance, 51 system defragmentation tools, 4

Q
quick registration, 17

R
rebuild indexes, 6, 45 recent activity details, 47 reduce space usage, 44 refresh displayed information, 50 register new databases, 27 new objects, 27 server instance, 16 registration type, 16 remove objects, 28 reorganize indexes, 6, 45 reporting, 3, 35, 49 Repository connection, 15 requirements, 10 responses fragmentation thresholds, 21 rules, 24

T
tables without indexes, 42 technical support, vii thorough analysis, 40 thresholds, 20 time requirements, 40, 46 time windows, 24, 32 To Do item details, 36 total indexes, 43 total pages, 42 tuning performance, 2

S
save

U
understanding statistics, 42 Index
55

upcoming activity, 33 update displayed information, 50 usage workflows, 2

To Do items, 35

W
welcome, 1 why defragment, 6

V
view analysis results, 40 recent activity, 47

workflow ad hoc defragmentation, 38 automation, 29 configuration, 14

56

Index

You might also like