简单 XML 输入文件示例 (DTA)

将用于优化工作负荷的这一简单 XML 输入文件示例复制并粘贴到您喜爱的 XML 编辑器或文本编辑器中。然后使用为特定的优化会话指定的值,替代为服务器数据库架构工作负荷以及优化选项元素指定的值。有关这些属性以及可与这些元素配合使用的子元素的详细信息,请参阅 XML 输入文件引用(数据库引擎优化顾问)。下面的示例只使用了部分可用属性和子元素选项。

代码

<?xml version="1.0" encoding="utf-16" ?>
<DTAXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://schemas.microsoft.com/sqlserver/2004/07/dta">
  <DTAInput>
    <Server>
      <Name>MyServerName</Name>
<!-- To tune multiplate databases, list them and their associated tables in the following section. -->
      <Database>
        <Name>MyDatabaseName</Name>
        <Schema>
          <Name>MyDatabaseSchemaName</Name>
<!-- You can list as many tables as necessary in the following section. -->
          <Table>
            <Name>MyTableName1</Name>
          </Table>
          <Table>
            <Name>MyTableName2</Name>
          </Table>
        </Schema>
      </Database>
    </Server>
    <Workload>
<!-- The following element specifies a workload file, which can be a trace file or a Transact-SQL script file. -->
      <File>c:\PathToYourWorkloadFile</File>
    </Workload>
    <TuningOptions>
      <TuningTimeInMin>60</TuningTimeInMin>
      <FeatureSet>IDX_IV</FeatureSet>
      <Partitioning>NONE</Partitioning>
      <KeepExisting>NONE</KeepExisting>
      <OnlineIndexOperation>OFF</OnlineIndexOperation>
    </TuningOptions>
  </DTAInput>
</DTAXML>