Sql-Server-2012

嘗試執行代理作業時訪問被拒絕

  • December 12, 2016

有人可以指出我正確的方向。當我嘗試執行執行我在 SQL Server 上創建並保存的包的作業時,我不斷收到以下錯誤消息。

12/03/2012 17:32:15,New_App_R,Error,1,SQLAAG01,New_App_R,New_App_R,,
Executed as user: NT Service\SQLSERVERAGENT.
Started:  5:32:15 PM
Could not load package "\MSDB\New_App_R" because of error 0xC00160AE.
Description: Connecting to the Integration Services service on the computer "SQLAAG01" 
failed with the following error: "Access is denied." By default only administrators 
have access to the Integration Services service. On Windows Vista and later the process 
must be running with administrative privileges in order to connect to the Integration 
Services service. 

我還嘗試創建相同的包並將其保存在文件系統(桌面)上,當我嘗試在作業或查詢視窗中使用以下程式碼執行包時

EXEC @returncode = xp_cmdshell 'dtexec /f "C:\Users\jvelez\Desktop\New_App.dtsx"'

我收到另一個拒絕訪問錯誤,上面寫著:

Description: Failed to open package file "C:\Users\jvelez\Desktop\New_App.dtsx"
due to error 0x80070005 "Access is denied.".  This occurs when loading a package
and the file cannot be opened or loaded correctly into the XML document. This can
be the result of specifying an incorrect file name when calling LoadPackage or the
specified XML file has an incorrect format.

如果我點兩下桌面上的包,它會執行並完美執行,但我需要做的是安排包執行。我嘗試以不同的方式創建工作並將自己添加到管理員組,但似乎沒有任何效果。任何建議將不勝感激。

我在 Windows Server 2008 上執行 SQL Server 2012

“Service\SQLSERVERAGENT”服務帳戶需要訪問文件系統才能執行該包。

您還可以為 SSIS 包設置代理並使用該代理帳戶執行作業。

大多數情況下,您可以通過步驟的屬性通過安全性,方法是轉到編輯步驟->正常->配置->連接管理器並選擇您的連接字元串屬性或密碼…

引用自:https://dba.stackexchange.com/questions/29798