Installation and Configuration of Oracle Database Gateway For Heterogeneous Databases (MSSQL, MySql & DB2)
Installation and Configuration of Oracle Database Gateway For Heterogeneous Databases (MSSQL, MySql & DB2)
Contents
1
Overview................................................................................................................. 3
3.1
Setup Overview................................................................................................... 3
3.2
3.3
5.1
Setup Overview................................................................................................. 12
5.2
5.3
5.4
5.5
6.1
Setup Overview................................................................................................. 16
6.2
6.3
6.4
6.5
2 | Page
1 Overview
In this document the steps to install and configure Oracle Database Gateway for
MS SQL server are demonstrated.
Setup Overview
Parameters
Database
DB version
Operating
System
Host Name
IP Address
Instance name
Database
Name
3.2
Source System
MS SQL Server
SQL Server 2008
Target System
Oracle Database
11.2.0.3
Windows
Linux 64 bit
SCS-Windows
192.168.1.227
MSSQLSERVER
SCS-Linux
192.168.1.89
orcl
scs
orcl
https://updates.oracle.com/Orion/PatchDetails/process_form?
patch_num=10404530&aru=14255124&release=80112030&plat_lang=23
3P&patch_num_id=1432597&
3.3
Installing Oracle Database Gateway for Microsoft SQL
server
Copy the downloaded zip file into /opt and unzip it.
Unzip the downloaded zip file. It will create
named gateways
Change the directory to gateways and start installer.
directory
cd /opt
unzip p10404530_112030_Linux-x86-64_5of7.zip
cd gateways
3 | Page
./runInstaller
4 | Page
Click next
5 | Page
Click next
6 | Page
7 | Page
8 | Page
# /opt/oraInventory/orainstRoot.sh
Changing permissions of /opt/oraInventory.
Adding read, write permissions for group.
Removing read, write, execute permissions for world.
Changing groupname of /opt/oraInventory to oinstall.
The execution of the script is complete.
# /opt/oracle/product/11.2.0/db_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /opt/oracle/product/11.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.
9 | Page
Modify newly created file initMSSCS.ora and modify or add the MS SQL
server & database name.
HS_FDS_CONNECT_INFO=[192.168.1.227]/MSSQLSERVER/scs
Append existing listener.ora and add following lines to add new listener:
LISTENER_DG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = SCS-Linux)(PORT = 1511))
)
SID_LIST_LISTENER_DG =
(SID_DESC =
(SID_NAME =MSSCS)
(ORACLE_HOME =/opt/oracle/product/11.2.0/db_1)
(ENVS
=LD_LIBRARY_PATH=/opt/oracle/product/11.2.0/db_1/dg4msql/driver/lib:/opt/oracle/product/11.
2.0/db_1/lib)
(PROGRAM=/opt/oracle/product/11.2.0/db_1/bin/dg4msql)
)
)
ADR_BASE_LISTENER_DG = /opt/oracle
tnsping MSSCS
TNS Ping Utility for Linux: Version 11.2.0.3.0 - Production on 07-JAN-2016 10:56:49
Copyright (c) 1997, 2011, Oracle.
Create a new database link pointing to this TNS using SQL Server login
credentials. This username must be already created in the Microsoft SQL
Server database.
SQL> create public database link scs_db connect to "ja" identified by
"ja" using 'MSSCS';
11 | P a g e
Setup Overview
Parameters
Database
DB version
Operating
System
Host Name
IP Address
Instance name
Database
Name
5.2
Source System
MySQL
5.1.66
Target System
Oracle Database
11.2.0.3
Linux 64 bit
Linux 64 bit
Msqlhost
192.168.1.96
-
SCS-Linux
192.168.1.89
orcl
mvrdb
orcl
Create a new directory for both ODBC driver manager and ODBC driver:
$ cd $ORACLE_HOME
$ mkdir app
Copy
the
downloaded
mysql-connector-odbc-5.3.4-linux-el6-x8664bit.tar.gz file to $ORACLE_HOME/app
Install the ODBC driver:
$ cd $ORACLE_HOME/app
$ tar xvzf mysql-connector-odbc-5.3.4-linux-el6-x86-64bit.tar.gz
$ mv mysql-connector-odbc-5.3.4-linux-el6-x86-64bit odbc-5.3.4
12 | P a g e
Check connectivity:
$ export ODBCINI=/opt/oracle/product/11.2.0/db_1/etc/odbc.ini
$ cd /opt/oracle/product/11.2.0/db_1/app/unixODBC-2.3.4/exe
$./isql mysql_srv -v
SQL> select version()
+----------+
| version()|
+----------+
| 5.1.66
|
+----------+
SQLRowCount returns 1
1 rows fetched
SQL>quit
5.3
Open listerner.ora file and add listener (if required) and service name:
cd /opt/oracle/product/11.2.0/db_1/network/admin
13 | P a g e
vi listener.ora
LISTENER_DG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = SCS-Linux)(PORT = 1511))
)
SID_LIST_LISTENER_DG =
(SID_DESC =
(SID_NAME =mvrdb)
(ORACLE_HOME =/opt/oracle/product/11.2.0/db_1)
(ENVS =LD_LIBRARY_PATH=/opt/oracle/product/11.2.0/db_1/app/odbc5.3.4/lib:/opt/oracle/product/11.2.0/db_1/lib)
(PROGRAM=/opt/oracle/product/11.2.0/db_1/bin/dg4odbc)
)
ADR_BASE_LISTENER_DG = /opt/oracle
5.4
14 | P a g e
15 | P a g e
Setup Overview
Parameters
Database
DB version
Operating
System
Host Name
IP Address
Instance name
Database
Name
6.2
Source System
DB2
10.5
Target System
Oracle Database
11.2.0.3
Linux 64 bit
Linux 64 bit
db2host
192.168.1.157
-
SCS-Linux
192.168.1.89
orcl
mvrdb
orcl
Create a new directory for both ODBC driver manager and ODBC driver:
$ cd $ORACLE_HOME
$ mkdir app
IBM
DB2
ODBC
CLI
driver
file
to
Install/uncompress the tar file of ODBC driver. This will create odbc_cli
folder:
$ cd $ORACLE_HOME/app
16 | P a g e
Check connectivity:
$ export ODBCINI=/opt/oracle/product/11.2.0/db_1/etc/odbc.ini
$ cd /opt/oracle/product/11.2.0/db_1/app/unixODBC-2.3.4/exe
$./isql MYDB2 v db2inist [password]
SQL> select count(*) from mvrdb.bank;
+------------+
| 1
|
+------------+
| 654
|
+------------+
SQLRowCount returns -1
1 rows fetched
17 | P a g e
SQL>quit
6.3
Open listerner.ora file and add listener (if required) and service name:
cd /opt/oracle/product/11.2.0/db_1/network/admin
vi listener.ora
LISTENER_DG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = SCS-Linux)(PORT = 1511))
)
SID_LIST_LISTENER_DG =
(SID_DESC =
(SID_NAME =MYDB2)
(ORACLE_HOME =/opt/oracle/product/11.2.0/db_1)
(ENVS
=LD_LIBRARY_PATH=/opt/oracle/product/11.2.0/db_1/app/odbc_cli/clidriver/lib:/opt/oracle/pro
duct/11.2.0/db_1/lib)
(PROGRAM=/opt/oracle/product/11.2.0/db_1/bin/dg4odbc)
)
ADR_BASE_LISTENER_DG = /opt/oracle
6.4
18 | P a g e
HS_DB_NAME=mvrdb
#
# ODBC specific environment variables
set ODBCINI=/opt/oracle/product/11.2.0/db_1/etc/odbc.ini
#
# Environment variables required for the non-Oracle system
#set LD_LIBRARY_PATH=<value>
19 | P a g e