简体   繁体   English

SSIS package 在由 sql 作业代理运行时失败

[英]SSIS package fails when runs by sql job agent

I am in trouble with running SSIS packages in my etl process.我在我的 etl 进程中运行 SSIS 包时遇到了麻烦。

There is a table that includes etl steps with different types.有一个表格,其中包含不同类型的 etl 步骤。 ie Stored Procedure steps, cmd (copy-move files) steps, sending mail, SSIS steps.即存储过程步骤,cmd(复制-移动文件)步骤,发送邮件,SSIS 步骤。

A main Stored procedures runs these steps according to type of steps and logs begin-end times, errors etc. This main stored procedure is triggered by an sql server job.主存储过程根据步骤类型运行这些步骤并记录开始-结束时间、错误等。这个主存储过程由 sql 服务器作业触发。

When I scheduled this job, SSIS steps takes error which is below;当我安排这项工作时,SSIS 步骤出现以下错误;

Error: SSIS Error Code DTS_E_OLEDBERROR.错误:SSIS 错误代码 DTS_E_OLEDBERROR。 An OLE DB error has occurred.发生 OLE DB 错误。 Error code: 0x80040E4D.错误代码:0x80040E4D。 An OLE DB record is available. OLE DB 记录可用。 Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E4D Description: "Login failed for user 'server\user$'.".来源:“Microsoft SQL Server Native Client 11.0” Hresult:0x80040E4D 描述:“用户 'server\user$' 登录失败。”。

Yet, when I run this main procedure manually (with my windows user login) it runs successfully.然而,当我手动运行这个主程序时(使用我的 windows 用户登录)它运行成功。

I checked this running with proxy account, it didn't work for me.我用代理帐户检查了这个运行,它对我不起作用。 Because inside the sql server job, i run my main stored procedure not SSIS package.因为在 sql 服务器作业中,我运行我的主要存储过程而不是 SSIS package。

proxy account reference link;代理账户参考链接; https://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/ https://www.mssqltips.com/sqlservertip/2163/running-a-ssis-package-from-sql-server-agent-using-a-proxy-account/

It should work so long as your connection to the database is valid.只要您与数据库的连接有效,它就应该工作。 The error message is telling you that server\user$ is not a valid login.错误消息告诉您server\user$不是有效的登录名。

If the SSIS Package is connecting to the DB with a username and password ( ie , a SQL user), then it should be straight forward to set up / configure the login to have access to the server and database where your proc resides, and when you next run the job it should be able to successfully execute the proc.如果 SSIS Package 正在使用用户名和密码(SQL 用户)连接到数据库,那么它应该直接访问并设置您的登录名和驻留数据库你接下来运行它应该能够成功执行proc的作业。

If instead the SSIS Package is connecting with Windows Authentication, then you'll need to use a Proxy that specifies a Credential that references a Windows / Active Directory account with database access. If instead the SSIS Package is connecting with Windows Authentication, then you'll need to use a Proxy that specifies a Credential that references a Windows / Active Directory account with database access. In SSMS:在 SSMS 中:

  1. Server >> Security >> Credentials服务器 >> 安全 >> 凭据
    • create a new credential创建一个新的凭证
    • give it a name给它一个名字
    • specify a windows account that has permissions to execute your proc指定一个有权执行您的过程的 windows 帐户
  2. Server >> SQL Server Agent >> Proxies >> SSIS Package Execution服务器 >> SQL 服务器代理 >> 代理 >> SSIS Package 执行
    • create a new proxy创建一个新代理
    • select the credential you just created select 您刚刚创建的凭证
    • Select "SQL Server Integration Services Package" subsystem Select“SQL Server 集成服务包”子系统
  3. Server >> SQL Server Agent >> Jobs >> Your Job >> SSIS Job Step服务器 >> SQL 服务器代理 >> 工作 >> 您的工作 >> SSIS 工作步骤
    • in the "Run as" field, pick the proxy you just created在“运行方式”字段中,选择您刚刚创建的代理

Now when you kick off the job, your SSIS package should make a connection to the database using the windows account specified in the credential set up in step 1, which should be able to successfully execute the stored proc.现在,当您开始工作时,您的 SSIS package 应该使用 windows 帐户连接到数据库,该帐户应该能够成功执行步骤 1 中指定的存储过程。

does your package of SSIS any password?你的 package 的 SSIS 有密码吗? if not,set password for it.then edit your job and write password there too.如果没有,请为其设置密码。然后编辑您的工作并在那里输入密码。

If you have a password in your SSIS package, make sure that the ProtectionLevel is set to "EncryptSensitiveWithPassword".如果您的 SSIS package 中有密码,请确保将 ProtectionLevel 设置为“EncryptSensitiveWithPassword”。 If you use "EncryptSensitiveWithUserKey" then you'll be the only user who can run it.如果您使用“EncryptSensitiveWithUserKey”,那么您将是唯一可以运行它的用户。

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

相关问题 SSIS包在服务器上运行,但不作为预定作业运行(SQL代理) - SSIS Package runs on the server but not as a scheduled job (SQL Agent) 包含SQL身份验证的SSIS在IDE中运行,但在SQL Server代理作业中失败 - SSIS Containing SQL Authentication Runs in IDE but fails in SQL Server Agent Job SQL Server作业代理不执行SSIS包 - SQL Server Job Agent don't execute SSIS Package SSIS包在SQL Agent作业中比手动运行速度慢 - SSIS package slower in SQL Agent job than running it manually SSIS DTSX package 在 SQL 服务器代理作业中丢失数据 - SSIS DTSX package losing data in a SQL Server Agent job SSIS包DataFlowTask for Excel导入到SQL Server 2014在我的本地实例上运行,但在服务器上部署失败时 - SSIS package DataFlowTask for Excel Import to SQL Server 2014 runs on my local instance, but when deployed fails on the server SSIS Package 在 VS2019 中运行良好,但在 SQL 2019 上的 SSISDB 中部署时立即失败 - SSIS Package runs fine in VS2019 but it fails immediately when it is deployed in SSISDB on SQL 2019 由 SQL 作业执行时 SSIS 包失败 - SSIS Package failing when excecuted by a SQL Job ssis 在 sql 服务器代理中工作 - ssis job in sql server agent SQL Server Agent 2012不执行连接到Oracle但从SSIS运行正常的SSIS 2012程序包 - SQL Server Agent 2012 not executing SSIS 2012 package that connects to Oracle but runs OK from SSIS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM