Professional Documents
Culture Documents
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
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
Chapter 1
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.
Chapter 1
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
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.
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
Now, the logical order of the index does not match the physical order, and the index has become fragmented.
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.
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
Chapter 1
The following diagram illustrates the components of the SQL defrag manager architecture.
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
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.
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
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
One of the following versions of Microsoft SQL Server: MS SQL Server 2000 Standard or Enterprise MS SQL Server 2005 Standard or Enterprise
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
11
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.
Chapter 1
Chapter 1
13
Chapter 2
14
Chapter 2
Chapter 2
15
16
Chapter 2
Chapter 2
17
18
Chapter 2
Chapter 2
19
20
Chapter 2
22
Chapter 2
Chapter 2
23
24
Chapter 2
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
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.
26
Chapter 2
Chapter 2
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.
28
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.
Chapter 3
Automating Defragmentation
29
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.
30
Automating Defragmentation
Chapter 3
Chapter 3
Automating Defragmentation
31
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.
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
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.
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
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.
Automating Defragmentation
Chapter 3
Chapter 3
Automating Defragmentation
37
Chapter 4
38
Chapter 4
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
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.
40
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.
Chapter 4
41
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.
Chapter 4
43
Chapter 4
Chapter 4
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.
46
Chapter 4
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
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
48
Chapter 4
Chapter 4
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.
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
Chapter 4
Chapter End
Chapter 4
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
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
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
To Do items, 35
W
welcome, 1 why defragment, 6
V
view analysis results, 40 recent activity, 47
56
Index