Document Type | Technical Information
Field | Installation
Applicable Product Versions | 7FS01, 7FS02, 7FS02PS
Document Number | TINTI011
Overview
This document describes the method of integrating Tibero with Oracle DBLINK by installing the Gateway provided by Tibero on the Oracle server when using DBLINK from Tibero to Oracle DB.
There are two methods for installing the Gateway when using Tibero to Oracle DBLINK, and this guide covers the second method.
- Install Gateway on the Tibero server
- Install Gateway on the Oracle server
Note
This post was written based on Tibero 7 and Oracle 12c.
Method
1. [Oracle Server] Set Up Gateway Execution Environment
Copy the gateway provided by Tibero to the Oracle server.
$ mkdir tibero $ cd tibero $ ls gw4orcl_12c
Check the required libraries.
$ ldd gw4orcl_12c linux-vdso.so.1 (0x00007ffed11b1000) libclntsh.so.12.1 => /home/oracle/db/product/12.1.0/dbhome_1/lib/libclntsh.so.12.1 (0x00007fd226c79000) libm.so.6 => /lib64/libm.so.6 (0x00007fd2268f7000) libnnz12.so => /home/oracle/db/product/12.1.0/dbhome_1/lib/libnnz12.so (0x00007fd2261ae000) libdl.so.2 => /lib64/libdl.so.2 (0x00007fd225faa000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fd225d8a000) libons.so => /home/oracle/db/product/12.1.0/dbhome_1/lib/libons.so (0x00007fd225b3c000) libclntshcore.so.12.1 => /home/oracle/db/product/12.1.0/dbhome_1/lib/libclntshcore.so.12.1 (0x00007fd22556f000) libipc1.so => /home/oracle/db/product/12.1.0/dbhome_1/lib/libipc1.so (0x00007fd22513c000) libmql1.so => /home/oracle/db/product/12.1.0/dbhome_1/lib/libmql1.so (0x00007fd224ec5000) libc.so.6 => /lib64/libc.so.6 (0x00007fd224b00000) libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fd2248e7000) librt.so.1 => /lib64/librt.so.1 (0x00007fd2246df000) libaio.so.1 => /lib64/libaio.so.1 (0x00007fd2244dc000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fd2242c5000) /lib64/ld-linux-x86-64.so.2 (0x00007fd22a713000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd2240ad000)
2. [Oracle Server] Add TBGW_HOME Environment Variable and Run Gateway
$ vi ~/.bash_profile ------------------------------------ # Tibero export TB_HOME=/home/oracle/tibero export TBGW_HOME=$TB_HOME/client/gateway ------------------------------------
Create the tbgw.cfg file.
$ cd /home/oracle/tibero/client/gateway/oracle/config $ mkdir config $ cd config/ $ vi tbgw.cfg ------------------------------------ LISTENER_PORT=9999 LOG_DIR=/home/oracle/tibero/client/gateway/oracle/log LOG_LVL=2 ------------------------------------
Run the gateway.
$ ./gw4orcl_12c $ ps -ef | grep gw4orcl_12c oracle 3723 1 0 14:01 ? 00:00:00 ./gw4orcl_12c oracle 3739 1529 0 14:01 pts/0 00:00:00 grep --color=auto gw4orcl_12c
3. [Tibero Server] Connection Settings
Tibero connection settings are configured via the tbdsn.tbr file located at $TB_HOME/client/config/tbdsn.tbr.
$ vi tbdsn.tbr ------------------------------------ # Enter the IP of the server where the gateway exists for LISTENER info oracle_remote=( (GATEWAY= (LISTENER=(HOST=192.168.11.11)(PORT=9999)) (TARGET=ORA) (TX_MODE=GLOBAL) ) ) ------------------------------------
Environment variables are configured through the /home/{Tibero OS User}/.bash_profile file.
#---- TIBERO ENV export TB_HOME=/home/tibero/tibero6 export TB_SID=tibero export PATH=.:$TB_HOME/bin:$TB_HOME/client/bin:$JAVA_HOME/bin:$PATH export LD_LIBRARY_PATH=$TB_HOME/lib:$TB_HOME/client/lib:$LD_LIBRARY_PATH
4. [Tibero Server] Create DBLink and Connect
Connect using the User/Password existing on Oracle as an alias.
$ tbsql tibero/tmax@oracle_remote tbSQL 6 TmaxData Corporation Copyright (c) 2008-. All rights reserved. Connected to ORACLE GATEWAY using oracle_remote. SQL> select table_name from user_tables; TABLE_NAME -------------------------------------------------------------------------------- T REGIONS COUNTRIES LOCATIONS 4 rows selected.
Create a DBLINK and connect.
SQL> create database link tibero_link connect to tibero identified by 'tmax' using 'oracle_remote'; Database Link 'TIBERO_LINK' created. SQL> select * from dual@tibero_link; DUMMY ----- X 1 row selected.
5. English/Korean Query Test
Below is the query result for English data.
SQL> select * from en@ora_remote; NAME ---------- JY TEST DATA 3 rows selected.
Below is the query result for Korean data.
SQL> select * from hangul@ora_remote; NAME ---------- ํ๊ธ ๋ฐ์ดํฐ ํ ์คํธ 3 rows selected.