我正在使用Microsoft SQL Server 2014企业版。链接的服务器出现问题,需要重新启动服务器或停止MSSQLSERVER
服务。当服务器再次运行时,(连接到DB2的)链接服务器无法正常工作,并且SQL Server显示此错误:
消息7302,级别16,状态1,行10
无法为链接服务器“ Airspe”创建OLE DB提供程序“ DB2OLEDB”的实例。
仅在几次重新启动服务器后,链接服务器才开始工作。
- 为什么需要多次重启服务器才能启动链接的服务器?
- 还有其他解决方案吗?
这是创建链接服务器之一的脚本:
EXEC master.dbo.sp_addlinkedserver
@server = N'AIRS',
@srvproduct=N'Microsoft OLE DB Provider for DB2',
@provider=N'DB2OLEDB',
@datasrc=N'###.###.###.##',@provstr=N'Provider=DB2OLEDB;
Data Source=#####;Persist Security Info=True;Password=**********;
User ID=######;Initial Catalog=######;
Network Address=###.###.###;Package Collection=AICOLDP;DBMS Platform=DB2/AS400',
@catalog=N'#####'
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'AIRS',@useself=N'False',@locallogin=NULL,@rmtuser=N'#####',@rmtpassword='########'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'collation compatible', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'data access', @optvalue=N'true'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'dist', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'pub', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'rpc', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'rpc out', @optvalue=N'true'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'sub', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'connect timeout', @optvalue=N'0'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'collation name', @optvalue=null
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'lazy schema validation', @optvalue=N'false'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'query timeout', @optvalue=N'0'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'use remote collation', @optvalue=N'true'
EXEC master.dbo.sp_serveroption @server=N'AIRS', @optname=N'remote proc transaction promotion', @optvalue=N'true'