Encryptdtutil Utility

適用範圍:Applies to: 是SQL ServerSQL Server (所有支援的版本) yesSQL ServerSQL Server (all supported versions) 是 Azure Data Factory 中的 SSIS 整合執行階段SSIS Integration Runtime in Azure Data Factoryyes Azure Data Factory 中的 SSIS 整合執行階段SSIS Integration Runtime in Azure Data Factory適用範圍:Applies to: 是SQL ServerSQL Server (所有支援的版本) yesSQL ServerSQL Server (all supported versions) 是 Azure Data Factory 中的 SSIS 整合執行階段SSIS Integration Runtime in Azure Data Factoryyes Azure Data Factory 中的 SSIS 整合執行階段SSIS Integration Runtime in Azure Data Factory

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). 若要安裝 32 位元版本的這些 Integration ServicesIntegration Services 工具,您必須在安裝期間選取用戶端工具或 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 位元版本是因為 32 位元版本的目錄路徑在 PATH 環境變數中會出現在 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 Agent 執行此公用程式,SQL Server Agent 會自動使用 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 Agent 會使用此登錄 (而不是 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.

  • 在 PATH 環境變數中將 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]]...  

參數Parameters

選項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. 在不含與 相關聯動作的命令列上指定 DESTSERVER SQL ServerSQL Server是錯的。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 SQLCOPY SQLMOVE 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 處理序識別碼/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 Execution>。For 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 - 路徑是目的地封裝名稱。SQL - Path is the destination package name.

FILE - 路徑是指封裝的完整路徑和檔案名稱。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] 選項/H[elp] option 顯示文字擴充說明來示範 dtutil 選項及描述其用法。Displays text extensive help that shows the dtutil options and describes their use. option 引數是選擇性的。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 及更新封裝識別碼屬性。Creates a new GUID for the package and updates the package ID property. 複製封裝時,封裝識別碼保持不變;因此,記錄檔包含兩個封裝相同的 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. 這個動作需要使用三個以分號分隔的引數 (目的地、路徑及雜湊):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.

如需詳細資訊,請參閱 Identify the Source of Packages with Digital Signatures(使用數位簽章識別封裝來源)。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 選項一起使用的伺服器名稱,以擷取 SSISSSIS 中所儲存之 SQL ServerSQL ServerSpecifies 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. 在不含 SIGN SQLCOPY SQLMOVE SQL 選項的命令列上指定 SOURCESERVER 是一項錯誤。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.

Value 描述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.

備註Remarks

您無法搭配 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.

若要在複製封裝之後建立封裝的新識別碼,請使用下列語法:To create a new ID for a package after it is copied, use the following syntax:

dtutil /I /FILE copiedpkg.dtsx   

若要為特定資料夾的所有封裝建立新的識別碼,請使用下列語法: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.

如需詳細資訊,請參閱< Signing and Checking Code with 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