在SQL SERVER 2005 调用“sys.xp_cmdshell”过程对过期备份文件进行删除出现如下出错提示:
-----------------------------
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.
SQL server 2005的默认安全策略关闭了用户对“sys.xp_cmdshell”的访问权限,用如下语句开启:
sp_configure 'show advanced options', 1
GO
RECONFIGURE
sp_configure 'xp_cmdshell', 1
------------------------------
另外,当你准备在SQL SERVER 2005中调用操作系统内置的smtp组件发送邮件时,可能也会收到如下错误提示:
--------------------------------
“SQL Server 阻止了对组件 'Ole Automation Procedures' 的 过程'sys.sp_OACreate' 的访问,因为此组件已作为此服务器安全配置的一部分而被关闭”
同样道理,用如下语句开启Ole Automation Procedures的访问权限:
sp_configure 'show advanced options',1
sp_configure 'Ole Automation Procedures'
本文转自 donhuang 51CTO博客,原文链接:http://blog.51cto.com/donhuang/126218