日期:2014-05-17  浏览次数:20568 次

設定選項 'xp_cmdshell' 不存在,或可能是一個進階選項
如題目的問題

exec xp_cmdshell 'dir c:\'

SQL Server 已封鎖元件 'xp_cmdshell' 的 程序 'sys.xp_cmdshell' 之存取,因為此元件已經由此伺服器的安全性組態關閉。系統管理員可以使用 sp_configure 來啟用 'xp_cmdshell' 的使用。如需有關啟用 'xp_cmdshell' 的詳細資訊,請參閱《SQL Server 線上叢書》中的<介面區組態>(Surface Area Configuration)。

sp_configure 'show advanced options', 1
reconfigure
exec sp_configure 'xp_cmdshell', 1
reconfigure

設定選項 'xp_cmdshell' 不存在,或可能是一個進階選項。

網上查詢解決辦法

sp_dropextendedproc 'xp_cmdshell'
執行OK
sp_addextendedproc 'xp_cmdshell', 'xpsql70.dll'
執行OK

SQL code

use master
select * from
dbo.sysobjects where id = object_id(N'[dbo].[xp_cmdshell]')
name                                                                                                                             id          xtype uid    info   status      base_schema_ver replinfo    parent_obj  crdate                  ftcatid schema_ver  stats_schema_ver type userstat sysstat indexdel refdate                 version     deltrig     instrig     updtrig     seltrig     category    cache
-------------------------------------------------------- ----------- ----- ------ ------ ----------- --------------- ----------- ----------- ----------------------- ------- ----------- ---------------- ---- -------- ------- -------- ----------------------- ----------- ----------- ----------- ----------- ----------- ----------- ------
xp_cmdshell                                                                                                                      -1008137134 X     4      0      0           0               0           0           2005-10-14 01:40:57.297 0       0           0                X    0        4       0        2005-10-14 01:40:57.297 0           0           0           0           0           2           0





問題依舊,,,
哪為大大help一下

------解决方案--------------------
高级配置了还不行吗?
------解决方案--------------------
SQL code
--开启xp_cmdshell
--SQL Server blocked access to procedure 'xp_cmdshell'
sp_configure 'show advanced options', 1
go
reconfigure
go
sp_configure 'xp_cmdshell', 1
go
reconfigure
go

--开启sp_OACreate
--SQL Server blocked access to procedure 'sys.sp_OACreate'
sp_configure 'show advanced options', 1;
go
reconfigure;
go
sp_configure 'ole automation procedures', 1;
go
reconfigure;
go


sp_configure 'Ad Hoc Distributed Queries',1;
go
reconfigure
go