DTA3:Reduce the Production Server Tuning Load

tuning recommendations 是DTA提供的优化建议。

引用MSDN:Reduce the Production Server Tuning Load

DTA relies on the query optimizer to analyze a workload and to make tuning recommendations. Performing this analysis on the production server adds to the server load and can hurt server performance during the tuning session. You can reduce the impact to the server load during a tuning session by using a test server in addition to the production server.

How DTA Uses a Test Server

The traditional way to use a test server is to copy all of the data from your production server to your test server, tune the test server, and then implement the recommendation on your production server. This process eliminates the performance impact on your production server, but nevertheless is not the optimal solution.

For example, copying large amounts of data from the production to the test server can consume substantial amounts of time and resources. In addition, test server hardware is seldom as powerful as the hardware that is deployed for production servers. The tuning process relies on the query optimizer, and the recommendations it generates are based in part on the underlying hardware. If the test and production server hardware are not identical, the Database Engine Tuning Advisor recommendation quality is diminished.

To avoid these problems, Database Engine Tuning Advisor tunes a database on a production server by offloading most of the tuning load onto a test server. It does this by using the production server hardware configuration information and without actually copying the data from the production server to the test server. Database Engine Tuning Advisor does not copy actual data from the production server to the test server. It only copies the metadata and necessary statistics.

The following steps outline the process for tuning a production database on a test server:

  1. Make sure that the user who wants to use the test server exists on both servers.

    Before you start, make sure that the user who wants to use the test server to tune a database on the production server exists on both servers. This requires that you create the user and his or her login on the test server. If you are a member of the sysadmin fixed server role on both computers, this step is not necessary.

  2. Tune the workload on the test server.

    To tune a workload on a test server, you must use an XML input file with the dta command-line utility. In the XML input file, specify the name of your test server with the TestServer subelement in addition to specifying the values for the other subelements under the TuningOptions parent element.

    During the tuning process, Database Engine Tuning Advisor creates a shell database on the test server. To create this shell database and tune it, Database Engine Tuning Advisor makes calls to the production server for the following:

    1. Database Engine Tuning Advisor imports metadata from the production database to the test server shell database. This metadata includes empty tables, indexes, views, stored procedures, triggers, and so on. This makes it possible for the workload queries to execute against the test server shell database.
    2. Database Engine Tuning Advisor imports statistics from the production server so the query optimizer can accurately optimize queries on the test server.
    3. Database Engine Tuning Advisor imports hardware parameters specifying the number of processors and available memory from the production server to provide the query optimizer with the information it needs to generate a query plan.
  3. After Database Engine Tuning Advisor finishes tuning the test server shell database, it generates a tuning recommendation.
  4. Apply the recommendation received from tuning the test server to the production server.

The following illustration shows the test server and production server scenario:

Note:The test server tuning feature is not supported in the Database Engine Tuning Advisor graphical user interface (GUI).

Example

First, make sure that the user who wants to perform the tuning exists on both the test and production servers.

After the user information is copied over to your test server, you can define your test server tuning session in the Database Engine Tuning Advisor XML input file. The following example XML input file illustrates how to specify a test server to tune a database with Database Engine Tuning Advisor.

In this example, the MyDatabaseName database is being tuned on MyServerName. The Transact-SQL script, MyWorkloadScript.sql, is used as the workload. This workload contains events that execute against MyDatabaseName. Most of the query optimizer calls to this database, which occur as part of the tuning process, are handled by the shell database that resides on MyTestServerName. The shell database is composed of metadata and statistics. This process results in the tuning overhead being offloaded to the test server. When Database Engine Tuning Advisor generates its tuning recommendation using this XML input file, it should consider indexes only (<FeatureSet>IDX</FeatureSet>), no partitioning, and need not keep any of the existing physical design structures in MyDatabaseName.

<?xml version="1.0" encoding="utf-16" ?>
<DTAXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/dta">
  <DTAInput>
    <Server>
      <Name>MyServerName</Name>
      <Database>
        <Name>MyDatabaseName</Name>
      </Database>
    </Server>
    <Workload>
      <File>MyWorkloadScript.sql</File>
    </Workload>
    <TuningOptions>
      <TestServer>MyTestServerName</TestServer>
      <FeatureSet>IDX</FeatureSet>
      <Partitioning>NONE</Partitioning>
      <KeepExisting>NONE</KeepExisting>
    </TuningOptions>
  </DTAInput>
</DTAXML>

推荐阅读:Considerations for Using Test Servers

时间: 2024-10-13 14:21:44

DTA3:Reduce the Production Server Tuning Load的相关文章

翻译:《Pro SQL Server Internals, 2nd edition》CHAPTER 7 Designing and Tuning the Indexes

文章选自:<Pro SQL Server Internals, 2nd edition>CHAPTER 7 Designing and Tuning the Indexes中的Clustered Index Design Considerations一节 作者:Dmitri Korotkevitch Clustered Index Design Considerations 聚集索引设计注意事项 每次更改集群索引键的值时,都会发生两件事.首先,SQL Server移动行到群集索引页链和数据文件

修改mysql端口后重启mysql报错:Can&#39;t start server: Bind on TCP/IP port. Got error...n denied

1:错误信息:如下 [[email protected] ~]# systemctl status mariadb ● mariadb.service - MariaDB 10.2.30 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Drop-In: /etc/systemd/system/mariadb.service.d └─

烂泥:KVM安装Windows Server 2008 R2使用virtio硬盘

本文首发于烂泥行天下. 在上一篇文章中,我们介绍了使用IDE硬盘来安装Windows Server 2008 R2,这篇文章我们来介绍使用virtio硬盘来安装Windows Server 2008 R2. 说明:KVM默认使用的硬盘格式为virtio. 使用virtio接口的硬盘,我们必须加载virtio硬盘驱动.如果不加载该驱动windows installer会无法找到虚拟磁盘,如下图: 现在安装虚拟机的安装步骤,首先创建虚拟机的硬盘,使用如下命令: qemu-img create -f

postgreSQL远程连接出现:Error connecting to server :致命错误 SSL关闭的pg_hba.conf记录

异常截图: 解决方案: [[email protected] ~]# vi /var/lib/pgsql/data/pg_hba.conf # TYPE DATABASE USER CIDR-ADDRESS METHOD # "local" is for Unix domain socket connections only local all all ident # IPv4 local connections: host all all 127.0.0.1/32 ident hos

oracle dg 报错: ORA-16057: DGID from server not in Data Guard configuration

搭建完DG,发现备库没有接受到主库的日志. 在主库执行 Select dest_id,status,error from v$archive_dest where dest_id=3; 报:  ORA-16057: DGID from server not in Data Guard configuration 错误的意思很明显,log_archive_config 没有配置 但是我在已经主库配置了 alter system set log_archive_config = 'dg_config

Android:百度定位异常Couldn&#39;t load locSDK4d from loader dalvik.system.PathClassLoader

Android Studio项目,使用百度定位时出现异常: Couldn't load locSDK4d from loader dalvik.system.PathClassLoader....findLibrary returned null 从网上找过解决方案,许多人说将 armeabi 下的 locSDK4d.so 复制一份到 armeabi-v7a下,可是我这么做之后问题依然存在. 后来找到的的有效的解决方案是,在项目的build.gradle下,在android标签内添加如下内容:

MYSQL登录错误:mysqladmin: connect to server at &#39;localhost&#39; failed

一.mysql登录错误mysqladmin: connect to server at 'localhost' failederror: 'Access denied for user 'root'@'localhost' (using password: YES)'无法修改密码用 service mysqld stopmysqld_safe --skip-grant-tables &输入 mysql -uroot -p 回车进入>use mysql;> update user set

Images and assets not working in production server

Here are a few problems that you might be having: 1 - Your production configuration may not be correct. This is particularly likely if you started out with an early 3.1 release candidate, and have been updating along the way. The suggested options fo

Python一个有意思的地方:reduce、map、filter

今天阅读了关于Python函数式编程的系列文章,地址在这里: http://www.cnblogs.com/huxi/archive/2011/06/24/2089358.html 里面提到了四个内建迭代函数:reduce.map.filter.zip.其中zip是供同时迭代多个迭代器用的,这里就不讨论了.主要讨论剩下的三个. 我发现一个有意思的事情,就是剩下的三个函数,reduce.map和filter,三者可以相互转换.例如以reduce为基础,可以实现map和filter函数如下: 1 d