SQL Defrag Manager User Guide
SQL Defrag Manager User Guide
SQL defrag manager improves server performance by detecting fragmentation hot spots and automatically defragmenting them using the best defragmentation method and schedule. Welcome to defrag manager Configuring SQL defrag manager Automating Defragmentation Using SQL defrag manager
Help System
This Help system can be accessed either through the Help menu or by pressing F1 on your keyboard while on the window you would like more information about. To search for topics that explain the specific information you need, select the Search tab, type in the keyword in the space provided, and click List Topics for a list of all the topics that contain the keyword you entered. How do I print the Help? 1. Select the SQLdefrag manager node in the table of contents and click the Print button. 2. Check the Print the selected heading and all subtopics box to open your print dialog.
Document Conventions
Idera documentation uses consistent conventions to help you identify items throughout the printed online library. Convention
Bold
Specifying Window items Book and CD titles Variable names New terms File and directory names Commands and code examples Text typed by you Optional command parameters Required command parameters Command parameters where only one of the options can be specified
Italics
Fixed Font
Straight brackets, as in [value] Curly braces, as in {value} Logical OR, as in value 1 | value 2
Additional Resources
The Documentation folder of the installation directory includes several important documents. These documents include the following: Release Notes Provides information on installing the product, new features included in this release, and known issues. Quick Start Guide Provides system requirements, installation guide, and an overview.
Legal Notice
Idera a division of BBS Technologies, Inc. IntelliCompress, DTx, SQLcheck, SQL change manager, SQLconfig, SQL compliance manager, SQLcompliance, SQL defrag manager, SQL diagnostic manager, SQLdm, SQL job manager, SQL mobile manager, SQLpermissions, SQLsafe, SQLsafe Freeware Edition, 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. 2008 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-2008 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.
About Idera
At Idera, we have engineered a new generation of tools for managing and administering the world's 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, configure in hours, and deploy worldwide in days. To learn more about Idera products, visit http://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 protected] Support 713.533.5144 1.877.GO.IDERA (464.3372) (only in the United States and Canada) www.idera.com/support www.idera.com
Website
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. 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. 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. 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 policy 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. SQL Server 2005/2008 allows the option to Rebuild Online, which allows access to the tables before the operation is finished. However, choosing to rebuild online requires more resources (disk space, cpu, memory), and may slow performance. 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. 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.
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. o 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. o 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. o o
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. 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 policies 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:
o Microsoft .NET Framework version 2.0 o MDAC 2.8 or later o 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: Microsoft SQL Server (Repository) Microsoft SQL Server (Managed Instance) Windows 2000 Server SP4 or later Windows Server 2003 or later Windows Vista Enterprise or Business
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
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 Requirement 2 GHz 2 GB
Operating System One of the following operating systems: Windows 2000 Server SP4 or later Windows Server 2003 Windows Vista Enterprise or Business Windows XP SP2 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 Requirement Local Administrator permissions on the computer hosting the Management
Requirement Service. A member of the sysadmin fixed server role on the SQL Server instance hosting the Repository.
Getting Started
This procedure guides you through your initial start up process. For more information about managing 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 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. 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. Specify your local SQL Server instance using the Add by Name button or locate it using the Retrieve SQL Servers button. 3. Select your local SQL Server instance, and then click Next. 4. Select the policies you want to assign, and then click Finish.
policies for the automated processes to meet your specific needs. For more information, see Workflow for Creating Automation Policies. 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 Select Your Policy
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.
Select the Authentication Type Select which credentials SQL defrag manager will use to connect to registered SQL Servers. If you select SQL Server authentication, you must provide a login name and password. Select a Policy The Policy window lets you select policies to apply to the instance you are registering. Select the policies you want to apply, and then click Finish. The following sample policies are available: Rebuild Online Daily Top 10 Rebuild Online if available on a daily schedule the top 10 most fragmented indexes over 70% Rebuild Weekly All Rebuild indexes where fragmentation is greater than 70% and page count is greater than 1,000. Reorganize Daily All (Nightly Window) Reorganize indexes where fragmentation is greater than 30% and page count is greater than 1,000. Reorganize Interval Top 10% Reorganize the top 10% of the indexes on a 1 hour interval that are greater than 30% fragmented. Reorganize Interval Top 10 Reorganize the top 10 indexes on a 1 hour interval that are greater than 30% fragmented. Reorganize Large Indexes (Nightly Window) Reorganize the largest indexes (greater than 10,000 pages) with fragmentation greater than 70% only during the nightly maintenance window (12 am to 4 am). ToDo List Reorganize Large Indexes Run a policy once a week to create a ToDo list of large indexes (greater than 10,000 pages) that are candidates for reorganization. ToDo List Reorganize Medium Indexes Run a policy daily to create a ToDo list of medium indexes (greater than 1,000 but less than 10,000 pages) that are candidates for reorganization. When you create custom policies, they will appear in this window and will be available to apply to future instances as they are 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 objecttype. 3. Review the confirmation message, and then click Yes.
Creating Policies
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 policies to automate this process and maintain your databases with minimal time and effort. Click Automate to create a new policy.
Do I have to define automation policies? No. If you want to perform ad hoc defragmentation activities, you do not need to define a policy. The policies define how SQL defrag manager handles automated analysis activities and the defragmentation activities related to the results of those automated analyses. 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 policy for those specific database objects. Select the Policy Targets Use the Targets tab in the SQL defrag manager Policy wizard to select which indexes will be evaluated by this policy. You can use Target Selection to select any object in the tree by checking it. This will automatically select all the objects below it. You can also deselect objects by unchecking the objects at any level. Index Type will determine whether the display includes all indexes or only clustered or nonclustered indexes. Note: Changing the index type will clear the current targets selected. Define the Policy Thresholds Use the Thresholds tab in the SQL defrag manager Policy wizard to set the frequency of analysis and adjust the rules for fragmentation and scan density. Analysis Frequency Select a higher Analysis Frequency for indexes that fragment more rapidly due to updates, deletions, and insertions; select a lower frequency for indexes that are more static. Index Selection Rule Indexes will typically perform well when fragmentation falls below 30% and scan density is higher than 80%. Select the ranges that are appropriate for the target indexes selected. If both fragmentation and scan density are selected, both conditions must be met for an index to comply with this policy. 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. What is the fragmentation 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 displayed as 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. On the Summary tab, you can define indexes that are not compliant with this policy as either Caution or Critical. You can also assign a response for indexes which are not in compliance with this policy. 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 do I change these values? This window provides a slider control that allows you to adjust the threshold value that will trigger a response for this policy. 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.
Filter the Covered Indexes Use the Filters tab in the SQL defrag manager Policy wizard to select additional criteria for indexes to be evaluated by this policy. Filters Page Count Set the minimum and maximum ranges to dictate the size of the indexes selected. Indexes with small page counts will not benefit as much from defragmentation because query optimizers often use table scans instead of indexes. Operation Order Choose the order in which the optimization will occur for the qualifying indexes. Qualifying Indexes Select a top number or percentage of qualifying indexes to narrow down the number of indexes optimized. Choose the Policy Response Use the Response tab in the SQL defrag manager Policy wizard to select how the policy will respond when the specified conditions are met. Optimize Selecting Reorganize will not hold long-term table locks and have less impact to availability. However, it will result in less reduction of fragmentation levels. Selecting Rebuild will have a higher impact on your system availability, but it will provide the best results in reduction of fragmentation. Setting SORT_IN_TEMPDB directs SQL Server 2005 to use tempdb for the intermediate sort results that are used to build the index.
If availability during rebuild is important, you can also select ONLINE. However, due to additional operation time and resource consumption, this is only recommended when availability is important. For more information, see Microsoft Books Online. Automate Select whether you want SQL defrag manager to automatically defragment qualifying indexes, or only to add them to the To Do list. 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 Yes, Automatically Reorganize, when SQL defrag manager performs a scheduled analysis activity, SQL defrag manager will attempt to defragment each index it finds that is not compliant with policy using the reorganize or rebuild method you seleted. If you select No, Add To Do item, when SQL defrag manager performs a scheduled analysis activity, SQL defrag manager will create a To Do item on the To Do viewof the SQL defrag manager Console for each index it finds that is not compliant with policy. What should I specify? The fields on this window are defined as follows: Option Reorganize Rebuild Result Starts a Reorganize defragmentation activity when SQL defrag manager identifies an index not compliant with policy during a scheduled analysis. Starts a Rebuild defragmentation activity when SQL defrag manager identifies an index not compliant with policy during a scheduled analysis. You can also choose the location for the intermediate sort results that are used to build the index. Add To Do Item Creates a To Do item on the To Do view when SQL defrag manager identifies an index not compliant with policy during a scheduled analysis.
For more information about Reorganize and Rebuild defragmentation activities, see Optimize Performance and Space Usage. Set the Policy Schedule Use the Schedule tab in the SQL defrag manager Policy wizard to select when and how often the policy will run. Type Select the type to change which Schedule options are available. Schedule Based on the type selected, you can specify when the policy will run. Restrictions You can restrict policy by setting a timeframe as a maintenance window in which the policy will run. You can also set the policy to stop automatically if this window has passed.
What types of automation can I use? Based on the policy 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 the policy 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 the Policy Thresholds. You can schedule SQL defrag manager to analyze your registered instances on a regular basis. You can define the policies 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. 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 a rebuild 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 a rebuild before running the next policy. If you select the Interval or Daily option, you can specify the time period during which the policy can start. SQL defrag manager runs the policy and then the associated defragmentation activities based on the defined automated responses. You can set SQL defrag manager to stop these automated analysis and defragmentation activities when the end time specified for the between option is reached. Name and Enable the Policy Use the Summary tab in the SQL defrag manager Policy wizard to enter a name and description for the policy. You can check Enable Policy when you are ready to use this policy. 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.
The Severity Level Ranking is used to qualify the severity of this policy. When overlapping targets are in more than one policy, SQL defrag manager will always display the highest severity level.
View To Do Items
The To Do tab of the SQL defrag manager Console lists the indexes that require your attention based on automated policies. When you create policies, 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 yourpolicies. 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. How do I open the To Do view? To display the To Do view, click the To Do view 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 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.
Recommendation Provides a recommendation for how to resolve the identified fragmentation issue. How does grouping information help me? You can group activities by the policy 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. 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 activity listed on this window?
Select the item, and then click Clear near the top of the window.
You can perform a fast analysis on a database that is in use, since it consumes less time and resources than a thorough analysis. 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. 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.
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. 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. What do the icons 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 out-of-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. 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 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. 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. 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.
What should I do if a database is not listed? SQL defrag manager should automatically discover instances and databases on your servers. What is the difference between reorganize and rebuild? The type of defragmentation you choose depends on many considerations: o Database availability o Logical fragmentation level o Parallel processor availability o Page compaction o Can you stop and restart process without losing data o Can you untangle interleaved indexes o Is additional disk space available in the data file o Is the index large o Do you need to rebuild statistics o Should busy pages be skipped 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 (SORT_IN_TEMP) 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. Rebuild (ONLINE) directs SQL defrag manager to defragment the tables and indexes online by completely rebuilding the indexes. This defragmentation type requires greater resources such as disk space, memory, and processing. Because of the additional operation time and resource consumption, rebuilding online is only recommended with availability is important. For more information, see Understanding Fragmentation. How long will this 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 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.
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 Item Action Description 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.
SQL Server Specifies the name of the instance that contains the database. Name Database Name 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.
Table Name 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. Index Name 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. 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. How do I sort 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 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.
Canceling 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.
To refresh all the cached database information in a Console, display the Fragmentation Explorer tab and then click the Refresh icon in that Console.