求助,用xp_cmdshell调用dtexec失败,但是手动执行能成功

mengmou 2007-11-30 06:28:37
一个用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
...全文
337 23 打赏 收藏 转发到动态 举报
写回复
用AI写文章
23 条回复
切换为时间正序
请发表友善的回复…
发表回复
hb_gx 2007-12-06
  • 打赏
  • 举报
回复
原来是在域帐户下

谢谢LZ分享经验
mengmou 2007-12-06
  • 打赏
  • 举报
回复
呵呵,已经晚了
-狙击手- 2007-12-06
  • 打赏
  • 举报
回复
再来一楼
-狙击手- 2007-12-06
  • 打赏
  • 举报
回复
加上我就能平均 了
mengmou 2007-12-06
  • 打赏
  • 举报
回复
怎么不能平均给啊
mengmou 2007-12-06
  • 打赏
  • 举报
回复
用域帐户重启了,解决了。原因是xp_cmdshell会使用sql server service启动帐户为安全上下文,而启动帐户是local system不是域帐户,这个帐户被传递到ssis包中进行对两个server的连接进行安全验证。这样导致ssis包中的一个server在进行安全验证时认为这个local system没有权限,因为这个local system 不是它的帐户,所以不行。


散分啦。
chenhexi007 2007-12-04
  • 打赏
  • 举报
回复
学习。
mengmou 2007-12-04
  • 打赏
  • 举报
回复
这台服务器有两个实例,一个2000,一个2005,在2000上失败,在2005上就可以,真邪门
rfq 2007-12-04
  • 打赏
  • 举报
回复
学习
rouqu 2007-12-03
  • 打赏
  • 举报
回复
up
playwarcraft 2007-12-03
  • 打赏
  • 举报
回复
http://www.gozyw.com/Html/sjk/SYBASE/2007/4/1736608.html
不知道有沒有用。。。。
mengmou 2007-12-03
  • 打赏
  • 举报
回复
高升的办法试过了,也不行。
mengmou 2007-12-03
  • 打赏
  • 举报
回复
test
mengmou 2007-12-03
  • 打赏
  • 举报
回复
前见天还好好的,忽然就不行了。我查了一下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.
mengmou 2007-12-03
  • 打赏
  • 举报
回复
不是xp_cmdshell的问题。登录模式就是混合的。


中国风 2007-12-03
  • 打赏
  • 举报
回复
xp_cmdshell--需要sa有系统管理员角色(system administrators)---在数据库里查看一下
中国风 2007-12-03
  • 打赏
  • 举报
回复
05:
楼主用以下方法查一下原因:

SQL Server 外围应用配置器—功能介面状态(启用xp_cmdshell)
--
把登陆模式改为混合模式。。
fa_ge 2007-12-01
  • 打赏
  • 举报
回复
关注
xiaos139 2007-12-01
  • 打赏
  • 举报
回复
我也碰到过这种问题,这个和DTS内部的东西有关,你把这个包重建一次就可以解决了
忘了是怎么产生的了,好像是修改了什么东西。
newqm 2007-12-01
  • 打赏
  • 举报
回复
帮顶
加载更多回复(3)

34,575

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧