徐冬丽 发表于 2018-6-20 08:16:55

SQL2012启用对组件“Ole Automation Procedures”和xp_cmdshell组件的访问

  SQL2012安装后的开启参数
  SQL Server如何启用xp_cmdshell组件
  通过SQL语句开启。[推荐此方法,因为在任何版本的SQL SERVER中都可以使用。]
  通过查询分析器,选择Master数据库,然后执行以下SQL内容:
  sp_configure 'show advanced options',1
  reconfigure
  go
  sp_configure 'xp_cmdshell',1
  reconfigure
  go
  EXEC sp_configure 'xp_cmdshell';查看结果参数
  GO
  SQL开启对组件“Ole Automation Procedures”的 过程“sys.sp_OACreate”的访问
  sp_configure 'show advanced options',1
  reconfigure
  go
  sp_configure 'Ole Automation Procedures', 1;
  GO
  RECONFIGURE;
  GO
  EXEC sp_configure 'Ole Automation Procedures';查看结果参数
  GO
  田歌ERP sql2012安装后的参数启用
  阻止了对组件“Ole Automation Procedures”的 过程“sys.sp_OACreate”的访问,因为此组件已作为此服务器安全配置的一部分而被关闭
  以下红色语句是申购系统保存的控件需要打开对组件“Ole Automation Procedures”的 过程“sys.sp_OACreate”的访问
  sp_configure 'Ole Automation Procedures', 1;
  GO
  RECONFIGURE;
  GO
  EXEC sp_configure 'Ole Automation Procedures';
  GO
Ole Automation Procedures 服务器配置选项
  http://msdn.microsoft.com/zh-cn/library/ms191188.aspx
  使用 Ole Automation Procedures 选项可指定是否可以在 Transact-SQL 批处理中实例化 OLE Automation 对象。 还可以使用基于策略的管理或者 sp_configure 存储过程来配置这一选项。 有关详细信息,请参阅外围应用配置器。
  可以将 Ole Automation Procedures 选项设置为以下值。

[*]  0
[*]  禁用 OLE Automation Procedures。 SQL Server 新实例的默认值。
[*]  1
[*]  启用 OLE Automation Procedures。
  当启用 OLE Automation Procedures 时,对 sp_OACreate 的调用将会启动 OLE 共享执行环境。
  可以使用 sp_configure 系统存储过程来查看和更改 Ole Automation Procedures 选项的当前值。
  示例
  以下示例显示了如何查看 OLE Automation Procedures 的当前设置。
EXEC sp_configure 'Ole Automation Procedures';  
GO
  以下示例显示了如何启用 OLE Automation Procedures。
sp_configure 'show advanced options', 1;  
GO
  
RECONFIGURE;
  
GO
  
sp_configure 'Ole Automation Procedures', 1;
  
GO
  
RECONFIGURE;
  
GO
页: [1]
查看完整版本: SQL2012启用对组件“Ole Automation Procedures”和xp_cmdshell组件的访问