linux - oracle11g使用透明网关连接sqlserver 下载本文

Linux系统oracle 11g数据库使用透明网关(gateway)连

接sqlserver数据库

本例中sqlserver数据库是192.168.6.199,oracle数据库是192.168.6.231,gateway透明网关是192.168.6.232,oracle和gateway分开部署。

1.准备环境参数

a) 修改主机名 [root@gateway ~]# vi /etc/sysconfig/network NETWORKING=yes NETWORKING_IPV6=no HOSTNAME=gateway [root@gateway ~]# vi /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 192.168.6.232 gateway ~ b) 创建用户和组、目录 [root@gateway ~]# groupadd dba [root@ gateway ~]# useradd -m -G dba oracle [root@ gateway ~]# passwd oracle [root@ gateway opt]# mkdir -p /u01/app/oracle [root@ gateway opt]# chown -R oracle:dba /u01 [root@ gateway /]# chmod 755 /u01 c) 修改oracle用户环境变量限制 [root@xxgsdb ~]# su - oracle [oracle@xxgsdb ~]$ vi .bash_profile 增加以下部分 umask 022 export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/tg_1 export NLS_LANG=AMERICAN_AMERICA.UTF8 export NLS_DATE_FORMAT=\export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin export ORACLE_PATH=${PATH}:$ORACLE_BASE/common/oracle/sql:.:$ORACLE_HOME/rdbms/a dmin export ORACLE_TERM=xterm export TNS_ADMIN=$ORACLE_HOME/network/admin export ORA_NLS10=$ORACLE_HOME/nls/data unset ORA_NLS10 export LD_LIBRARY_PATH=$ORACLE_HOME/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib export CLASSPATH=$ORACLE_HOME/JRE export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib export THREADS_FLAG=native export TEMP=/tmp export TMPDIR=/tmp export PATH=$PATH:$ORACLE_HOME/bin d) 关闭iptables [root@xxgsdb /]# service iptables stop iptables: Setting chains to policy ACCEPT: filter [ OK ] iptables: Flushing firewall rules: [ OK ] iptables: Unloading modules: [ OK ] [root@xxgsdb /]# [root@xxgsdb /]# [root@xxgsdb /]# chkconfig --list iptables iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off [root@xxgsdb /]# chkconfig iptables off [root@xxgsdb /]# chkconfig --list iptables iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off 2.安装gateway(透明网关)组件

a) 下载透明网关

Oralce 11g下透明网管是一个单独的组件,需要单独下载安装,这里下载是64位的,请根据具体下载32位或64位,下载地址google搜索一下Oracle Database Gateways或者在oralce官网的Oracle Database Software Downloads找。 b) 安装过程(过程中会创建监听)