Document Type | Technical Information
Category | Administration
Applicable Product Version | Tibero 7.2.4
Document Number | TADTI133
Overview
For UNIX-like systems, since there is no ODBC Driver Manager, you must separately install iODBC or unixODBC.
This guide describes how to connect iODBC with Tibero.
Method
Pre-installation Environment Setup
The following the basic environment and check preconditions before installing iODBC.
This document details the test results in the following environment; some commands/options may differ in other UNIX environments.
- Test Environment: Rocky Linux 8.10
- Tibero Binary: tibero7-bin-FS02_PS04-linux64_4.18-303667-20251013015219.tar.gz
- iODBC Driver: libiodbc-3.52.12.tar.gz
1) Check Installed Compiler
You need to check whether a compiler (cc or gcc) is installed.
Depending on the compiler, you must set the CC parameter (compiler parameter) differently before installing iODBC.
Below is how to check if a compiler is installed.
$ gcc -v (or cc -v)
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.rockylinux.org/ --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl --disable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 8.5.0 20210514 (Red Hat 8.5.0-26) (GCC)
2) Client Setup for Library Configuration
-
Run Tibero DB Server
Set up the basic Tibero Client environment for iODBC integration.
Copy the $TB_HOME/client directory located on the Tibero DB Server or the Tibero installation binary (.tar.gz).
[If copying the client directory]
$ cd $TB_HOME
$ scp -r ./client [cleint user]@[IP]:~/tibero7
[If copying the Tibero installation binary]
$ find . -name "tibero*.tar.gz" -exec scp {} [cleint user]@[IP]:~/ \;
-
Run Tibero DB Client
Configure the files received from the DB Server according to the Client environment.
[If copying the client directory]
$ vi ~/.bash_profile
$ scp -r ./client [cleint user]@[IP]:~/tibero7
[If copying the Tibero installation binary]
$ cd ~
$ tar -zxvf tibero7-bin-FS02_PS04-linux64_4.18-303667-20251013015219.tar.gz
$ vi ~/.bash_profile
export TB_HOME=$HOME/tibero7
export TB_SID=tibero
export iODBC_HOME=$HOME/iODBC # iODBC installation location
export PATH=$TB_HOME/bin:$TB_HOME/client/bin:$iODBC_HOME/bin:$PATH
export LD_LIBRARY_PATH=$TB_HOME/client/lib:$iODBC_HOME/lib:$LD_LIBRARY_PATH
[Common steps]
$ cd $TB_HOME/config
$ sh gen_tip.sh
$ vi $TB_HOME/client/config/tbdsn.tbr
tibero=(
(INSTANCE=(HOST=xxx.xxx.xxx.xxx) # IP address of the server you want to connect to
(PORT=8629) # Port of the server you want to connect to
(DB_NAME=TIBERO7DB) # DB NAME of the server you want to connect to
)
)
[If copying the Tibero installation binary, you can delete everything except the client directory, optional]
$ cd $TB_HOME
$ rm -rf ./bin/ ./config/ ./lib/ ./license/ ./nls/ ./scripts/
Check the permissions of the $TB_HOME/client/lib/libtbodbc.so file received from the DB Server.If the file does not have read and execute permissions, you cannot run the driver manager.
$ ls -l $TB_HOME/client/lib/libtbodbc.so
-rwxrwxr-x 1 root root 58306848 Oct 13 11:11 /root/tibero7/client/lib/libtbodbc.so
ODBC Driver Manager Installation
1) Download Installation File
You can download the iODBC installation file by accessing https://iodbc.org/.
Upload the downloaded file to the path of the server where you want to install it.
2) Extract Installation File
$ cd ~
$ tar -xzvf libiodbc-3.52.12.tar.gz
$ mv libiodbc-3.52.12 iODBC_install # Change folder name (optional)
3) Compile and Install iODBC
-
CompileExecution path: $HOME/iODBC_install
If you do not specify the --prefix and --sysconfdir options, the IODB and .ini file paths will be set to /usr/local and /etc, respectively.
Option
Description
Default
--prefix Directory path where iODBC related files will be installed after compilation /usr/local --sysconfdir Directory path for configuration files /etc --with-iodbc-inidir Path for ini files /etc --disable-gui Do not compile GUI interface $ mkdir $HOME/iODBC
$ mkdir $HOME/iODBC/etc
$ cd $HOME/iODBC_install
$ export CC=gcc
$ ./configureODBC \
--sysconfdir=$HOME/iODBC/etc \
--with-iodbc-inidir=$HOME/iODBC/etc \
--disable-gui
$ make
$ make install -
Verify Installation
Execution path: $HOME/iODBC/bin
Check if the installed iODBC bit matches the server. If the server bit of the ODBC Manager is different, you must recompile and reinstall.
If recompilation and reinstallation are required, run make clean before proceeding.
$ cd $HOME/iODBC/bin
$ file iodbctest
iodbctest: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=4bc9e4703f1f6caf031c2b3efceb77b62236e55e, with debug_info, not stripped
-
iODBC Environment Configuration
Set up the Tibero ODBC Driver and data source in the ODBC Driver Manager's environment files.
Before testing the connection, Tibero Client or Server must be installed and the related environment set up.-
ODBC Driver Configuration
You can configure this in $HOME/iODBC/etc/odbc.ini (user setting) or /etc/odbc.ini (system-wide setting).The priority is higher for $HOME/iODBC/etc/odbc.ini.
$ vi $HOME/iODBC/etc/odbc.ini
[ODBC Data Sources]
tibero = Tibero7 ODBC driver # <ODBC Data Sources> = Tibero6 ODBC driver
[ODBC]
Trace = 1
TraceFile = /root/iODBC/tmp/odbc.trace
[tibero] # [<ODBC Data Sources Detailed Setting>]
Driver = /root/tibero7/client/lib/libtbodbc.so
Description = Tibero7 ODBC Datasource
SID = tibero
User = sys
Password = tiberoOption
Description
<ODBC Data Sources> The datasource name, which will be included in the Oracle Gateway configuration file. <ODBC Data Sources Detailed Setting> The name set in ODBC Data Sources must match, including case sensitivity. Driver The Tibero ODBC Driver file loaded by the ODBC Manager. Check for the existence and permissions of this file. SID Alias information set in the tbdsn.tbr file of the Tibero client or server. User Refers to the user. For testing and link creation, the user is handled separately, so this is not significant. Password Refers to the user password. For testing and link creation, the user is handled separately, so this is not significant. -
ODBC Data Source Configuration
$ vi $HOME/iODBC/etc/odbcinit.ini
[Tibero7 ODBC Driver]
Description = ODBC Driver for Tibero7
Driver = /root/tibero7/client/lib/libtbodbc.so
UsageCount = 1
-
-
Check iODBC Manager
Execution path: $HOME/iODBC/bin
Check the installation information of the ODBC Driver and data source through the iODBC manager.
The result displays the contents of your configured odbc.ini and odbcinst.ini files.
$ cd $HOME/iODBC/bin
$ iodbc-config --odbcini --odbcinstini
/root/iODBC/etc/odbc.ini
/root/iODBC/etc/odbcinst.ini -
Connection Test
Execution path: $HOME/iODBC/bin
Perform a connection test using iodbctest.
If there is a problem during testing, check the name, location, and settings of the ODBC environment files.
$ iodbctest "DSN=tibero;UID=sys;PWD=tibero"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.1216.0712
Driver: 07.02.0218 (libtbodbc.so)Option
Description
DSN ODBC Datasource name set in the ODBC environment file UID, PWD Account and password to connect for the test
Installation Errors
The following are error cases that may occur when running iodbctest.
Case 1
This may occur if there is a problem with the libtbodbc.so ($TB_HOME/client/lib/libtbodbc.so) file.
Upload the libtbodbc.so file from another binary to the same path and try the test again.
$ iodbctest "DSN=tibero;UID=sys;PWD=tibero"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.1216.0712
1: SQLDriverConnect = [iODBC][Driver Manager]/home/tibero/tibero7/client/lib/libcommon.so: undefined symbol: MD5 (0) SQLSTATE=00000
2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
Case 2
This may occur if the libtbodbc.so file does not exist at $TB_HOME/client/lib/libtbodbc.so.
Upload the libtbodbc.so file to the correct path and try the test again.
$ iodbctest "DSN=tibero;UID=sys;PWD=tibero"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.1216.0712
1: SQLDriverConnect = [iODBC][Driver Manager]/root/tibero7/client/lib/libtbodbc.so: cannot open shared object file: No such file or directory (0) SQLSTATE=00000
2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003
Case 3
This may occur if the execution permission of the libtbodbc.so file is not valid.
Grant at least read and execute permission to the libtbodbc.so file, then try the test again.
$ iodbctest "DSN=tibero;UID=sys;PWD=tibero"
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.1216.0712
1: SQLDriverConnect = [iODBC][Driver Manager]/root/tibero7/client/lib/libtbodbc.so: cannot open shared object file: Permission denied (0) SQLSTATE-id="336"2: SQLDriverConnect = [iODBC][Driver Manager]Specified driver could not be loaded (0) SQLSTATE=IM003