简体   繁体   English

SSIS间歇性变量错误:系统找不到指定的文件

[英]SSIS Intermittent variable error: The system cannot find the file specified

Our SSIS pacakges a structured as one Control package and many child packages (about 30) that are invoked from the control package. 我们的SSIS包含一个结构化的一个Control包和许多从控件包调用的子包(大约30个)。 The child packages are invoked with Execute Package Task. 使用“执行包任务”调用子包。 There is one Execute Package Task per child package. 每个子包有一个执行包任务。 Each Execute Package Task uses File Connection Manager to specify path to the child package dtsx file. 每个执行包任务使用文件连接管理器指定子包dtsx文件的路径。 There is one File Connection Manager per child package. 每个子包有一个文件连接管理器。 Each File Connection Manager has an expression defined for ConnectionString property. 每个文件连接管理器都有一个为ConnectionString属性定义的表达式。 This expression looks like this: 这个表达式如下所示:

@[Template::FolderPackages]+"MyPackage.dtsx" 

The file name is different for each package. 每个包的文件名都不同。 The variable (FolderPackages) is specified in the SSIS package configuration file. 变量(FolderPackages)在SSIS包配置文件中指定。

The error that is generated during run time is 运行时生成的错误是

Error 0x80070002 while loading package file "MyPackage.dtsx" 加载包文件“MyPackage.dtsx”时出错0x80070002

The system cannot find the file specified." The package that fails is different from run to run and sometimes no packages fail at all. This is when run on exactly the same environment/data etc. 系统找不到指定的文件。“失败的包不同于运行,有时根本没有包失败。这是在完全相同的环境/数据等运行时。

I ran FileMon during this error and found out that when the error happens SSIS tries to read the dtsx file from a wrong place, namely from system32. 我在此错误期间运行FileMon并发现错误发生时SSIS尝试从错误的位置读取dtsx文件,即从system32读取。 I checked that this is identical to what would happen if @[Template::FolderPackages] variable were empty, but because the very same variable is used for every child package and works for some but doesn't work sometimes for others, I have no expalnation to this fact. 我检查过这与@ [Template :: FolderPackages]变量为空时会发生的情况相同,但因为每个子包都使用相同的变量并且对某些子包有效但有时对其他包不起作用,我没有对这个事实的谴责。

Anything obvious, or time to raise a support call with Microsoft? 有什么明显的,或者是时候向微软提出支持电话了?

Are you using Expressions on the SSIS variables directly? 您是否直接在SSIS变量上使用表达式? Variables with Expressions are calculated each time the variable is referenced by the consuming object which needs to use it. 每次变量被需要使用它的消费对象引用时,计算带有表达式的变量。 That is where the race condition bug exists, because sometimes the expression doesn't get evaluated if another thread is already evaluating a different variable, and the default value for the variable is provided to the consumer object. 这就是竞争条件错误存在的地方,因为如果另一个线程已经在评估另一个变量,则有时表达式不会被评估,并且该变量的默认值将提供给使用者对象。

If that matches your design, these two bugs on the connect site discuss the problem, and the workarounds: 如果这符合您的设计,连接站点上的这两个错误将讨论问题和解决方法:

https://connect.microsoft.com/SQLServer/feedback/details/332372/ssis-variable-expressions-dont-always-evaluate https://connect.microsoft.com/SQLServer/feedback/details/332372/ssis-variable-expressions-dont-always-evaluate

A second one at connect.microsoft.com/SQLServer/feedback/details/406534/ssis-2008-variable-expressions-dont-always-evaluate 第二个在connect.microsoft.com/SQLServer/feedback/details/406534/ssis-2008-variable-expressions-dont-always-evaluate

A summary of workarounds is { - Note the parallel tasks that could run in you SSIS control flow and utilize these expression variables. 变通方法的摘要是{ - 注意可以在您的SSIS控制流中运行的并行任务并利用这些表达式变量。 If you have two tasks side-by-side if each relies upon the same variable, and that variable has an Expression to set its value, then you could hit this. 如果你有两个并排的任务,如果每个任务依赖于同一个变量,并且该变量有一个Expression来设置它的值,那么你可以点击它。 Manually sequentialize such tasks, so that they don't run in parallel. 手动序列化此类任务,以便它们不会并行运行。 Ie. IE浏览器。 Add a green arrow on the control flow, so that the tasks occur in order Task1, Task2, Task3, rather than side-by-side on parallel paths and rather than inside the same container with no paths. 在控制流上添加绿色箭头,以便任务按顺序发生在Task1,Task2,Task3中,而不是并行路径上并排,而不是在没有路径的同一容器内。

  • You could avoid variable expressions: Assigning local variables in the required order using a home-made script task that does the same kind of work, so that variables are not evaluated using expressions (ie. the thing which can hit this race condition). 您可以避免使用变量表达式:使用执行相同类型工作的自制脚本任务以所需顺序分配局部变量,以便不使用表达式(即可以达到此竞争条件的事物)评估变量。 In other words, manually assign the variable values at a point in time in your control flow just before they are used. 换句话说,在使用之前,在控制流中的某个时间点手动分配变量值。 The point of using expressions on variables is to dynamically set a value based on another value whenever it is used, so this acheives a similar design goal but in a manual way. 在变量上使用表达式的关键是在使用时根据另一个值动态设置一个值,因此这会以手动方式实现类似的设计目标。

  • Reduce threads to minimize potential: Setting the Dataflow task EngineThreads to 1 and MaxConcurrentExecutables to 1. This will help sequentalize execution of your package to one task at a time, but that has the side effect which may cause slower performance. 减少线程以最小化潜力:将Dataflow任务EngineThreads设置为1,将MaxConcurrentExecutables设置为1.这将有助于将程序包的执行一次分离到一个任务,但这会产生可能导致性能降低的副作用。

  • Create and set values on distinct copies of variables at different scope levels in the design, so that they evaluate in different parallel execution scopes and avoid the expression evaluation on parallel threads. 在设计中的不同范围级别的变量的不同副本上创建和设置值,以便它们在不同的并行执行范围内进行评估,并避免在并行线程上进行表达式求值。 Master::Var1, Child1::Var1, Child2::Var1 Master :: Var1,Child1 :: Var1,Child2 :: Var1

} }

有一个知识库文章与此问题有关: http//support.microsoft.com/kb/2448991 ,其中说明了修复的时间和地点。

A bit of a stab in the dark but... 在黑暗中有点刺伤但......

I've had a similar issue with variables where readonly=false and multiple components were reading the variable at the same time and causing locking issues. 我有一个类似的变量问题,其中readonly = false,多个组件同时读取变量并导致锁定问题。

I consistently recreated the problem by running a pair of dataflows that did nothing but reference the variable inside a for loop container and changed the variable to be read only and this resolved the problem. 我一直通过运行一对数据流来重新创建问题,这些数据流除了在for循环容器中引用变量之外什么也没做,并且将变量更改为只读,这解决了问题。

If you temporarily hardcode the package name does this resolve the issue? 如果您暂时硬编码包名称,这是否可以解决问题?

Turns out after sending trace info to Microsoft that we are encountering heap corruption. 在向Microsoft发送跟踪信息后我们遇到了堆损坏。 I'll update this question if we get to the bottom of it. 如果我们深究这个问题,我会更新这个问题。 The current suggestion is to disable heap lookaside for dtexec.exe. 目前的建议是禁用dtexec.exe的堆lookaside。

The official answer to this issue is that it is a bug in SQL 2005 and 2008. Many tasks accessing the same variable cause a race condition, and some tasks get the default value for the expression instead of the evaluated value. 这个问题的官方答案是它是SQL 2005和2008中的一个错误。访问同一个变量的许多任务都会导致竞争条件,而某些任务会获得表达式的默认值而不是评估值。

The workaround is to ensure that the default value (the value defined in the property sheet for whatever property you are having trouble with) should be the value that will work in your production environment. 解决方法是确保默认值(在属性表中为您遇到问题的任何属性定义的值)应该是在生产环境中起作用的值。

This way, when the race condition happens in prod, SSIS will fall back to the package value, which will still work. 这样,当竞争条件发生时,SSIS将回退到包值,这仍然有效。

In dev? 在开发? Well you're just going to have to deal with that manually until we get a bug fix from Microsoft. 那么你只需要手动处理它,直到我们从微软获得错误修复。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 文件的目录查找失败,出现操作系统错误 3(系统找不到指定的路径。) - Directory lookup for the file failed with the operating system error 3 (The system cannot find the path specified.) .mdf”失败,出现操作系统错误 2(系统找不到指定的文件。) - .mdf" failed with the operating system error 2(The system cannot find the file specified.) 可能的原因java.io.IOException:CreateProcess错误= 2,系统找不到指定的文件 - Possible cause java.io.IOException: CreateProcess error=2, The system cannot find the file specified SQL 服务器数据库附加错误。 该系统找不到指定的文件 - SQL Server Database Attach error. The system cannot find the file specified '/'应用程序中的服务器错误:系统找不到免费 web 托管中指定的文件 - Server Error in '/' Application: The system cannot find the file specified in free web hosting 消息 5123,级别 16,状态 1,第 8 行 CREATE FILE 语句遇到操作系统错误 2(系统找不到指定的文件。) - Msg 5123, Level 16, State 1, Line 8 The CREATE FILE statement encountered operating system error 2 (The system cannot find the specified file.) 系统找不到 Free ASP hosting 中指定的文件 - The system cannot find the file specified in Free ASP hosting 从一个数据库插入到另一个“系统找不到指定的文件” - Insert from one DB to another "The system cannot find the file specified" ORA-22288:文件或LOB操作FILEOPEN失败系统找不到指定的路径 - ORA-22288: file or LOB operation FILEOPEN failed The system cannot find the path specified 间歇性错误“指定的登录不存在” - Intermittent error “a specified logon does not exist”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM