SQL Agent Job failes when trying to execute SSIS package due to some permission issues

怎甘沉沦 提交于 2019-12-10 10:12:35

问题


I deployed ssis package on sql server 2012. Thereafter scheduled a sql job to run this ssis package weekly. When I started a job for the first time, it failed with following error.

The job failed. The Job was invoked by User MyDomain\MyUserName. The last step to run was step 1 (scheduling ssis package).

Executed as user: NT Service\SQLSERVERAGENT. Microsoft (R) SQL Server Execute Package Utility Version 11.0.5058.0 for 64-bit Copyright (C) Microsoft Corporation. All rights reserved. Started: 2:17:12 PM Package execution on IS Server failed. Execution ID: 6, Execution Status:4. To view the details for the execution, right-click on the Integration Services Catalog, and open the [All Executions] report Started: 2:17:12 PM Finished: 2:17:17 PM Elapsed: 4.493 seconds. The package execution failed. The step failed.

I am sure there is some issue with permissions, however I am not able to resolve this.

This package is deleting a content of a folder present on my desktop. SQL Server instance is running on my machine. I am on a standalone machine.


回答1:


After searching lot of articles I got an article which helped me identifying actual error :- Identifying issue

  1. Login sql server instance
  2. Navigate to Integration Service Catalogs
  3. Right Click on your SSISDB catalog and select All Reports -> Standard reports -> All Executions
  4. For your folder, click on All Messages for failed task
  5. Here you will see your error

In my case error was "Access to path 'C:\Users\MyUser\Desktop\Test Folder' is denied". To note there is a section Caller in this report who is trying to access this folder, in my case it was NT SERVICE\SQLSERVERAGENT.

Go to this folder, right click -> Properties -> Security Under Group/username click Edit -> Inside new pop up Add new user Now if you are trying to find NT SERVICE\SQLSERVERAGENT user, you won't find since its under a service account which means you will see a user named SERVICE . This is the user you need to add to this folder.

As soon as I added this, my job started running :)




回答2:


In my case Identifying issue: Login sql server instance Navigate to Integration Service Catalogs Right Click on your SSISDB catalog and select All Reports -> Standard reports -> All Executions -check the fail/ red error log report section(overview,all messages,execution performance) - I went to overview ->clicked execution path -> under error messages clicked view context this will show you step by step execution. I had a data type mismatch as I reran the sql script in ssms it was giving issue. Once I fixed the data type or removed extra data. All back to normal




回答3:


Solution : I got the same error in SQL agent job ,so I just check SSIS package whether it is running or not then find that package is failing because from proc we are taking input as string and in package I have create a variable datatype object to store the proc input ,When I changed that my SSIS package as well as sql job is running fine now. I hope this will help you ..



来源:https://stackoverflow.com/questions/29694601/sql-agent-job-failes-when-trying-to-execute-ssis-package-due-to-some-permission

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!