SQL Server Compression Estimator


SQL Server Compression Estimator is a free tool available through CodePlex (http://ssce.codeplex.com/) which helps you in estimating the best compression for your SQL server objects. It estimates both Row and Page compression and also provides option to generate script for altering your SQL Server objects to implement compression.

My great thanks to MajikbyboB for providing this tool to the community for free.

Let us see how to install and use this tool

Download and extract the setup from the above site and extract the zip file and run setup.exe

image

Click “Next” to proceed

image

Select the installation folder and then click “Next” to proceed

image

Click “Next” to confirm the installation and proceed

image

Click “Close” to finish the installation

image

Now we have successfully installed the tool, Let us see how to run and estimate compression on databases

Run “Compression Estimator” and specify your Server name and select authentication method and provide required credentials and click “Connect”

image

image

Click on Database combo and select your database, and then specify the savings threshold.

Savings threshold identify what objects to be reports based on the saving in size due to compression

If you want to include index maintenance ratio, select the “Include index maintenance ratio” check box.

Click “Process” to proceed

image

Once the processing is complete, you can see the list of objects which can be compressed with the following details

1. Type of Compression (Page or Row)

2. Current Size

3. Compressed Size

4. $ of Savings

image

You can save the estimation results as CSV file by using “Save Results” option for your reference.

You can select the required changes to be made and then click on “Create Script” to generate the SQL Script to make compression changes

Sample Script generated

  1. — This compression script was created by Compression Estimator
  2.  
  3. — By applying PAGE compression setting, you should obtain
  4. — approximately 53.33% compression
  5. ALTER TABLE [Production].[Product]
  6. REBUILD
  7. WITH (DATA_COMPRESSION = PAGE);
  8.  
  9. — By applying PAGE compression setting, you should obtain
  10. — approximately 53.70% compression
  11. ALTER INDEX IX_Address_AddressLine1_AddressLine2_City_StateProvinceID_PostalCode ON [Person].[Address]
  12. REBUILD WITH (DATA_COMPRESSION = PAGE);
  13.  
  14. — By applying PAGE compression setting, you should obtain
  15. — approximately 63.64% compression
  16. ALTER TABLE [Production].[BillOfMaterials]
  17. REBUILD
  18. WITH (DATA_COMPRESSION = PAGE);
  19.  
  20. — By applying PAGE compression setting, you should obtain
  21. — approximately 59.09% compression
  22. ALTER TABLE [Purchasing].[PurchaseOrderHeader]
  23. REBUILD
  24. WITH (DATA_COMPRESSION = PAGE);
  25.  
  26. — By applying PAGE compression setting, you should obtain
  27. — approximately 56.25% compression
  28. ALTER INDEX AK_CurrencyRate_CurrencyRateDate_FromCurrencyCode_ToCurrencyCode ON [Sales].[CurrencyRate]
  29. REBUILD WITH (DATA_COMPRESSION = PAGE);
  30.  
  31. — By applying PAGE compression setting, you should obtain
  32. — approximately 60.00% compression
  33. ALTER TABLE [Production].[ProductListPriceHistory]
  34. REBUILD
  35. WITH (DATA_COMPRESSION = PAGE);
  36.  
  37. — By applying PAGE compression setting, you should obtain
  38. — approximately 60.00% compression
  39. ALTER INDEX IX_ProductReview_ProductID_Name ON [Production].[ProductReview]
  40. REBUILD WITH (DATA_COMPRESSION = PAGE);
  41.  
  42. — By applying PAGE compression setting, you should obtain
  43. — approximately 60.00% compression
  44. ALTER TABLE [Production].[ProductCostHistory]
  45. REBUILD
  46. WITH (DATA_COMPRESSION = PAGE);
  47.  
  48. — By applying PAGE compression setting, you should obtain
  49. — approximately 60.00% compression
  50. ALTER INDEX AK_Employee_LoginID ON [HumanResources].[Employee]
  51. REBUILD WITH (DATA_COMPRESSION = PAGE);
  52.  
  53. — By applying ROW compression setting, you should obtain
  54. — approximately 60.00% compression
  55. ALTER INDEX IX_ProductReview_ProductID_Name ON [Production].[ProductReview]
  56. REBUILD WITH (DATA_COMPRESSION = ROW);
  57.  
  58. — By applying PAGE compression setting, you should obtain
  59. — approximately 69.62% compression
  60. ALTER TABLE [Production].[WorkOrder]
  61. REBUILD
  62. WITH (DATA_COMPRESSION = PAGE);
  63.  
  64. — By applying PAGE compression setting, you should obtain
  65. — approximately 67.25% compression
  66. ALTER TABLE [Production].[TransactionHistoryArchive]
  67. REBUILD
  68. WITH (DATA_COMPRESSION = PAGE);
  69.  
  70. — By applying PAGE compression setting, you should obtain
  71. — approximately 57.58% compression
  72. ALTER TABLE [Purchasing].[PurchaseOrderDetail]
  73. REBUILD
  74. WITH (DATA_COMPRESSION = PAGE);
  75.  
  76. — By applying PAGE compression setting, you should obtain
  77. — approximately 73.25% compression
  78. ALTER TABLE [Production].[WorkOrderRouting]
  79. REBUILD
  80. WITH (DATA_COMPRESSION = PAGE);
  81.  
  82. — By applying PAGE compression setting, you should obtain
  83. — approximately 64.86% compression
  84. ALTER TABLE [Production].[TransactionHistory]
  85. REBUILD
  86. WITH (DATA_COMPRESSION = PAGE);
  87.  
  88. — By applying PAGE compression setting, you should obtain
  89. — approximately 65.31% compression
  90. ALTER TABLE [Sales].[CurrencyRate]
  91. REBUILD
  92. WITH (DATA_COMPRESSION = PAGE);

I hope you all find this information useful. Please post your comments !!!

Advertisement

SQL Nexus–How to generate Reports from Performance Data collected and imported ?–Part 3


In previous posts we saw  How to install, configure and collect performance data from SQL Server 2005/2008/2008 R2 ? and  How to import Performance Data using SQL Nexus ?

In this post we will see How to generate Reports in SQL Nexus 

The following are the list of reports available

image

Blocking and Resource Wait Statistics Report

clip_image001

Bottleneck Analysis Report

clip_image002

Bottleneck Analysis –Drill down sub report

clip_image003

Bottleneck Analysis –Drill down sub report – Wait Statistics

clip_image004

clip_image005

SQL Server 2005 Performance Statistics Reports

clip_image006

Bloaking and Wait Statistics and Bottleneck Analysis reports are linking to Reports we saw earlier

Spinlock Statistics Report – Spinlock is a lightweight, user mode synchronization object used to protect a specific structure. The goal of this report is to see there are no collissions and spin.

clip_image007

clip_image008

SQL Server 2008 Performance Statistics Reports

Blocking and Wait Statistics, Bottleneck Analysis and Spin Lock Stats reports links to the above reports we saw.

clip_image009

Query Hash Report – This report show you the list of queries with details of How many times it executed, How many query plans were created, Total CPU time taken, Total Duration to execute the query and Total Logical IO Reads

clip_image010

clip_image012

Query Hash Report – Performance Overview Drilldown report

clip_image013

clip_image014

Query Hash Report – Top Unique Batches Drilldown charts

clip_image015

Query Hash Report – Top Unique Batches Details report

clip_image017

Query Hash Report – Resource Consumption report

clip_image018

clip_image019

clip_image020

clip_image022

clip_image024

Query Hash Report – Top Unique Batches Details Report

clip_image028

Interesting Events Report shows the number of times events like Auto Stats Updation, Lock Escalation, Missing column statistics, etc… is occurring along with Trace Event ID, you can also drill down into each event and see the query caused the event as well

clip_image029

Interesting Events – Drilldown Report

clip_image030

clip_image032

I hope you all find this information useful… Please post your comments !!!

SQL Nexus–How to import Performance Data collected using PSSDiag ?–Part 2


In the last post, we saw how to install, configure and collect performance data from SQL Server 2005/2008/2008 R2, in this post, we will how to import that data using SQL Nexus and get ready to prepare Performance Analysis Reports

SQLNexus is a free tool developed by SQL Server support team and used for importing and analyzing performance data collected using SQL Diag and PSSDiag. Its helps identifying the Bottle necks, blocks, CPU consuming queries, Wait, Locks information, etc…

SQLNexus is freely available for download from http://sqlnexus.codeplex.com/

To run SQLNexus, you need to install the following prerequisites

.Net Framework 3.5

SQL Server 2008 SP1 Report viewer control (http://www.microsoft.com/downloads/details.aspx?FamilyID=bb196d5d-76c2-4a0e-9458-267d22b6aac6&DisplayLang=en)

SQL Server 2005 or above – To store imported performance data. You can also use SQL Server Express Edition

ReadTrace (RML Utilities for SQL Server)

x64 – http://www.microsoft.com/downloads/en/details.aspx?FamilyId=B60CDFA3-732E-4347-9C06-2D1F1F84C342&displaylang=en

x86 – http://www.microsoft.com/downloads/en/details.aspx?FamilyId=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&displaylang=en

After installing all prerequisites, download the SQLNexus from the above site and store it any local folder and then extract the zip file SQLNexus3.0.0.0.zip

image

Double click or Run “SQLNexus.exe”

image

On loading of the application, it will prompt you to connect to SQL Server instance on which you want to create the SQLNexus database, specify the Server Name, Authentication information and click “Connect”

Its not recommended to run this on your production server, since it will create lot of performance loads while importing the data and running the reports

If RML Utilities is not installed, you will get the below error message

image

Without RML Utilities, Trace files (.trc) will not be imported

image

On successful connection, you will see the above Main Dashboard screen, To start the import process, click on “Import” link left hand bottom side of the screen

image

Click Folder Browse icon and select the folder on which your Output data from PSS Diag and SQL Diag tool is stored.

Please make sure there is no spaces in the folder names, If you have space in the folder name, you will  not be able to import the Trace files

To customize the import options, click on “Options”

image

Select the required options and if you want to retain the options you selected, click on “Save My Options”, for any reason, if you need to reset all the options you selected to default options, click on “Restore Default Options”

Use “Drop Current DB Before Importing” option to drop and recreate the database every time, this option will be helpful, if you want to load clean set of data every time.

Once finished customizing the options, click on “Import” button to proceed with the import

image

You will receive the above warning message, if you have selected “Drop Current DB Before Importing” option. click “Yes” to proceed with drop database and import

image

The above screenshots shows the import process and list of various files imported along with the number of records imported and also shows us whether the file imported successfully or not.

If you notice, the second line, Import for DBCC_MEMORYSTATUS_Startup.out file has failed, this is a known issue, there is no report currently available for DBCC MEMORYSTATUS, due to which this import will fail always, to follow up about this issue, please visit this discussion link CodePlex discussion forums http://sqlnexus.codeplex.com/workitem/11455 

Now the import has completed successfully.

Click on File Menu and then click on “Run All Reports” to generate the reports

image

After the reports are generated, the Report link icons will change as follows

image

Since we don’t have any data related to SQL Server 2000, it will remain unchanged.

In the next post, we will explore the reports generated by SQLNexus and see various information available through them.

I hope you all find this information useful. Please post your comments !!!

PSSDiag / SQL Diag Manager–How to install, configure and collect performance data from SQL Server 2005/2008/2008 R2 ?–Part 1


PssDiag / SQL Diag Manager is a freely available graphical tool in CodePlex (http://diagmanager.codeplex.com/). It provides easy way to configure what data needs to be collected from SQL Server and Windows Server for troubleshooting SQL Server performance issues.

This tool is used by Microsoft SQL Server support team to collect data to troubleshoot performance issues.

Let us see how to install, configure and collect data

Step 1: Once downloaded the setup from the above specified link, run the Setup.exe and click “Next” on Welcome screen

clip_image001

Step 2: Select your installation folder and then click “Next”

clip_image002

Step 3: Click “Next” to confirm the installation

clip_image003

Step 4: Click “Close” to confirm the installation

clip_image004

Step 5: Once the installation is successfully completed, click on Start Menu and open “PSS Diag” and then click on “PSSDiag Configuration Manager”

image

Step 6: To configure the PSSDiag, Please specify the following information Machine Name (SQL Server Name), Instance Name (If Default Instance, specify *), Select authentication

clip_image006

Trace Template

By default, SQL Server 2008 is selected, PerfMon counters associated will be selected and for Database Engine, there are 3 trace templates available

image

Select the Trace template and specify the Maximum size, If you set it to “None”, file size will be unlimited, Please make sure you collect only Trace information for required events, selecting all events will degrade the performance of your SQL Server

Custom Diagnostics

Select the custom diagnostics you wish to collect, “SQL Memory Error” and “SQL Blocking” is not selected by default, these 2 are useful Custom Diagnostics to troubleshoot any blocking issues or long running query issues

image

Even though You see option to Select “SQL Server 7.0” and “SQL Server 2000”, this utility doesn’t support those versions of SQL Server.

clip_image007

Step 7: To configure Analysis service engine collection information, click “Analysis Services” tab, you can customize the PerfMon counters, Trace information and Custom Diagnostics

clip_image008

Step 8: Save the configuration – Once finished configuring, click on “Save” button on top

clip_image009

Specify the path on which you want to save the configuration output file and click “Ok”

clip_image010

Specify whether you are planning to run this on SQL Server 2008 or SQL Server 2008 R2

clip_image011

Once the configuration files are generated and packed as CAB file, the following message will be displayed. Click “Ok” to complete configuration and Exit the tool

Step 9: Run the PSSDiag and Collect the performance data

Open Window Explorer and go to the folder where the PSSD.CAB file is stored and then open it and extract the files. To extract the data, you can use any Zip tool such as 7 Zip or Win Zip or WinRAR

Once extracted, double click on “PSSDiag.cmd” or run it from Command Line

clip_image012

Click “Yes” to proceed with running the utility to start collecting performance data

SQLDiag utility will start with specified configuration and will display series of messages as displayed below

clip_image013

clip_image014

You can let run the tool as long as you want to collect the data. To stop collecting the data and exit the Tool, Press “Ctrl + C”.

The output from SQL Diag will be stored in folder named “Output”, from the folder where you are running the tool, Ex. If you are running the tool from “C:\Workspace\PSSConfig\”, then the output folder will be “C:\Workspace\PSSConfig\output”

clip_image015

The output folder will contain lot of different files containing the information collected.

In the next post, we will see how to import this collected information, run reports and find out how to identify the performance issues.

SQL Diag Configuration Tool


SQL Diag Configuration Tools is an easy to use tool which will help you in configuring SQLDiag.xml to collect performance data from SQL Server 2005/2008/2008 R2

SQL Diag Configuration Tool is a free tool available on Codeplex. You can download it from the following link

http://sdct.codeplex.com/ 

Let us walkthrough the steps of using SQL Diag Configuration Tool

After installation, run the tool

image

Select your desired SQL Server version and then click on “Authentication Method” option available on left side

image

Specify the Server name and SQL Server Instance Name on which you are planning to use the SQLDiag.xml and then click “Machine Wide Diagnostics” option

image

Select the Events Logs you want collect as part of performance data and then click on “Instance Specific Diagnostics”

image

If you want to collect Blocking information, select “Blocking” and the specify the Maximum File Size of log and the maximum number of files and the polling interval on which the Blocking information should be collected from SQL Server

Next Click on “Profiler" Options

image

Click “Enable SQL Tracing” to collect Profiler information and select a Trace Template.

Available Trace Templates are

image

After selecting, you can also add further Events you want to collect and then specify the maximum file size, maximum number of files and polling interval on which profiler information should be collected from SQL Server

Next click “Perfmon Options” to proceed

image

Select the Performance Counters which you want to collect or select the predefined template available and then specify Maximum File Size and the polling interval on which performance counter data should be collected

Next Click on “Producers” to enable the Producers options

image

Next Click on the “Analyzers” to enable the required Analyzers

image

Click “Save” to SQLDiag1050.xml and use it as input for SQLDiag to collect SQL Server Performance Data

You can use the  “Open” option reload the saved SQLDiag xml file and modify the profiler or perfmon or other above specified options.

I hope you find this useful…

%d bloggers like this: