Encryptdtutil Utility

适用对象:是SQL Server,包含 Linux 版 是Azure SQL 数据库 是Azure Synapse Analytics (SQL DW) 否并行数据仓库 APPLIES TO: yesSQL Server, including on Linux yesAzure SQL Database yesAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

dtutil 命令提示实用工具用于管理 SQL ServerSQL Server Integration ServicesIntegration Services 包。The dtutil command prompt utility is used to manage SQL ServerSQL Server Integration ServicesIntegration Services packages. 该实用工具可以复制、移动、删除包,也可以验证包是否存在。The utility can copy, move, delete, or verify the existence of a package. 可对存储于以下三个位置之一的任何 SSISSSIS 包执行上述操作: MicrosoftMicrosoft SQL ServerSQL Server 数据库、 SSISSSIS 包存储区和文件系统。These actions can be performed on any SSISSSIS package that is stored in one of three locations: a MicrosoftMicrosoft SQL ServerSQL Server database, the SSISSSIS Package Store, and the file system. 如果此实用工具要访问存储在 msdb中的包,命令提示符可能要求输入用户名和密码。If the utility accesses a package that is stored in msdb, the command prompt may require a user name and a password. 如果 SQL ServerSQL Server 实例使用 SQL ServerSQL Server 身份验证,则命令提示符要求输入用户名和密码。If the instance of SQL ServerSQL Server uses SQL ServerSQL Server Authentication, the command prompt requires both a user name and a password. 如果缺少用户名, dtutil 将尝试使用 Windows 身份验证登录到 SQL ServerSQL ServerIf the user name is missing, dtutil tries to log on to SQL ServerSQL Server using Windows Authentication. 包的存储类型由 /SQL/FILE/DTS 选项标识。The storage type of the package is identified by the /SQL, /FILE, and /DTS options.

dtutil 命令提示实用工具不支持使用命令文件或重定向。The dtutil command prompt utility does not support the use of command files or redirection.

dtutil 命令提示实用工具包含下列功能:The dtutil command prompt utility includes the following features:

  • 命令提示符中的注释,使命令提示符操作可自行记录且更易于理解。Remarks in the command prompt, which makes the command prompt action self-documenting and easier to understand.

  • 覆盖保护,用于复制或移动包时在覆盖现有的包之前提示确认。Overwrite protection, to prompt for a confirmation before overwriting an existing package when you are copying or moving packages.

  • 控制台帮助,用于提供有关 dtutil命令选项的信息。Console help, to provide information about the command options for dtutil.

备注

在您连接到 SQL Server Management StudioSQL Server Management Studio 实例时,也可以直观地在 Integration ServicesIntegration Services中执行由 dtutil 执行的许多操作。Many of the operations that are performed by dtutil can also be performed visually in SQL Server Management StudioSQL Server Management Studio when you are connected to an instance of Integration ServicesIntegration Services. 有关详细信息,请参阅包管理(SSIS 服务)For more information, see Package Management (SSIS Service).

这些选项的键入顺序不分先后。The options can be typed in any order. 竖线字符 ("|") 是 OR 运算符,用于显示可能的值。The pipe ("|") character is the OR operator and is used to show possible values. 您必须使用一个由 OR 竖线分隔的选项。You must use one of the options that are delimited by the OR pipe.

所有选项必须以斜杠 (/) 或减号 (-) 开头。All options must start with a slash (/) or a minus sign (-). 但是,斜杠或减号与选项的文本之间不能包含空格;否则,该命令将失败。However, do not include a space between the slash or minus sign and the text for the option; otherwise, the command will fail.

参数必须是用引号括起来的字符串,或是没有包含任何空格的字符串。Arguments must be strings that are either enclosed in quotation marks or contain no white space.

用引号引起来的字符串中的双引号表示转义的单引号。Double quotation marks within strings that are enclosed in quotation marks represent escaped single quotation marks.

除密码外,其他选项和参数都不区分大小写。Options and arguments, except for passwords, are not case sensitive.

64 位计算机上的安装注意事项Installation Considerations on 64-bit Computers

在 64 位计算机上, Integration ServicesIntegration Services 将安装 64 位版本的 dtexec 实用工具 (dtexec.exe) 和 dtutil 实用工具 (dtutil.exe)。On a 64-bit computer, Integration ServicesIntegration Services installs a 64-bit version of the dtexec utility (dtexec.exe) and the dtutil utility (dtutil.exe). 若要安装这些 Integration ServicesIntegration Services 工具的 32 位版本,必须在安装过程中选择“客户端工具”或 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT)To install 32-bit versions of these Integration ServicesIntegration Services tools, you must select either Client Tools or SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) during setup.

默认情况下,同时安装了 64 位和 32 位版本的 Integration ServicesIntegration Services 命令提示实用工具的 64 位计算机将在命令提示符处运行 32 位版本。By default, a 64-bit computer that has both the 64-bit and 32-bit versions of an Integration ServicesIntegration Services command prompt utility installed will run the 32-bit version at the command prompt. 运行 32 位版本的原因是:在 PATH 环境变量中,32 位版本的目录路径显示在 64 位版本的目录路径之前。The 32-bit version runs because the directory path for the 32-bit version appears in the PATH environment variable before the directory path for the 64-bit version. (通常,32 位目录路径是 <drive>:\Program Files(x86)\Microsoft SQL Server\130\DTS\Binn,而 64 位目录路径是 <drive>:\Program Files\Microsoft SQL Server\130\DTS\Binn。 )(Typically, the 32-bit directory path is <drive>:\Program Files(x86)\Microsoft SQL Server\130\DTS\Binn, while the 64-bit directory path is <drive>:\Program Files\Microsoft SQL Server\130\DTS\Binn.)

备注

如果使用 SQL Server 代理来运行此实用工具,则 SQL Server 代理会自动使用 64 位版本的实用工具。If you use SQL Server Agent to run the utility, SQL Server Agent automatically uses the 64-bit version of the utility. SQL Server 代理使用注册表(而非 PATH 环境变量)来找到此实用工具的正确可执行文件。SQL Server Agent uses the registry, not the PATH environment variable, to locate the correct executable for the utility.

若要确保在命令提示符处运行 64 位版本的实用工具,可以执行以下操作之一:To ensure that you run the 64-bit version of the utility at the command prompt, you can take one of the following actions:

  • 打开命令提示符窗口,更改为包含 64 位版本的实用工具的目录 (<drive>:\Program Files\Microsoft SQL Server\130\DTS\Binn),然后从该位置运行此实用工具 。Open a Command Prompt window, change to the directory that contains the 64-bit version of the utility (<drive>:\Program Files\Microsoft SQL Server\130\DTS\Binn), and then run the utility from that location.

  • 在命令提示符处,通过输入 64 位版本的实用工具的完整路径 (<drive>:\Program Files\Microsoft SQL Server\130\DTS\Binn) 来运行此实用工具 。At the command prompt, run the utility by entering the full path (<drive>:\Program Files\Microsoft SQL Server\130\DTS\Binn) to the 64-bit version of the utility.

  • 通过将 64 位路径 (<drive>:\Program Files\Microsoft SQL Server\130\DTS\Binn) 置于 32 位路径 (<drive>:\ Program Files(x86)\Microsoft SQL Server\130\DTS\Binn) 之前,可永久更改 PATH 环境变量中路径的顺序 。Permanently change the order of the paths in the PATH environment variable by placing the 64-bit path (<drive>:\Program Files\Microsoft SQL Server\130\DTS\Binn) before the 32-bit path (<drive>:\ Program Files(x86)\Microsoft SQL Server\130\DTS\Binn) in the variable.

语法Syntax

dtutil /option [value] [/option [value]]...  

ParametersParameters

选项Option 描述Description
/?/? 显示命令提示符选项。Displays the command prompt options.
/C[opy] location;destinationPathandPackageName /C[opy] location;destinationPathandPackageName 指定对 SSISSSIS 包的复制操作。Specifies a copy action on an SSISSSIS package. 使用此参数需要先使用 /FI/SQ/DT 选项指定包的位置。Use of this parameter requires that you first specify the location of the package using the /FI, /SQ, or /DT option. 然后指定目标位置和目标包名称。Next, specify the destination location destination package name. destinationPathandPackageName 参数指定 SSISSSIS 包的复制目标。The destinationPathandPackageName argument specifies where the SSISSSIS package is copied to. 如果目标 locationSQL,那么还必须在命令中指定 DestUserDestPasswordDestServer 参数。If the destination location is SQL, the DestUser, DestPassword and DestServer arguments must also be specified in the command.

如果 Copy 操作的目标处已经有一个包, dtutil 将提示用户确认是否删除该包。When the Copy action encounters an existing package at the destination, dtutil prompts the user to confirm package deletion. 回答 Y 将覆盖包,回答 N 将结束程序。The Y reply overwrites the package and the N reply ends the program. 如果该命令包含 Quiet 参数,则将不显示任何提示,并覆盖任何现有包。When the command includes the Quiet argument, no prompt appears and any existing package is overwritten.
/Dec[rypt] password /Dec[rypt] password (可选)。(Optional). 设置加载使用密码加密的包时所用的解密密码。Sets the decryption password that is used when you load a package with password encryption.
/Del[ete]/Del[ete] 删除由 SQLDTSFILE 选项指定的包。Deletes the package specified by the SQL, DTS or FILE option. 如果 dtutil 无法删除包,则程序将结束。If dtutil cannot delete the package, the program ends.
/DestP[assword] password /DestP[assword] password 指定与 SQL 选项一起使用的密码,用于连接到使用 SQL ServerSQL Server 身份验证的 SQL ServerSQL Server 目标实例。Specifies the password that is used with the SQL option to connect to a destination SQL ServerSQL Server instance using SQL ServerSQL Server Authentication. 如果在不包含 DESTPASSWORD 选项的命令行中指定 DTSUSER ,则将生成错误。An error is generated if DESTPASSWORD is specified in a command line that does not include the DTSUSER option.

请注意: 请尽可能使用 Windows 身份验证。When possible, use Windows authentication.Note: 请尽可能使用 Windows 身份验证。When possible, use Windows authentication..
/DestS[erver] server_instance /DestS[erver] server_instance 指定与任何导致目标被保存到 SQL ServerSQL Server的操作一起使用的服务器名称。Specifies the server name that is used with any action that causes a destination to be saved to SQL ServerSQL Server. 该选项用于在保存 SSISSSIS 包时,标识一个非本地或非默认的服务器。It is used to identify a non-local or non-default server when saving an SSISSSIS package. 在不包含与 SQL ServerSQL Server 关联的操作的命令行中指定 DESTSERVER 是错误的。It is an error to specify DESTSERVER in a command line that does not have an action associated with SQL ServerSQL Server. SIGN SQLCOPY SQLMOVE SQL 选项的相应命令都可与该选项结合使用。Actions such as SIGN SQL, COPY SQL, or MOVE SQL options would be appropriate commands to combine with this option.

通过在服务器名中添加反斜杠和实例名称,可以指定 SQL ServerSQL Server 实例名称。A SQL ServerSQL Server instance name can be specified by adding a backslash and the instance name to the server name.
/DestU[ser] username /DestU[ser] username 指定与 SIGN SQL 、COPY SQL 和 MOVE SQL 选项一起使用的用户名,以连接到使用 SQL ServerSQL Server 身份验证的 SQL ServerSQL Server 实例。Specifies the user name that is used with the SIGN SQL, COPY SQL, and MOVE SQL options to connect to a SQL ServerSQL Server instance that uses SQL ServerSQL Server Authentication. 在不包含 DESTUSERSIGN SQLCOPY SQL选项的命令行中指定 MOVE SQL 是错误的。It is an error to specify DESTUSER in a command line that does not include the SIGN SQL, COPY SQL, or MOVE SQL option.
/Dump process ID/Dump process ID (可选)使指定进程( dtexec 实用工具或 dtsDebugHost.exe 进程)暂停,并创建调试转储文件 .mdmp 和 .tmp。(Optional) Causes the specified process, either the dtexec utility or the dtsDebugHost.exe process, to pause and create the debug dump files, .mdmp and .tmp.

注意:若要使用“/Dump” 选项,必须分配有“调试程序”用户权限 (SeDebugPrivilege)。Note: To use the /Dumpoption, you must be assigned the Debug Programs user right (SeDebugPrivilege).

若要查找要暂停的进程的 process ID ,请使用 Windows 任务管理器。To find the process ID for the process that you want to pause, use Windows Task Manager.

默认情况下,Integration ServicesIntegration Services 将调试转储文件存储在 <drive>:\Program Files\Microsoft SQL Server\130\Shared\ErrorDumps 文件夹中 。By default, Integration ServicesIntegration Services stores the debug dump files in the folder, <drive>:\Program Files\Microsoft SQL Server\130\Shared\ErrorDumps.

有关 dtexec 实用工具和 dtsDebugHost.exe 进程的详细信息,请参阅 dtexec UtilityBuilding, Deploying, and Debugging Custom ObjectsFor more information about the dtexec utility and the dtsDebugHost.exe process, see dtexec Utility and Building, Deploying, and Debugging Custom Objects.

有关调试转储文件的详细信息,请参阅 Generating Dump Files for Package ExecutionFor more information about debug dump files, see Generating Dump Files for Package Execution.

注意:调试转储文件可能包含敏感信息。Note: Debug dump files may contain sensitive information. 使用访问控制列表 (ACL) 来限制对这些文件的访问,或将文件复制到具有受限访问权限的文件夹中。Use an access control list (ACL) to restrict access to the files, or copy the files to a folder with restricted access.
/DT[S] filespec /DT[S] filespec 指定要对其执行操作的 SSISSSIS 包位于 SSISSSIS 包存储区中。Specifies that the SSISSSIS package to be operated on is located in the SSISSSIS Package Store. filespec 参数必须包括以 SSISSSIS 包存储区的根开头的文件夹路径。The filespec argument must include the folder path, starting with the root of the SSISSSIS Package Store. 默认情况下,该配置文件中的根文件夹的名称为“MSDB”和“File System”。By default, the names of the root folders in the configuration file are "MSDB" and "File System." 必须使用双引号分隔包含空间的路径。Paths that contain a space must be delimited by using double quotation marks.

如果指定 DT[S] 选项的命令行中还有以下任一选项,则返回 DTEXEC_DTEXECERROR:If the DT[S] option is specified on the same command line as any of the following options, a DTEXEC_DTEXECERROR is returned:

FILEFILE

SQLSQL

SOURCEUSERSOURCEUSER

SOURCEPASSWORDSOURCEPASSWORD

SOURCESERVERSOURCESERVER
/En[crypt] {SQL | FILE}; Path;ProtectionLevel[;password] /En[crypt] {SQL | FILE}; Path;ProtectionLevel[;password] (可选)。(Optional). 使用指定的保护级别和密码对加载的包进行加密,并将其保存到 Path中指定的位置。Encrypts the loaded package with the specified protection level and password, and saves it to the location specified in Path. ProtectionLevel 确定是否需要密码。The ProtectionLevel determines whether a password is required.

SQL - Path 为目标包名称。SQL - Path is the destination package name.

FILE - Path 为包的完全限定路径和文件名。FILE - Path is the fully-qualified path and file name for the package.

DTS - 当前不支持该选项。DTS - This option is not supported currently.

ProtectionLevel 选项:ProtectionLevel options:

级别 0:提取敏感信息。Level 0: Strips sensitive information.

级别 1:使用本地用户凭据对敏感信息进行加密。Level 1: Sensitive information is encrypted by using local user credentials.

级别 2:使用必需的密码对敏感信息进行加密。Level 2: Sensitive information is encrypted by using the required password.

级别 3:使用必需的密码对包进行加密。Level 3: Package is encrypted by using the required password.

级别 4:使用本地用户凭据对包进行加密。Level 4: Package is encrypted by using local user credentials.

级别 5:包使用 SQL ServerSQL Server 存储加密。Level 5 Package uses SQL ServerSQL Server storage encryption.
/Ex[ists]/Ex[ists] (可选)。(Optional). 用于确定包是否存在。Used to determine whether a package exists. dtutil 尝试查找用 SQLDTSFILE 选项指定的包。dtutil tries to locate the package specified by either the SQL, DTS or FILE options. 如果 dtutil 找不到指定的包,则返回 DTEXEC_DTEXECERROR。If dtutil cannot locate the package specified, a DTEXEC_DTEXECERROR is returned.
/FC[reate] {SQL | DTS };ParentFolderPath;NewFolderName /FC[reate] {SQL | DTS};ParentFolderPath;NewFolderName (可选)。(Optional). 创建一个新文件夹,该文件夹的名称是在 NewFolderName中指定的。Create a new folder that has the name that you specified in NewFolderName. 新文件夹的位置由 ParentFolderPath指示。The location of the new folder is indicated by the ParentFolderPath.
/FDe[lete] {SQL | DTS }[;ParentFolderPath;FolderName] /FDe[lete] {SQL | DTS}[;ParentFolderPath;FolderName] (可选)。(Optional). SQL ServerSQL ServerSSISSSIS 中删除由 FolderName 中的名称指定的文件夹。Deletes from SQL ServerSQL Server or SSISSSIS the folder that was specified by the name in FolderName. 要删除的文件夹的位置由 ParentFolderPath指示。The location of the folder to delete is indicated by the ParentFolderPath.
/FDi[rectory] {SQL | DTS };FolderPath[;S] /FDi[rectory] {SQL | DTS};FolderPath[;S] (可选)。(Optional). 列出 SSISSSISSQL ServerSQL Server中的文件夹中的内容(文件夹和包)。Lists the contents, both folders and packages, in a folder on SSISSSIS or SQL ServerSQL Server. 可选参数 FolderPath 指定要查看其内容的文件夹。The optional FolderPath parameter specifies the folder that you want to view the content of. 可选参数 S 指定要查看 FolderPath中所指定文件夹的子文件夹的内容列表。The optional S parameter specifies that you want to view a listing of the contents of the subfolders for the folder specified in FolderPath.
/FE[xists ] {SQL | DTS };FolderPath /FE[xists ] {SQL | DTS};FolderPath (可选)。(Optional). 验证 SSISSSISSQL ServerSQL Server中是否存在指定的文件夹。Verifies if the specified folder exists on SSISSSIS or SQL ServerSQL Server. FolderPath 参数是要验证的文件夹的路径和名称。The FolderPath parameter is the path and name of the folder to verify.
/Fi[le] filespec /Fi[le] filespec 此选项指定要操作的 SSISSSIS 包位于文件系统中。This option specifies that the SSISSSIS package to be operated on is located in the file system. filespec 值可以是通用命名约定 (UNC) 路径或本地路径。The filespec value can be provided as either a Universal Naming Convention (UNC) path or local path.

如果指定 File 选项的命令行中还有以下任一选项,则返回 DTEXEC_DTEXECERROR:If the File option is specified on the same command line as any of the following options, a DTEXEC_DTEXECERROR is returned:

DTSDTS

SQLSQL

SOURCEUSERSOURCEUSER

SOURCEPASSWORDSOURCEPASSWORD

SOURCESERVERSOURCESERVER
/FR[ename] {SQL | DTS } [;ParentFolderPath; OldFolderName;NewFolderName] /FR[ename] {SQL | DTS} [;ParentFolderPath; OldFolderName;NewFolderName] (可选)。(Optional). 重命名 SSISSSISSQL ServerSQL Server中的文件夹。Renames a folder on the SSISSSIS or SQL ServerSQL Server. ParentFolderPath 是要重命名的文件夹的位置。The ParentFolderPath is the location of the folder to rename. OldFolderName 是文件夹的当前名称, NewFolderName 是要为文件夹提供的新名称。The OldFolderName is the current name of the folder, and NewFolderName is the new name to give the folder.
/H[elp] option /H[elp] option 显示详细的文本帮助,该帮助可以显示 dtutil 的各个选项并说明其用法。Displays text extensive help that shows the dtutil options and describes their use. 该选项参数是可选的。The option argument is optional. 如果包含该参数,则帮助文本将包含有关指定选项的详细信息。If the argument is included, the Help text includes detailed information about the specified option. 以下示例将显示所有选项的帮助:The following example displays help for all options:

dtutil /H

下列两个示例显示如何使用 /H 选项显示特定选项(本例中为 /Q [uiet] 选项)的详细帮助:The following two examples show how to use the /H option to display extended help for a specific option, the /Q [uiet] option, in this example:

dtutil /Help Quiet

dtutil /H Q
/I[DRegenerate]/I[DRegenerate] 为包创建新的 GUID 并更新包 ID 属性。Creates a new GUID for the package and updates the package ID property. 复制包后,包 ID 保持不变;因此,对于两个包,日志文件包含的 GUID 相同。When a package is copied, the package ID remains the same; therefore, the log files contain the same GUID for both packages. 该操作为新复制的包创建新的 GUID,以便将其与原始包区分开。This action creates a new GUID for the newly-copied package to distinguish it from the original.
/M[ove] {SQL | File | DTS }; pathandname /M[ove] {SQL | File | DTS}; pathandname 指定对 SSISSSIS 包的移动操作。Specifies a move action on an SSISSSIS package. 若要使用该参数,请先使用 /FI/SQ/DT 选项指定包的位置。To use this parameter, first specify the location of the package using the /FI, /SQ, or /DT option. 然后指定 Move 操作。Next, specify the Move action. 此操作需要两个由分号分隔的参数:This action requires two arguments, which are separated by a semicolon:

目标参数可指定 SQLFILEDTSThe destination argument can specify SQL, FILE, or DTS. SQL 目标可包含 DESTUSERDESTPASSWORDDESTSERVER 选项。A SQL destination can include the DESTUSER, DESTPASSWORD, and DESTSERVER options.

pathandname 参数指定包位置:SQL 使用包路径和包名称,FILE 使用 UNC 或本地路径,DTS 使用相对于 SSISSSIS 包存储区的根目录的位置。The pathandname argument specifies the package location: SQL uses the package path and package name, FILE uses a UNC or local path, and DTS uses a location that is relative to the root of the SSISSSIS Package Store. 如果目标为 FILEDTS,则路径参数将不包含文件名,When the destination is FILE or DTS, the path argument does not include the file name. 而使用指定位置的包名称作为文件名。Instead, it uses the package name at the specified location as the file name.



如果 MOVE 操作的目标处已经有一个包,则 dtutil 将提示你确认是否要覆盖这个包。When the MOVE action encounters an existing package at the destination, dtutil prompts you to confirm that you want to overwrite the package. 回答 Y 将覆盖包,回答 N 将结束程序。The Y reply overwrites the package and the N reply ends the program. 如果该命令包含 QUIET 选项,则将不显示任何提示,并覆盖任何现有包。When the command includes the QUIET option, no prompt appears and any existing package is overwritten.
/Q[uiet]/Q[uiet] 在执行包含 COPYMOVESIGN 选项的命令时,停止可能显示的确认提示。Stops the confirmation prompts that can appear when a command including the COPY, MOVE, or SIGN option is executed. 如果目标计算机中已经存在与指定包同名的包,或者如果已经对指定包进行了签名,则将显示这些提示。These prompts appear if a package with the same name as the specified package already exists at the destination computer or if the specified package is already signed.
/R[emark] text /R[emark] text 向命令行中添加注释。Adds a comment to the command line. 该注释参数是可选的。The comment argument is optional. 如果注释文本包含空格,则文本必须用引号引起来。If the comment text includes spaces, the text must be enclosed in quotation marks. 可以在一个命令行中包含多个 REM 选项。You can include multiple REM options in a command line.
/Si[gn] {SQL | File | DTS }; path ; hash /Si[gn] {SQL | File | DTS}; path; hash SSISSSIS 包进行签名。Signs an SSISSSIS package. 此操作使用三个由分号分隔的必要参数;destination、path 和 hash:This action uses three required arguments, which are separated by semicolons; destination, path, and hash:

目标参数可指定 SQLFILEDTSThe destination argument can specify SQL, FILE, or DTS. SQL 目标可包含 DESTUSERDESTPASSWORDDESTSERVER 选项。A SQL destination can include the DESTUSER, DESTPASSWORD and DESTSERVER options.

Path 参数指定要操作的包的位置。The path argument specifies the location of the package to take action on.

Hash 参数指定以长度可变的十六进制字符串表示的证书标识符。The hash argument specifies a certificate identifier expressed as a hexadecimal string of varying length.

有关详细信息,请参阅 使用数字签名标识包的源For more information, see Identify the Source of Packages with Digital Signatures.



** 重要提示 ** 在配置为检查包签名时, Integration ServicesIntegration Services 仅检查数字签名是否存在、是否有效以及是否来自可信来源。** Important ** When configured to check the signature of the package, Integration ServicesIntegration Services only checks whether the digital signature is present, is valid, and is from a trusted source. Integration ServicesIntegration Services 检查包是否已更改。does not check whether the package has been changed.
/SourceP[assword] password /SourceP[assword] password 指定与 SQLSOURCEUSER 选项一起使用的密码,以便可以对存储在 SSISSSIS 实例(使用 SQL ServerSQL Server 身份验证的 SQL ServerSQL Server 目标实例。Specifies the password that is used with the SQL and SOURCEUSER options to enable the retrieval of an SSISSSIS package that is stored in a database on a SQL ServerSQL Server instance that uses SQL ServerSQL Server Authentication. 在不包含 SOURCEUSER 选项的命令行中指定 SOURCEPASSWORD 是错误的。It is an error to specify SOURCEPASSWORD in a command line that does not include the SOURCEUSER option.

请注意:请尽可能使用 Windows 身份验证。When possible, use Windows authentication.Note: 请尽可能使用 Windows 身份验证。When possible, use Windows authentication.
/SourceS[erver] server_instance /SourceS[erver] server_instance 指定与 SQL 选项一起使用的服务器名称,以便可以检索存储在 SQL ServerSQL Server 中的 SSISSSISSpecifies the server name that is used with the SQL option to enable the retrieval of an SSISSSIS package that is stored in SQL ServerSQL Server. 在不包含 SOURCESERVERSIGN SQLCOPY SQLMOVE SQL 选项指定包的位置。It is an error to specify SOURCESERVER in a command line that does not include the SIGN SQL, COPY SQL, or MOVE SQL option.

通过在服务器名中添加反斜杠和实例名称,可以指定 SQL ServerSQL Server 实例名称。A SQL ServerSQL Server instance name can be specified by adding a backslash and the instance name to the server name.
/SourceU[ser] username /SourceU[ser] username 指定与 SOURCESERVER 选项一起使用的服务器名称,以便可以检索存储在 SSISSSIS 身份验证的 SQL ServerSQL Server 中的 SQL ServerSQL Server 目标实例。Specifies the user name that is used with the SOURCESERVER option to enable the retrieval of an SSISSSIS package stored in SQL ServerSQL Server using SQL ServerSQL Server Authentication. 在不包含 SOURCEUSERSIGN SQLCOPY SQL选项的命令行中指定 MOVE SQL 是错误的。It is an error to specify SOURCEUSER in a command line that does not include the SIGN SQL, COPY SQL, or MOVE SQL option.

请注意:请尽可能使用 Windows 身份验证。When possible, use Windows authentication.Note: 请尽可能使用 Windows 身份验证。When possible, use Windows authentication.
/SQ[L] package_path /SQ[L] package_path 指定 SSISSSIS 包的位置。Specifies the location of an SSISSSIS package. 该选项指示包存储在 msdb 数据库中。This option indicates that the package is stored in the msdb database. package_path 参数指定 SSISSSIS 包的路径和名称。The package_path argument specifies the path and name of the SSISSSIS package. 文件夹名以反斜杠结尾。Folder names are terminated with back slashes.

如果指定 SQL 选项的命令行中还有以下任一选项,则返回 DTEXEC_DTEXECERROR:If the SQL option is specified on the same command line as any of the following options, a DTEXEC_DTEXECERROR is returned:

DTSDTS

FILEFILE

SQL 选项可以不附带实例,也可以附带下列选项的某个实例:The SQL option may be accompanied by zero or one instance of the following options:

SOURCEUSERSOURCEUSER

SOURCEPASSWORDSOURCEPASSWORD

SOURCESERVERSOURCESERVER



如果不包含 SOURCEUSERNAME ,则使用 Windows 身份验证来访问包。If SOURCEUSERNAME is not included, Windows Authentication is used to access the package. 仅当存在SOURCEPASSWORD 时,才允许指定 SOURCEUSERSOURCEPASSWORD is allowed only if SOURCEUSER is present. 如果不包含 SOURCEPASSWORD ,则使用空密码。If SOURCEPASSWORD is not included, a blank password is used.

** 重要提示 ** 不要使用空密码。Do not use a blank password. 请使用强密码。Use a strong password.** Important ** 不要使用空密码。Do not use a blank password. 请使用强密码。Use a strong password.

dtutil 退出代码dtutil Exit Codes

如果检测到语法错误、使用了错误参数或指定了无效的选项组合,dtutil 将设置退出代码以向你发出警报。dtutil sets an exit code that alerts you when syntax errors are detected, incorrect arguments are used, or invalid combinations of options are specified. 否则,该实用工具将报告“操作已成功完成”。下表列出了 dtutil 实用工具在退出时可以设置的值。Otherwise, the utility reports "The operation completed successfully".The following table lists the values that the dtutil utility can set when exiting.

ReplTest1Value 描述Description
00 已成功执行此实用工具。The utility executed successfully.
11 此实用工具已失败。The utility failed.
44 此实用工具找不到请求的包。The utility cannot locate the requested package.
55 此实用工具无法加载请求的包。The utility cannot load the requested package
66 此实用工具无法解析命令行,因为它包含语法或语义错误。The utility cannot resolve the command line because it contains either syntactic or semantic errors.

RemarksRemarks

命令文件或重定向不能与 dtutil一起使用。You cannot use command files or redirection with dtutil.

命令行中选项的顺序不分先后。The order of the options within the command line is not significant.

示例Examples

以下示例详细说明了典型的命令行使用方法。The following examples detail typical command line usage scenarios.

复制示例Copy Examples

若要将存储在使用 Windows 身份验证的 本地实例中 msdb SQL ServerSQL Server 数据库的包复制到 SSIS 包存储区,可使用以下语法:To copy a package that is stored in the msdb database on a local instance of SQL ServerSQL Server using Windows Authentication to the SSIS Package Store, use the following syntax:

dtutil /SQL srcPackage /COPY DTS;destFolder\destPackage   

若要将包从文件系统中的某个位置复制到其他位置,并为副本提供一个不同的名称,可使用以下语法:To copy a package from a location on the File system to another location and give the copy a different name, use the following syntax:

dtutil /FILE c:\myPackages\mypackage.dtsx /COPY FILE;c:\myTestPackages\mynewpackage.dtsx  

若要将本地文件系统中的包复制到其他计算机上承载的 SQL ServerSQL Server 实例,可使用以下语法:To copy a package on the local file system to an instance of SQL ServerSQL Server hosted on another computer, use the following syntax:

dtutil /FILE c:\sourcepkg.dtsx /DestServer <servername> /COPY SQL;destpkgname  

由于未使用 /DestU[ser] 和 /DestP[assword] 选项,因此假定使用 Windows 身份验证。Because the /DestU[ser] and /DestP[assword] options were not used, Windows Authentication is assumed.

若要在复制某个包后为其创建新的 ID,可使用以下语法:To create a new ID for a package after it is copied, use the following syntax:

dtutil /I /FILE copiedpkg.dtsx   

若要为某特定文件夹中的所有包创建新的 ID,可使用以下语法:To create a new ID for all the packages in a specific folder, use the following syntax:

for %%f in (C:\test\SSISPackages\*.dtsx) do dtutil.exe /I /FILE %%f  

在命令提示符下键入命令时,使用一个百分号 (%)。Use a single percent sign (%) when typing the command at the command prompt. 如果在批处理文件内使用命令,则使用两个百分号 (%%)。Use a double percent sign (%%) if the command is used inside a batch file.

删除示例Delete Examples

若要删除存储在使用 Windows 身份验证的 实例中 msdb SQL ServerSQL Server 数据库中的包,可使用以下语法:To delete a package that is stored in the msdb database on an instance of SQL ServerSQL Server that uses Windows Authentication, use the following syntax:

dtutil /SQL delPackage /DELETE  

若要删除存储在使用 身份验证的 实例中 SQL ServerSQL Server msdb SQL ServerSQL Server 数据库中的包,可使用以下语法:To delete a package that is stored in the msdb database on an instance of SQL ServerSQL Server that uses SQL ServerSQL Server Authentication, use the following syntax:

dtutil /SQL delPackage /SOURCEUSER srcUserName /SOURCEPASSWORD #8nGs*w7F /DELETE  

备注

若要从命名服务器中删除包,可包含 SOURCESERVER 选项及其参数。To delete a package from a named server, include the SOURCESERVER option and its argument. 使用该 SQL 选项只能指定服务器。You can only specify a server by using the SQL option.

若要删除存储于 SSIS 包存储区中的包,可使用以下语法:To delete a package that is stored in the SSIS Package Store, use the following syntax:

dtutil /DTS delPackage.dtsx /DELETE  

若要删除存储在文件系统中的包,可使用以下语法:To delete a package that is stored in the file system, use the following syntax:

dtutil /FILE c:\delPackage.dtsx /DELETE  

存在示例Exists Examples

若要确定使用 Windows 身份验证的 本地实例中的 msdb SQL ServerSQL Server 数据库中是否存在包,可使用以下语法:To determine whether a package exists in the msdb database on a local instance of SQL ServerSQL Server that uses Windows Authentication, use the following syntax:

dtutil /SQL srcPackage /EXISTS  

若要确定使用 身份验证的 本地实例中的 SQL ServerSQL Server msdb SQL ServerSQL Server 数据库中是否存在包,可使用以下语法:To determine whether a package exists in the msdb database on a local instance of SQL ServerSQL Server that uses SQL ServerSQL Server Authentication, use the following syntax:

dtutil /SQL srcPackage /SOURCEUSER srcUserName /SOURCEPASSWORD *hY$d56b /EXISTS  

备注

若要确定命名服务器上是否存在包,可包含 SOURCESERVER 选项及其参数。To determine whether a package exists on a named server, include the SOURCESERVER option and its argument. 使用该 SQL 选项只能指定服务器。You can only specify a server by using the SQL option.

若要确定本地包存储区中是否存在包,可使用以下语法:To determine whether a package exists in the local package store, use the following syntax:

dtutil /DTS srcPackage.dtsx /EXISTS  

若要确定本地文件系统中是否存在包,可使用以下语法:To determine whether a package exists in the local file system, use the following syntax:

dtutil /FILE c:\srcPackage.dtsx /EXISTS  

移动示例Move Examples

若要将 SSIS 包存储区中存储的包移到使用 Windows 身份验证的 本地实例中的 msdb SQL ServerSQL Server 数据库,可使用以下语法:To move a package that is stored in the SSIS Package Store to the msdb database on a local instance of SQL ServerSQL Server that uses Windows Authentication, use the following syntax:

dtutil /DTS srcPackage.dtsx /MOVE SQL;destPackage  

若要将使用 身份验证的 本地实例中的 SQL ServerSQL Server msdb SQL ServerSQL Server 数据库中存储的包移到使用 身份验证的 的另一本地实例中的 SQL ServerSQL Server msdb SQL ServerSQL Server 数据库,可使用以下语法:To move a package that is stored in the msdb database on a local instance of SQL ServerSQL Server that uses SQL ServerSQL Server Authentication to the msdb database on another local instance of SQL ServerSQL Server that uses SQL ServerSQL Server Authentication, use the following syntax:

dtutil /SQL srcPackage /SOURCEUSER srcUserName /SOURCEPASSWORD $Hj45jhd@X /MOVE SQL;destPackage /DESTUSER destUserName /DESTPASSWORD !38dsFH@v  

备注

若要将一个命名服务器中的包移动到另一个命名服务器,可包含 SOURCESDESTS 选项及其参数。To move a package from one named server to another, include the SOURCES and the DESTS option and their arguments. 只能使用 SQL 选项指定服务器。You can only specify servers by using the SQL option.

若要移动存储在 SSIS 包存储区中的包,可使用以下语法:To move a package that is stored in the SSIS Package Store, use the following syntax:

dtutil /DTS srcPackage.dtsx /MOVE DTS;destPackage.dtsx  

若要移动存储在文件系统中的包,可使用以下语法:To move a package that is stored in the file system, use the following syntax:

dtutil /FILE c:\srcPackage.dtsx /MOVE FILE;c:\destPackage.dtsx  

签名示例Sign Examples

若要对存储在使用 Windows 身份验证的 SQL ServerSQL Server 本地实例中的 SQL ServerSQL Server 数据库中的包签名,可使用以下语法:To sign a package that is stored in a SQL ServerSQL Server database on a local instance of SQL ServerSQL Server that uses Windows Authentication, use the following syntax:

dtutil /FILE srcPackage.dtsx /SIGN FILE;destpkg.dtsx;1767832648918a9d989fdac9819873a91f919  

若要查找有关证书的信息,请使用 CertMgrTo locate information about your certificate, use CertMgr. CertMgr 实用工具中选择证书可查看哈希代码,然后单击“查看” 可查看属性。The hash code can be viewed in the CertMgr utility by selecting the certificate, and then clicking View to view the properties. “详细信息” 选项卡提供了有关证书的详细信息。The Details tab provides more information about the certificate. Thumbprint 属性在删除空格后被用作哈希值。The Thumbprint property is used as the hash value, with spaces removed.

备注

此示例中用到的哈希并不是真正的哈希。The hash used in this example is not a real hash.

有关详细信息,请参阅 使用 Authenticode 签名和检查代码中的 CertMgr 部分。For more information, see the CertMgr section in Signing and Checking Code with Authenticode.

加密示例Encrypt Examples

以下示例使用完全包加密和密码将基于文件的 PackageToEncrypt.dtsx 加密为基于文件的 EncryptedPackage.dts。The following sample encrypts the file-based PackageToEncrypt.dtsx to the file-based EncryptedPackage.dts using full package encryption, with a password. 加密所用的密码是 EncPswdThe password that is used for the encryption is EncPswd.

dtutil /FILE PackageToEncrypt.dtsx /ENCRYPT file;EncryptedPackage.dtsx;3;EncPswd  

另请参阅See Also

运行 Integration Services (SSIS) 包Run Integration Services (SSIS) Packages