Document Type | Technical Information
Field | Interface/Integration
Applicable Product Versions | 6FS07PS, 7FS02, 7FS02PS
Document Number | TIITI001
Overview
This document guides you on how to configure a DBLink from Tibero DB to Oracle.
- Set up Gateway on the Tibero server after installing Oracle Instant Client
- When configuring DBLink from Tibero DB to Oracle, install Oracle Instant Client and set up Gateway on the Tibero server
Method
Pre-check and Configuration
1. listener.ora Configuration (Use the same listener name)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(SID_NAME=orcl)
(ORACLE_HOME=/home/oracle/db/product/11.2.0/dbhome_1)
)
)
LISTENER=
(DESCRIPTION_LIST=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.58.130)(PORT=1521))
)
)
2. tnsnames.ora Configuration
ORA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.130)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
LISTENER_ORA =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.58.130)(PORT = 1521))
3. Restart listener
$ lsnrctl stop $ lsnrctl start
[Tibero Server] Oracle Client Installation
1. Create Oracle Client directory
$ mkdir /home/tibero/oracle $ chmod -R 777 /home/tibero/oracle
2. Install and unzip the Instant Client matching your Oracle version
$ unzip instantclient-basic-linux.x64-19.21.0.0.0dbru.zip
3. Configure .bash_profile for the tibero OS account
$ vi ~/.bash_profile #. Oracle config export ORACLE_HOME=/home/tibero/oracle/instantclient_19_21 export TNS_ADMIN=$ORACLE_HOME/network/admin export NLS_LANG=KOREAN_KOREA.UTF8 #.---- TIBERO config export TB_HOME=/home/tibero/tibero7 export TB_SID=tibero export PATH=.:$TB_HOME/bin:$TB_HOME/client/bin:$JAVA_HOME/bin:$ORACLE_HOME:$PATH export LD_LIBRARY_PATH=$TB_HOME/lib:$TB_HOME/client/lib:$LD_LIBRARY_PATH:$ORACLE_HOME:$LD_LIBRARY_PATH export TBGW_HOME=$TB_HOME/client/gateway
Apply the settings
$ source ~/.bash_profile
4. Create tnsnames.ora file
$ mkdir -p $ORACLE_HOME/network/admin
$ vi $ORACLE_HOME/network/admin/tnsnames.ora
ORA=
(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.58.130)(PORT=1521))
(CONNECT_DATA=
(SERVER=DEDICATED)
(SERVICE_NAME=orcl)
)
)5. Copy Tibero Gateway file to $TBGW_HOME
$ cp $TB_HOME/client/bin/gw4orcl $TBGW_HOME/
Note
Starting from tibero7, the gw4orcl file is provided as a single unified file.
6. Create $TBGW_HOME/oracle/config directory and create tbgw.cfg file
$ mkdir -p $TBGW_HOME/oracle/config $ vi $TBGW_HOME/oracle/config/tbgw.cfg LISTENER_PORT=9999 LOG_DIR=/home/tibero/tibero7/client/gateway/oracle/log LOG_LVL=2
Caution
If LOG_DIR is not set to an absolute path, the gateway may terminate abnormally.
7. Edit tbdsn.tbr file
$ vi $TB_HOME/client/config/tbdsn.tbr
oracle=(
(GATEWAY=
(LISTENER=(HOST=localhost)(PORT=9999))
(TARGET=ORA)
(TX_MODE=GLOBAL)
)
)8. Check Gateway libraries
$ cd $TBGW_HOME $ ls gw4orcl oracle
Verify library linkage
It is necessary to verify that Oracle Instant Client libraries are properly linked.
$ ldd gw4orcl
linux-vdso.so.1 => (0x00007ffc0cf92000)
libclntsh.so.19.1 => /home/tibero/oracle/instantclient_19_21/libclntsh.so.19.1 (0x00007fa2fcd70000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fa2fcb6c000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fa2fc950000)
libm.so.6 => /lib64/libm.so.6 (0x00007fa2fc64e000)
libc.so.6 => /lib64/libc.so.6 (0x00007fa2fc280000)
libnnz19.so => /home/tibero/oracle/instantclient_19_21/libnnz19.so (0x00007fa2fbc07000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00007fa2fb9ed000)
librt.so.1 => /lib64/librt.so.1 (0x00007fa2fb7e5000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007fa2fb5e3000)
libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fa2fb3c9000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa300f7f000)
libclntshcore.so.19.1 => /home/tibero/oracle/instantclient_19_21/libclntshcore.so.19.1 (0x00007fa2fae24000)
9. Run Gateway and verify connection
Start Gateway
$ ./gw4orcl $ ps -ef| grep gw4 tibero 13883 1 0 06:54 ? 00:00:00 ./gw4orcl tibero 35737 10765 0 13:36 pts/0 00:00:00 grep --color=auto gw4
Test DBLink connection
$ tbsql tibero/tmax@oracle tbSQL 7 TmaxTibero Corporation Copyright (c) 2020-. All rights reserved. Connected to ORACLE GATEWAY using oracle. SQL> select * from dual; DUMMY ----- X 1 row selected.