인라인 작업이 포함된 XML 입력 파일 예제(DTA)XML Input File Sample with Inline Workload (DTA)

EventString 요소를 사용하여 작업을 지정하는 XML 입력 파일의 이 예제를 복사한 다음 자주 사용하는 XML 편집기나 텍스트 편집기에 붙여넣습니다.Copy and paste this sample of an XML input file that specifies a workload with the EventString element into your favorite XML editor or text editor. EventString 요소를 사용하면 별개의 작업 파일을 사용하는 대신에 XML 입력 파일에 Transact-SQLTransact-SQL 스크립트 작업을 지정할 수 있습니다.You can use the EventString element to specify a Transact-SQLTransact-SQL script workload in the XML input file instead of using a separate workload file. 이 예제를 편집 도구에 복사한 후에 Server, Database, Schema, Table, Workload, EventStringTuningOptions 요소에 지정된 값을 특정 튜닝 세션에 대한 값으로 바꿉니다.After copying this sample into your editing tool, replace the values specified for the Server, Database, Schema, Table, Workload, EventString, and TuningOptions elements with those for your specific tuning session. 이러한 요소에 사용할 수 있는 모든 특성 및 자식 요소에 대한 자세한 내용은 XML 입력 파일 참조(데이터베이스 엔진 튜닝 관리자)를 참조하세요.For more information about all of the attributes and child elements that you can use with these elements, see the XML Input File Reference (Database Engine Tuning Advisor). 다음 예에서는 사용 가능한 특성 및 자식 요소 옵션의 하위 집합만 사용합니다.The following sample uses only a subset of available attribute and child element options.

코드Code

<?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 multiple 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 Weight attributes shown with the following EventString elements are optional. -->
      <EventString Weight="100.01">
        SELECT * FROM MyTableName1 WHERE
        MyColumnName1 &gt; 200
        ORDER BY ColumnName1
      </EventString>
      <EventString Weight="10.02">
        SELECT * FROM MyTableName2 WHERE
        MyColumnName2 BETWEEN 2 AND 25000
        ORDER BY ColumnName2
      </EventString>
    </Workload>
    <TuningOptions>
      <TuningTimeInMin>120</TuningTimeInMin>
      <StorageBoundInMB>1500</StorageBoundInMB>
      <FeatureSet>IDX</FeatureSet>
      <Partitioning>NONE</Partitioning>
      <KeepExisting>NONE</KeepExisting>
      <OnlineIndexOperation>OFF</OnlineIndexOperation>
<!-- The following tuning option specifies the first database to which the Database Engine Tuning Advisor connects when tuning the workload. This element is optional. -->
      <DatabaseToConnect>MyDatabaseName</DatabaseToConnect>
    </TuningOptions>
  </DTAInput>
</DTAXML>
<?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 multiple 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 Weight attributes shown with the following EventString elements are optional. -->
      <EventString Weight="100.01">
        SELECT * FROM MyTableName1 WHERE
        MyColumnName1 &gt; 200
        ORDER BY ColumnName1
      </EventString>
      <EventString Weight="10.02">
        SELECT * FROM MyTableName2 WHERE
        MyColumnName2 BETWEEN 2 AND 25000
        ORDER BY ColumnName2
      </EventString>
    </Workload>
    <TuningOptions>
      <TuningTimeInMin>120</TuningTimeInMin>
      <StorageBoundInMB>1500</StorageBoundInMB>
      <FeatureSet>IDX</FeatureSet>
      <Partitioning>NONE</Partitioning>
      <KeepExisting>NONE</KeepExisting>
      <OnlineIndexOperation>OFF</OnlineIndexOperation>
<!-- The following tuning option specifies the first database to which the Database Engine Tuning Advisor connects when tuning the workload. This element is optional. -->
      <DatabaseToConnect>MyDatabaseName</DatabaseToConnect>
    </TuningOptions>
  </DTAInput>
</DTAXML>

설명Comments

USE database_name EventString 요소에 포함된 인라인 작업에서 문을 지정할 수 있습니다.USE database_name statements can be specified in the inline workload that is contained in the EventString element.

참고 항목See Also

데이터베이스 엔진 튜닝 관리자 시작 및 사용 Start and Use the Database Engine Tuning Advisor
데이터베이스 엔진 튜닝 관리자의 출력 보기 및 작업 View and Work with the Output from the Database Engine Tuning Advisor
XML 입력 파일 참조(데이터베이스 엔진 튜닝 관리자)XML Input File Reference (Database Engine Tuning Advisor)