项目背景:
Oracle数据库11.2.0.1版本,linuxcentos 6.5系统,单实例
sqlserver 2008windows2008
1、下载地址:
(1)oracle官网
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html里面有下载gateway的
2)云盘
链接: http://pan.baidu.com/s/1nv8Qnpv 密码: 3u3g
2、安装
在服务器上安装11gR2 gateway是单独的安装包:11.2.0.4.0x64是第五个安装包),下载下来是linux.x64_11gR2_gateways.zip这样一个压缩包,安装的时候和安装oracle软件一样,通过vnc viewer远程连接进去,解压缩,然后点击./runInstaller进行安装,主要步骤如下所示:
unzip linux.x64_11gR2_gateways.zip
cd gateways
export DISPLAY=192.168.121.90:1
xhost +
(如果报xhost: unable to open display “192.168.121.90”的提示,则换成如下命令
export DISPLAY=localhost:1
xhost +
)
su – oracle
cd/oracle/gateways/gateways/
./runInstaller
(接下来就是图形化桌面安装窗口演示部分E:\u\oracle\install\pic\*.png):
3、配置
(2)修改$ORACLE_HOME/network/admin下的tnsnames.ora和listener.ora,添加sqlserver实例信息
[oracle@hch_test_121_90 admin]$ vim listener.ora
SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (SID_NAME = dg4msql) #此处为配置文件SID,要与initdg4msql.ora中的名字对应 (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1) (PROGRAM = dg4msql) 此处为配置文件目录名称,$ORACLE_HOME/dg4msql/admin/initdg4msql.ora ) (SID_NAME = powerdes) (ORACLE_HOME = /home/oracle/app/oracle/product/11.2.0/dbhome_1) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.121.90)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)) ADR_BASE_LISTENER = /home/oracle/app/oracle |
当然如果想让网关监听信息不用1521端口也可以如下实验1522端口
LISTENER_getways = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.121.90)(PORT = 1522)) SID_LIST_LISTENER_getways = (SID_DESC= (SID_NAME = dg4msql) (ORACLE_HOME =/home/oracle/app/oracle/product/11.2.0/dbhome_1) (PROGRAM = dg4msql) |
[oracle@hch_test_121_90 admin]$ vim tnsnames.ora (SERVER = DEDICATED) (SERVICE_NAME = powerdes) dg4msql = (ADDRESS_LIST = (CONNECT_DATA = (SERVICE_NAME = dg4msql) (HS = OK) #此处表示连接的非数据库 PD12190 = LISTENER_POWERDES = 测试一下:
4、在oracle服务器上创建dblinkPS:事先需要保证远程的sqlserver数据库是正常运行的。 先建立连接sqlserver的dblink:
|