我正在尝试在Microsoft SQL Server 2000数据库上运行xp_cmdshell但遇到问题。当我使用它运行命令时,它只是超时,甚至像dir这样简单的东西。
我执行了以下操作以确保启用了xp_cmdshell。
EXEC sp_configure ’show advanced options’, 1
RECONFIGURE
EXEC sp_configure ’xp_cmdshell’, 1
RECONFIGURE
运行EXEC时sp_configure' xp_cmdshell',1我收到错误消息
*配置选项' xp_cmdshell'不存在,或者它可能是一个高级选项。*
我确认通过运行EXEC sp_configure启用了高级选项,输出甚至没有显示xm_cmdshell,整个输出是:
affinity mask -2147483648 2147483647 0 0
allow updates 0 1 0 0
awe enabled 0 1 0 0
c2 audit mode 0 1 0 0
cost threshold for parallelism 0 32767 5 5
Cross DB Ownership Chaining 0 1 0 0
cursor threshold -1 2147483647 -1 -1
default full-text language 0 2147483647 1033 1033
default language 0 9999 0 0
fill factor (%) 0 100 0 0
index create memory (KB) 704 2147483647 0 0
lightweight pooling 0 1 0 0
locks 5000 2147483647 0 0
max degree of parallelism 0 32 0 0
max server memory (MB) 4 2147483647 2147483647 2147483647
max text repl size (B) 0 2147483647 65536 65536
max worker threads 32 32767 255 255
media retention 0 365 0 0
min memory per query (KB) 512 2147483647 1024 1024
min server memory (MB) 0 2147483647 0 0
nested triggers 0 1 1 1
network packet size (B) 512 32767 4096 4096
open objects 0 2147483647 0 0
priority boost 0 1 0 0
query governor cost limit 0 2147483647 0 0
query wait (s) -1 2147483647 -1 -1
recovery interval (min) 0 32767 0 0
remote access 0 1 1 1
remote login timeout (s) 0 2147483647 20 20
remote proc trans 0 1 0 0
remote query timeout (s) 0 2147483647 600 600
scan for startup procs 0 1 0 0
set working set size 0 1 0 0
show advanced options 0 1 1 1
two digit year cutoff 1753 9999 2049 2049
user connections 0 32767 0 0
user options 0 32767 0 0
答案 0 :(得分:0)
你所做的是正确的。您是否单独运行这两个sp_configure选项然后重新配置而不是将整个事件作为单个语句运行?
http://technet.microsoft.com/en-us/library/ms190693.aspx
-- To allow advanced options to be changed.
EXEC sp_configure 'show advanced options', 1
GO
-- To update the currently configured value for advanced options.
RECONFIGURE
GO
-- To enable the feature.
EXEC sp_configure 'xp_cmdshell', 1
GO
-- To update the currently configured value for this feature.
RECONFIGURE
GO