SQL Server中的cmd_shell组件功能强大,几乎可通过该组建实现Windows系统的所有功能,正因此,这个组件也是SQL Server的最大安全隐患。SQL Server 2000中这个组件是默认开启的,而SQL Server 2005中这个组件默认作为此服务器安全配置的一部分而被关闭。有时我们需要用到该组件,开启此组件的相关语句如下:
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
</div>
为了保证数据库服务器的安全,建议在使用完毕后关闭该组件,关闭该组件的相关语句如下:
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', 0
GO
--To update the currently configured value for this feature.
RECONFIGURE
GO
</div>
您可能想查找下面的文章:
- SQL Server 2005安装配置方法图文教程 完美兼容Win7所有版本
- sql server 关于设置null的一些建议
- SQL Server 2005 中使用 Try Catch 处理异常
- SQL Server 2005 Management Studio Express企业管理器将英文变成简体中文版的实现方法
- SQL server 2005中设置自动编号字段的方法
- SQL Server 2005 定时执行SQL语句的方法
- SQL Server 2005 开启数据库远程连接的方法
- SQL server 2005将远程数据库导入到本地的方法
- 安装SQL server 2005 出现警告 32位ASP.NET已经注册,需要注册64位的解决方法
- Sql server 2005安装时ASP.Net版本注册要求警告的解决方法