bsm_sqlsvrperfomanceoptimizationguide

Upload: david-hung-nguyen

Post on 04-Jun-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    1/16

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    2/16

    Please direct questions about Business Service Manager or comments on this document to:

    APM Customer SupportFrontLine Support Login Page:

    http://go.compuware.com

    Copyright 2012 Compuware Corporation. All rights reserved. Unpublished rights reserved under the Copyright Laws of the

    United States.

    U.S. GOVERNMENT RIGHTS-Use, duplication, or disclosure by the U.S. Government is subject to restrictions as set forth inCompuware Corporation license agreement and as provided in DFARS 227.7202-1(a) and 227.7202-3(a) (1995), DFARS252.227-7013(c)(1)(ii) (OCT 1988), FAR 12.212(a) (1995), FAR 52.227-19, or FAR 52.227-14 (ALT III), as applicable.Compuware Corporation.

    This product contains condential information and trade secrets of Compuware Corporation. Disclosure is prohibited withoutthe prior express written permission of Compuware Corporation. Use of this product is subject to the terms and conditions of theuser's License Agreement with Compuware Corporation.

    Documentation may only be reproduced by Licensee for internal use. The content of this document may not be altered, modiedor changed without the express written consent of Compuware Corporation. Compuware Corporation may change the contentspecied herein at any time, with or without notice. All current Compuware Corporation product documentation can be found athttp://go.compuware.com.

    AdobeReaderis a registered trademark of Adobe Systems Incorporated in the United States and/or other countries.

    All other company and product names are trademarks or registered trademarks of their respective owners.

    Local Build: May 8, 2012, 13:41

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    3/16

    BSM SQL Server Database Performance Optimization Guide Page 3

    BSM SQL Server Database Performance Optimization Guide Page 3

    Table of Contents

    1 Database Performance Optimization Overview ........................................................................................... 41.1 New Installation, BSM 11.5 or Later, SQL Server Enterprise Edition ................................................................ 41.2 Upgrade Installation, BSM 11.0 or Later, SQL Server Enterprise Edition ........................................................ 41.3 New or Upgrade Installation, BSM (any release), SQL Server Standard Edition .......................................... 4

    2 Setting Up a Data Purging Schedule ................................................................................................................ 53 Rebuilding Database Indexes ............................................................................................................................. 74 Determining Database Partitioning ............................................................................................................... 16

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    4/16

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    5/16

    BSM SQL Server Database Performance Optimization Guide Page 5

    BSM SQL Server Database Performance Optimization Guide Page 5

    2 Setting Up a Data Purging ScheduleTo create a data purge schedule In the BSM Configuration Client, choose Server-> Task Scheduling.

    The Task Schedulingview appears, as shown in the following illustration:

    For each of the tables listed on the left, you can define a data purge schedule. On the right, you can setpurging for this table to Activeby selecting the box, and then setting the time in which purging for thistable should occur.

    Purging for each of these tables should be staggered across different times and/or days to ensure thateach task completes successfully.

    On the Purge Configurationtab for each table, you can define how long to retain data before it ispurged. Tables have either a single option or a more detailed configuration.

    For statistics appearing in the various statistics tables, you can set the data retention periods to limitdatabase growth and improve overall database performance. The recommended retention periods forthe following types of statistics are shown in the following list and screen shot:

    Hourly Stats: 30 days

    Daily Stats: 60 days

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    6/16

    BSM SQL Server Database Performance Optimization Guide Page 6

    BSM SQL Server Database Performance Optimization Guide Page 6

    Weekly Stats: 12 weeks

    Monthly Stats: 12 months

    Yearly Stats: 5 years

    Tip: Although setting the retention period of statistics in the various statistics tables to therecommended values will help limit database growth and improve the overall performance of yourdatabase, you may notice a slight increase in the time it takes for data stored in statistics tables to bepurged from the database. To assess the impact of setting the retention period values to therecommended values, review the Purge Jobs section of the Health Report and, if necessary, rescheduleyour purge job to an off-peak time.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    7/16

    BSM SQL Server Database Performance Optimization Guide Page 7

    BSM SQL Server Database Performance Optimization Guide Page 7

    3 Rebuilding Database IndexesProperly configured database indexes improve query response times and need to be maintainedperiodically as they become fragmented much like how a hard disk becomes fragmented after frequentuses. When this happens, the database indexes need to be rebuilt to improve ensure optimal

    performance.

    The steps below show how to setup a maintenance task in Microsoft SQL Server to rebuild the indexeson a schedule. The screenshots and instructions apply to Microsoft SQL Server 2008 R2, so the actualsteps may vary slightly depending on your exact version.

    1. In the Microsoft SQL Server Management Studio Object Explorer, choose Management > MaintenancePlans. Any existing Maintenance Plans appear.

    2. Right-click the Maintenance Plansfolder and select Maintenance Plan Wizard.The Maintenance Plan Wizardappears.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    8/16

    BSM SQL Server Database Performance Optimization Guide Page 8

    BSM SQL Server Database Performance Optimization Guide Page 8

    3. Click Next.The Select Plan Propertiespage appears.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    9/16

    BSM SQL Server Database Performance Optimization Guide Page 9

    BSM SQL Server Database Performance Optimization Guide Page 9

    4. Type a name for the maintenance plan, and then click Changeto set up the job schedule, asshown in the following illustration:

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    10/16

    BSM SQL Server Database Performance Optimization Guide Page 10

    BSM SQL Server Database Performance Optimization Guide Page 10

    Note: You can define how often you wish to run the plan. In the schedule above, it has beenconfigured to run every Sunday at midnight. Because rebuilding indexes will put some load onthe database server, it is recommended to schedule this during off peak times so that there willbe minimal impact on performance.

    5. Click OKonce you have defined your schedule, and then Nextto go to the next page of thewizard.

    6. On the window that opens, you can define how often you wish to run the plan. In the scheduleabove, it has been configured to run every Sunday at midnight.

    7. Because rebuilding indexes will put some load on the database server, Compuwarerecommends to schedule this during off peak times to reduce impact on performance.

    8. Click OKonce you have defined your schedule, and then Next.The Select Maintenance Taskspage appears.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    11/16

    BSM SQL Server Database Performance Optimization Guide Page 11

    BSM SQL Server Database Performance Optimization Guide Page 11

    9. Select Rebuild Index, and then click Next.10. You are given the option of selecting the order in which to run the tasks. If you select more than

    one, select the desired order, and then press Next.The Define Rebuild Index Taskpage appears.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    12/16

    BSM SQL Server Database Performance Optimization Guide Page 12

    BSM SQL Server Database Performance Optimization Guide Page 12

    11. Select your BSM database from the list and accept the remaining defaults on the page.12. Click Next.

    The Select Report Optionspage appears.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    13/16

    BSM SQL Server Database Performance Optimization Guide Page 13

    BSM SQL Server Database Performance Optimization Guide Page 13

    13. Choose to write a report to a text file or sending to an email recipient. Click Nextonce you havemade the desired settings. The Complete the Wizardpage appears.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    14/16

    BSM SQL Server Database Performance Optimization Guide Page 14

    BSM SQL Server Database Performance Optimization Guide Page 14

    14. Review the summary, and then click Finish.The Maintenance Plan Wizard Progress page appears.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    15/16

    BSM SQL Server Database Performance Optimization Guide Page 15

    BSM SQL Server Database Performance Optimization Guide Page 15

    15.

    Your new maintenance task will show in the list of tasks. If you wish to run the taskimmediately, right-click the task and select Execute. Otherwise, the task will be run at thescheduled time.

  • 8/13/2019 BSM_SQLSvrPerfomanceOptimizationGuide

    16/16

    BSM SQL Server Database Performance Optimization Guide Page 16

    4 Determining Database PartitioningTo determine if your existing database is partitioned, execute the following SQL statement against yourdatabase:

    SELECT distinct TableName from PF_PS_RANGE_TABLE_FILEGROUPView;

    If the query produces a list of tables, the existing database is partitioned. If the query does not produceany results, the existing database is not partitioned.