mssql 管理器 MSSQL 启用xp_cmdshell
SQL中运行系统命令行的系统存储过程mssql 管理器,一般在安全级别较高的服务器上,建议关闭或限制访问权限。
二、开启xp_cmdshell需求
当我们使用SQL JOB 方式进行数据
一、何为xp_cmdshell SQL中运行系统命令行的系统存储过程mssql 管理器,一般在安全级别较高的服务器上,建议关闭或限制访问权限。 二、开启xp_cmdshell需求 当我们使用SQL JOB 方式进行数据库异地备份时,需要启用xp_cmdshell 三、启用方式 可以使用外围应用配置器工具以及通过执行 sp_configure 来启用和禁用 xp_cmdshell 四、使用外围应用配置工具启用 xp_cmdshell 1、打开SQL Server Management Studio,连接进入数据库,右键点击连接后数据库的最上方。选择“方面” 2、 在方面上选择“外围应用配置器” 3、将XPCmdShellEnbled的值改为“True”,确定完成设置。 4、将刚才的配置导出为策略,方便以后的管理。点击“将当前的状态导出为策略”,定义一个名称后确定。 5、在对象资源管理器中,就可以看到刚才导出的策略。 6、右键点击策略,选择属性来进行管理。 7、点击检查条件后面…按钮,我们可以看到策略的内容,可以进行设置与配置了。 五、通过执行 sp_configure 来启用和禁用 xp_cmdshell 1、------启用xp_cmdshell 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 -- To disallow advanced options to be changed. EXEC sp_configure'show advanced options', 0 GO -- To update the currently configured value for advanced options. RECONFIGURE GO 2、------禁用xp_cmdshell 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 -- To disallow advanced options to be changed. EXEC sp_configure'show advanced options', 0 GO -- To update the currently configured value for advanced options. RECONFIGURE GO (编辑:威海站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |