使用sp_configure启用 'xp_cmdshell'h扩展存储过程
2014-08-07 15:21
381 查看
存储过程分自定义存储、系统存储、扩展存储
三种存储中扩展存储过程陌生点,什么是扩展存储过程呢?扩展存储过程提供SQL Server 到外部程序的接口,以便进行各种维护活动。也就是在SQLServer中执行SQL系统之外的命令功能。
例如我要在SQL中执行操作系统的xcopy命令,把本地备份的数据库拷贝到远程共享服务器上,如下命令:
EXEC XP_CMDSHELL 'XCOPY E:\Source \\Target
结果提示以下错误(说xp_cmdshell扩展存储过程出于安全考虑被关闭,需要用sp_configure开启)
Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.
下面就将开启的过程说下:
-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
-- 重新配置
RECONFIGURE
GO
-- 启用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 1
GO
--重新配置
RECONFIGURE
GO
本文出自 “know how Know why” 博客,请务必保留此出处http://mage20081021.blog.51cto.com/175085/1536932
三种存储中扩展存储过程陌生点,什么是扩展存储过程呢?扩展存储过程提供SQL Server 到外部程序的接口,以便进行各种维护活动。也就是在SQLServer中执行SQL系统之外的命令功能。
例如我要在SQL中执行操作系统的xcopy命令,把本地备份的数据库拷贝到远程共享服务器上,如下命令:
EXEC XP_CMDSHELL 'XCOPY E:\Source \\Target
结果提示以下错误(说xp_cmdshell扩展存储过程出于安全考虑被关闭,需要用sp_configure开启)
Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.
下面就将开启的过程说下:
-- 允许配置高级选项
EXEC sp_configure 'show advanced options', 1
GO
-- 重新配置
RECONFIGURE
GO
-- 启用xp_cmdshell
EXEC sp_configure 'xp_cmdshell', 1
GO
--重新配置
RECONFIGURE
GO
本文出自 “know how Know why” 博客,请务必保留此出处http://mage20081021.blog.51cto.com/175085/1536932
相关文章推荐
- 代理 XP”组件已作为此服务器安全配置的一部分被关闭。系统管理员可以使用 sp_configure 来启用“代理 XP”。
- 使用sp_configure启用 'Ad Hoc Distributed Queries'
- 代理 XP”组件已作为此服务器安全配置的一部分被关闭。系统管理员可以使用 sp_configure 来启用“代理 XP”。
- SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad Hoc Distributed Que
- SQL2005:Excel 导入,使用sp_configure启用 'Ad Hoc Distributed Queries'
- 使用 sp_configure 启用 'Ad Hoc Distributed Queries'
- SQL Server 阻止了对组件“Ad Hoc Distributed Queries”的 STATEMENT“OpenRowset/OpenDatasource”的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用“Ad Hoc Distributed Queries”。有关启用“Ad Hoc Distributed Queries”
- SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ad Hoc Distributed Queries'。有关启用 'Ad Hoc Distributed Queries' 的详细信息
- 使用sp_configure启用 'Ad Hoc Distributed Queries'
- SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭。系统管理员可以通过使用 sp_configure 启用 'Ol
- 使用sp_configure启用 'Ad Hoc Distributed Queries'
- Dos打开sp_configure启用xp_cmdshell
- 使用 sp_configure 启用 'Ad Hoc Distributed Queries'
- 在 IIS 5.1 中配置使用 ISAPI 扩展程序,XP sp2,[多图]
- SQL Server 2005 启用 xp_cmdshell 使用T-SQL语句导出数据到文件
- 禁止在 SQL Server 中生成用户实例。请使用 sp_configure 'user instances enabled' 生成用户实例。
- 在 IIS 5.1 中配置使用 ISAPI 扩展程序,XP sp2,[多图]
- MSSQL扩展存储过程 master.dbo.xp_sqlagent_enum_jobs--整理帖
- 禁止在 SQL Server 中生成用户实例。请使用 sp_configure 'user instances enabled' 生成用户实例。
- 使用sp_configure 系统存储过程,设置服务器配置选项