说明:组件 "MyDataFlowOLEDBSourceComponent" (10250) 预执行阶段失败并返回错误代码 0xC0202009

Description: component "MyDataFlowOLEDBSourceComponent" (10250) failed the pre-execute phase and returned error code 0xC0202009

我有一个 SSIS 包,运行 几个月每天都没有问题。突然间,它每天都因上述错误而失败。没有对包或它的存储过程进行任何更改运行,据我所知,没有对数据库环境进行任何更改,包括拥有该作业的服务帐户的权限。

这是一个 SQL Server 2008 包,连接到 SQL Server 2008 R2 数据库。配置是通过 ssisconfig table 并通过环境变量定义要使用的服务器。

有问题的组件正在使用存储过程。在 proc 中,所有字段都显式转换为 table 数据的相同数据类型。 proc 运行 本身没问题。这是一个相对复杂的过程,有两个 table 变量和一个 CTE。

我不能 运行 从我本地的产品和开发中获取它并没有失败。如果我在设置为作业所有者使用的环境变量时打开 prod SSIS 包,我不会在该组件上收到验证错误。此组件的 ValidateExternalMetadata 设置为 true。但是对于整个包,延迟验证设置为 True。我确实收到了一个验证错误,该错误在使用在较早任务中动态设置的变量的任务中是预期的。但是,此错误比当前失败的步骤晚了很多很多步骤。

通常在过去,当我们遇到这种非特定错误时,我很容易就能看出导致突然失败的数据问题。但是 proc 结果集中的 none 数据甚至接近于为该字段的暂存 table 定义的数据类型不正确。 None 个必填字段也缺少数据。

我不知道还能看什么。如果环境没有改变,实际代码没有改变,数据看起来是正确的,还有什么可以尝试的?

正如我评论的详细错误,您可以尝试以下 link 来自微软的:

Debug SSIS Package while calling from Agent

来自link的一些信息:

Reasons that the package may have failed are as follows:

  • The user account that is used to run the package under SQL Server Agent differs from the original package author.

  • The user account does not have the required permissions to make connections or to access resources outside the SSIS package.

The package may not run in the following scenarios:

  • The current user cannot decrypt secrets from the package. This scenario can occur if the current account or the execution account
    differs from the original package author, and the package's
    ProtectionLevel property setting does not let the current user
    decrypt secrets in the package.

  • A SQL Server connection that uses integrated security fails because the current user does not have the required permissions.

  • File access fails because the current user does not have the required permissions to write to the file share that the connection manager accesses. For example, this scenario can occur with text log providers that do not use a login and a password. This scenario can also occur with any task that depends on the file connection manager, such as a SSIS file system task.

  • A registry-based SSIS package configuration uses the HKEY_CURRENT_USER registry keys. The HKEY_CURRENT_USER registry keys
    are user-specific. A task or a connection manager requires that the current user account has correct permissions.

Method 1: Use a SQL Server Agent proxy account Create a SQL Server Agent proxy account. This proxy account must use a credential that lets SQL Server Agent run the job as the account that created the package or as an account that has the required permissions.

This method works to decrypt secrets and satisfies the key requirements by user. However, this method may have limited success because the SSIS package user keys involve the current user and the current computer. Therefore, if you move the package to another computer, this method may still fail, even if the job step uses the correct proxy account.

Method 2: Set the SSIS Package ProtectionLevel property to ServerStorage Change the SSIS Package ProtectionLevel property to ServerStorage. This setting stores the package in a SQL Server database and allows for access control through SQL Server database roles.

Method 3: Set the SSIS Package ProtectionLevel property to EncryptSensitiveWithPassword Change the SSIS Package ProtectionLevel property to EncryptSensitiveWithPassword. This setting uses a password for encryption. You can then modify the SQL Server Agent job step command line to include this password.

Method 4: Use SSIS Package configuration files Use SSIS Package configuration files to store sensitive information, and then store these configuration files in a secured folder. You can then change the ProtectionLevel property to DontSaveSensitive so that the package is not encrypted and does not try to save secrets to the package. When you run the SSIS package, the required information is loaded from the configuration file. Make sure that the configuration files are adequately protected if they contain sensitive information.

Method 5: Create a package template For a long-term resolution, create a package template that uses a protection level that differs from the default setting. This problem will not occur in future packages.

以上 link 将帮助您解决 SQL Agent 中包的日志记录和其他可能的失败情况。我怀疑您的 Agent 用户已损坏。但这是一个假设。您首先通过以下 link 启用 SSIS 的日志记录:

Enable SSIS Package Logging

来自link

的一些信息

To set the logging level for a package by using the Execute Package dialog box

  • In SQL Server Management Studio, navigate to the package in Object Explorer.

  • Right-click the package and select Execute.

  • Select the Advanced tab in the Execute Package dialog box.

  • Under Logging level, select the logging level. See the table below for a description of available values.

  • Complete any other package configurations, then click OK to run the package.

首先希望这对您有所帮助。如果不是请告诉我。