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

适用于:SQL Server

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

代码

<?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>
<!-- 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>

另请参阅

启动并使用数据库引擎优化顾问
XML 输入文件引用(数据库引擎优化顾问)