为什么在dtexec上运行良好的包无法在SQL Server代理作业下运行?

Yul*_*a V 10 ssis

我在本地C:驱动器上有一个包,如果我将它作为SQL代理作业的一部分运行,它会失败:

02/20/2013 17:38:45,MyUpload,Error,3,FMF-S3-1507\EOS01,PAM_MyUpload,Run MyUpload SSIS Package,,
Executed as user: MARKETS\SVCSQLDEV. 
Microsoft (R) SQL Server Execute Package Utility  Version 10.0.5500.0 for 64-bit  
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.    
Started:  17:38:45  Error: 2013-02-20 17:38:45.72     
Code: 0xC0011007     
Source: {14BE11F5-B737-4A6E-96E6-111635631749}      
Description: Unable to load the package as XML because of package does not have a valid XML format. A specific XML parser error will be posted.  End Error  
Error: 2013-02-20 17:38:45.72     
Code: 0xC0011002     
Source: {14BE11F5-B737-4A6E-96E6-111635631749}      
Description: Failed to open package file "C:\MyFolder\Package.dtsx" due to error 0x80070003 "The system cannot find the path specified.".  This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.  End Error  
Could not load package "C:\MyFolder\Package.dtsx" because of error 0xC0011002.  
Description: Failed to open package file "C:\MyFolder\Package.dtsx" due to error 0x80070003 "The system cannot find the path specified.".  This happens when loading a package and the file cannot be opened or loaded correctly into the XML document. This can be the result of either providing an incorrect file name was specified when calling LoadPackage or the XML file was specified and has an incorrect format.  
Source: {14BE11F5-B737-4A6E-96E6-111635631749}  
Started:  17:38:45  
Finished: 17:38:45  
Elapsed:  0.047 seconds.  
The package could not be found.  The step failed.
,00:00:00,0,0,,,,0
Run Code Online (Sandbox Code Playgroud)

但是,如果我从SQL代理作业步骤复制命令行并运行它DTExec.exe,则成功:

C:\Program Files\Microsoft SQL Server\100\DTS\Binn>DTExec.exe /FILE "C:\MyFolder\Package.dtsx"  /CHECKPOINTING OFF /REPORTING E
Microsoft (R) SQL Server Execute Package Utility
Version 10.50.1600.1 for 32-bit
Copyright (C) Microsoft Corporation 2010. All rights reserved.

Started:  17:44:00
DTExec: The package execution returned DTSER_SUCCESS (0).
Started:  17:44:00
Finished: 17:44:56
Elapsed:  55.266 seconds
Run Code Online (Sandbox Code Playgroud)

我可以尝试在工作步骤中修复它吗?commandhell类型的jobtep是正确的前进方式吗?

bil*_*nkc 10

我相信你有权限问题.如果你查看你发布的日志,Failed to open package file "C:\MyFolder\Package.dtsx" due to error 0x80070003 "The system cannot find the path specified."

这是什么意思?

运行SQL代理的帐户无权访问C:\ MyFolder.

解析度

您可能需要将文件系统授予该帐户.或者,您可以创建授权凭据并更改作业步骤以使用该帐户.

  • 另一个解决方案 - 我最终选择的是 - 在服务器上上传我的`*.dtsx`.在SSMS中:打开`Object Explorer`,`Connect` - >`Integration Services`,`Stored Packages` - >`MSDB`,右键单击,`Import package`,location --`File system`,选择路径和名称,保护级别:`依靠服务器存储`. (5认同)