–1.LINUX环境中配置ODBC,要gcc环境
查询gcc环境:
[root@shujuqianyi ~]# rpm -aq|grep gcc
gcc-c+±4.4.7-18.el6.x86_64
libgcc-4.4.7-18.el6.x86_64
gcc-4.4.7-18.el6.x86_64
解压 unixODBC包
[root@shujuqianyi ~]# tar -zxvf unixODBC-2.2.14.tar.gz
进入解压目录
[root@shujuqianyi ~]# cd unixODBC-2.2.14
–2.配置ODBC(root)
编译检查
[root@shujuqianyi ~]# ./configure --enable-gui=no
–3.编译ODBC
进行编译ODBC
[root@shujuqianyi ~]# make
安装ODBC
[root@shujuqianyi ~]# make install
–4.查看ODBC版本
[root@shujuqianyi ~]# odbc_config --version
2.2.14
–5.查看ODBC配置文件路径
[root@shujuqianyi ~]# odbc_config --odbcini
/etc/odbc.ini
[root@shujuqianyi ~]# odbcinst -j
unixODBC 2.2.14
DRIVERS…: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES…: /etc/ODBCDataSources
USER DATA SOURCES…: /root/.odbc.ini
SQLULEN Size…: 8
SQLLEN Size…: 8
SQLSETPOSIROW Size.: 8
–6.配置ODBC.INI
[root@shujuqianyi ~]#vi /etc/odbc.ini
[dm]
Desription = DM ODBC DSND
Driver = DM8 ODBC DRIVER
SERVER = localhost
UID = SYSDBA
PWD = SYSDBA
TCP_PORT = 5236
–7.配置odbcinst.ini
[root@shujuqianyi ~]#vi /etc/odbcinst.ini
[DM8 ODBC DRIVER]
Description = ODBC DRIVER FOR DM8
DRIVER = /home/dmdba/dmdbms/bin/libdodbc.so
–8.测试ODBC
su - dmdba
isql dm