一个用windows验证方式验证的ssis包,手动执行可以成功。但是在sa下用xp_cmdshell调用dtexec就失败。我怀疑是安全上下文的问题,咋整啊Microsoft (R) SQL Server Execute Package Utility
Version 9.00.3042.00 for 32-bit
Copyright (C) Microsoft Corp 1984-2005. All rights reserved.
NULL
Started:  4:23:13 AM
Progress: 2007-11-30 04:23:14.20
  Source: Transfer data to tempdb 
  Validating: 0% complete
End Progress
Progress: 2007-11-30 04:23:14.23
  Source: Transfer data to tempdb 
  Validating: 50% complete
End Progress
Error: 2007-11-30 04:23:14.29
  Code: 0xC0202009
  Source: Transfer data to tempdb CCRCLog Destination [2881]
  Description: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80040E09.
An OLE DB record is available.  Source: "Microsoft SQL Native Client"  Hresult: 0x80040E09  Description: "SELECT permission denied on object 'CCRCLog', database 'tempdb', schema 'dbo'.".
End Error
Error: 2007-11-30 04:23:14.29
  Code: 0xC0202040
  Source: Transfer data to tempdb CCRCLog Destination [2881]
  Description: Failed to open a fastload rowset for "[dbo].[CCRCLog]". Check that the object exists in the database.
End Error
Error: 2007-11-30 04:23:14.29
  Code: 0xC004706B
  Source: Transfer data to tempdb DTS.Pipeline
  Description: "component "CCRCLog Destination" (2881)" failed validation and returned validation status "VS_ISBROKEN".
End Error
Progress: 2007-11-30 04:23:14.29
  Source: Transfer data to tempdb 
  Validating: 100% complete
End Progress
Error: 2007-11-30 04:23:14.29
  Code: 0xC004700C
  Source: Transfer data to tempdb DTS.Pipeline
  Description: One or more component failed validation.
End Error
Error: 2007-11-30 04:23:14.29
  Code: 0xC0024107
  Source: Transfer data to tempdb 
  Description: There were errors during task validation.
End Error
DTExec: The package execution returned DTSER_FAILURE (1).
Started:  4:23:13 AM
Finished: 4:23:14 AM
Elapsed:  0.859 seconds
NULL 

解决方案 »

  1.   

    可能是xp_cmdshell执行的时候默认使用guest帐户调用包之前可以试试使用
    net use \\主机 密码 /USER:administrator
    注:以上纯属猜测,可以试试
      

  2.   

    我也碰到过这种问题,这个和DTS内部的东西有关,你把这个包重建一次就可以解决了
    忘了是怎么产生的了,好像是修改了什么东西。
      

  3.   

    http://www.gozyw.com/Html/sjk/SYBASE/2007/4/1736608.html
    不知道有沒有用。
      

  4.   

    05:
    楼主用以下方法查一下原因:SQL Server 外围应用配置器—功能介面状态(启用xp_cmdshell)
    --
    把登陆模式改为混合模式。。
      

  5.   

    xp_cmdshell--需要sa有系统管理员角色(system administrators)---在数据库里查看一下
      

  6.   

    不是xp_cmdshell的问题。登录模式就是混合的。
      

  7.   

    前见天还好好的,忽然就不行了。我查了一下sql server是用local system启动的,想用域账户重启一下,老大回复说
    When you try running packages with exec xp_cmdshell 'dtexec…' from the sql 2000 instance on db7 they should run under the sql agent service account, which is the iibsqladmin account, so I'm not exactly sure why it wouldn't work, but I don't think restarting the services will fix it, as it's probably permissions related.
      

  8.   

    用域帐户重启了,解决了。原因是xp_cmdshell会使用sql server service启动帐户为安全上下文,而启动帐户是local   system不是域帐户,这个帐户被传递到ssis包中进行对两个server的连接进行安全验证。这样导致ssis包中的一个server在进行安全验证时认为这个local   system没有权限,因为这个local   system 不是它的帐户,所以不行。
    散分啦。