1、安装ORACLE client,从官网下载;
2、tnsnamse配置:
3、odbc配置
4、建立链接服务器
USE [master]
GO
/****** Object: LinkedServer [ORCL] Script Date: 2019/10/16 9:59:32 ******/
EXEC master.dbo.sp_addlinkedserver @server = N'ORCL', @srvproduct=N'ORACLE', @provider=N'MSDASQL', @datasrc=N'192.168.0.66/ORCL'
/* For security reasons the linked server remote logins password is changed with ######## */
EXEC master.dbo.sp_addlinkedsrvlogin @rmtsrvname=N'ORCL',@useself=N'False',@locallogin=NULL,@rmtuser=N'TEST20190122',@rmtpassword='TEST20190122'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'collation compatible', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'data access', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'dist', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'pub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'rpc', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'rpc out', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'sub', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'connect timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'collation name', @optvalue=null
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'lazy schema validation', @optvalue=N'false'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'query timeout', @optvalue=N'0'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'use remote collation', @optvalue=N'true'
GO
EXEC master.dbo.sp_serveroption @server=N'ORCL', @optname=N'remote proc transaction promotion', @optvalue=N'true'
GO
5、测试查询