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

starseeker7 2010-01-13 03:00:52
如題目的問題

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


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一下
...全文
1173 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
-Tracy-McGrady- 2012-08-16
  • 打赏
  • 举报
回复

SQL Server 2005 中引入的 xp_cmdshell 选项是服务器配置选项,使系统管理员能够控制是否可以在系统上执行 xp_cmdshell 扩展存储过程。默认情况下,xp_cmdshell 选项在新安装的软件上处于禁用状态,但是可以通过使用外围应用配置器工具或运行 sp_configure 系统存储过程来启用它,如下面的代码示例所示:
-- 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

--具体的可以查看一下SQL SERVER的帮助文档
zgn001 2010-05-11
  • 打赏
  • 举报
回复
我照做了还是不行的,快教教我
SQL77 2010-01-13
  • 打赏
  • 举报
回复
http://social.technet.microsoft.com/Forums/ru-RU/sqlservermanagementzhcht/thread/36ac2be6-4595-4639-b6be-101568f61068

参考下MSDN上的,你是以什么身份进去的
starseeker7 2010-01-13
  • 打赏
  • 举报
回复
不好意思浪費兩位老大時間了,,,
揭帖了事
starseeker7 2010-01-13
  • 打赏
  • 举报
回复
哦找到問題了,,,
奶奶的

我失誤了
sp_configure 'show advanced options', 1
go
reconfigure WITH OVERRIDE

之前不加 WITH OVERRIDE都能用,,,這次就必須加樂,,,
--小F-- 2010-01-13
  • 打赏
  • 举报
回复
--开启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
starseeker7 2010-01-13
  • 打赏
  • 举报
回复
是啊,,,所以噁心,,,
確定高級配置已打開
sp_configure 'show advanced options', 1
組態選項 'show advanced options' 從 1 變更為 1。請執行 RECONFIGURE 陳述式來安裝。
starseeker7 2010-01-13
  • 打赏
  • 举报
回复
我的題目就是
exec sp_configure 'xp_cmdshell', 1
這個頗語句報的錯。。。

訊息 15123,層級 16,狀態 1,程序 sp_configure,行 51
設定選項 'xp_cmdshell' 不存在,或可能是一個進階選項。
SQL77 2010-01-13
  • 打赏
  • 举报
回复
高级配置了还不行吗?
SQL77 2010-01-13
  • 打赏
  • 举报
回复
sp_configure 'show advanced options', 1
reconfigure
exec sp_configure 'xp_cmdshell', 1
reconfigure


这样了还不行?
网管教程 从入门到精通软件篇 ★一。★详细的xp修复控制台命令和用法!!! 放入xp(2000)的光盘,安装时候选R,修复! Windows XP(包括 Windows 2000)的控制台命令是在系统出现一些意外情况下的一种非常有效的诊断和测试以及恢复系统功能的工具。小编的确一直都想把这方面的命令做个总结,这次辛苦老范给我们整理了这份实用的秘笈。   Bootcfg   bootcfg 命令启动配置和故障恢复(对于大多数计算机,即 boot.ini 文件)。   含有下列参数的 bootcfg 命令仅在使用故障恢复控制台时才可用。可在命令提示符下使用带有不同参数的 bootcfg 命令。   用法:   bootcfg /default  设置默认引导项。   bootcfg /add    向引导列表中添加 Windows 安装。   bootcfg /rebuild  重复全部 Windows 安装过程并允许用户选择要添加的内容。   注意:使用 bootcfg /rebuild 之前,应先通过 bootcfg /copy 命令备份 boot.ini 文件。   bootcfg /scan    扫描用于 Windows 安装的所有磁盘并显示结果。   注意:这些结果被静态存储,并用于本次会话。如果在本次会话期间磁盘配置发生变化,为获得更新的扫描,必须先重新启动计算机,然后再次扫描磁盘。   bootcfg /list   列出引导列表中已有的条目。   bootcfg /disableredirect 在启动引导程序中禁用重定向。   bootcfg /redirect [ PortBaudRrate] |[ useBiosSettings]   在启动引导程序中通过指定配置启用重定向。   范例: bootcfg /redirect com1 115200 bootcfg /redirect useBiosSettings   hkdsk   创建并显示磁盘的状态报告。Chkdsk 命令还可列出并纠正磁盘上的错误。   含有下列参数的 chkdsk 命令仅在使用故障恢复控制台时才可用。可在命令提示符下使用带有不同参数的 chkdsk 命令。   vol [drive:] [ chkdsk [drive:] [/p] [/r]   参数  无   如果不带任何参数,chkdsk 将显示当前驱动器中的磁盘状态。 drive: 指定要 chkdsk 检查的驱动器。 /p   即使驱动器不在 chkdsk 的检查范围内,也执行彻底检查。该参数不对驱动器做任何更改。 /r   找到坏扇区并恢复可读取的信息。隐含着 /p 参数。   注意 Chkdsk 命令需要 Autochk.exe 文件。如果不能在启动目录(默认为 %systemroot%System32)中找到该文件,将试着在 Windows 安装 CD 中找到它。如果有多引导系统的计算机,必须保证是在包含 Windows 的驱动器上使用该命令。 Diskpart   创建和删除硬盘驱动器上的分区。diskpart 命令仅在使用故障恢复控制台时才可用。   diskpart [ /add |/delete] [device_name |drive_name |partition_name] [size]   参数 无   如果不带任何参数,diskpart 命令将启动 diskpart 的 Windows 字符模式版本。   /add   创建新的分区。   /delete   删除现有分区。   device_name   要创建或删除分区的设备。设备名称可从 map 命令的输出获得。例如,设备名称:   DeviceHardDisk0   drive_name   以驱动器号表示的待删除分区。仅与 /delete 同时使用。以下是驱动器名称的范例:   D:   partition_name   以分区名称表示的待删除分区。可代替 drive_name 使用。仅与 /delete 同时使用。以下是分区名称的范例:   DeviceHardDisk0Partition1    大小   要创建的分区大小,以兆字节 (MB)表示。仅与 /add 同时使用。   范例   下例将删除分区: diskpart /delete Device HardDisk0 Partition3 diskpart /delete F:   下例将在硬盘上添加一个 20 MB 的分区:   diskpart /add Device HardDisk0 20   Fixboot

22,210

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server 疑难问题
社区管理员
  • 疑难问题社区
  • 尘觉
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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