DM8 Linux環境下配置ODBC

LEVEL7發表於2021-08-19

Linux 系統呼叫ODBC驅動,前提條件是作業系統安裝unixODBC環境。

1.     下載unixODBC

What is ODBC?

ODBC is an open specification for providing application developers with a predictable API with which to access Data Sources. Data Sources include SQL Servers and any Data Source with an ODBC Driver.

2.     將附件unixODBC-2.3.9.tar.gz上傳到/usr/local下,執行安裝。

[root@rhel7 local]#  tar -zxvf unixODBC-2.3.9.tar.gz

[root@rhel7 local]#  cd unixODBC-2.3.9/

[root@rhel7 unixODBC-2.3.9]#  ./configure

[root@rhel7 unixODBC-2.3.9]#  make

[root@rhel7 unixODBC-2.3.9]#  make install

3.     檢視作業系統上檢視ODBC版本

[dmdba@rhel7 ~]$  odbc_config --version

2.3.9

4.     檢視ODBC配置檔案存放的位置

[dmdba@rhel7 ~]$  odbc_config --odbcini

/usr/local/etc/odbc.ini

[dmdba@rhel7 ~]$  odbc_config --odbcinstini

/usr/local/etc/odbcinst.ini

5.     修改odbc.ini檔案

[root@rhel7 ~]#  vi /usr/local/etc/odbc.ini

[dm]

Description = DM ODBC DSN

Driver =  DM8 ODBC DRIVER

SERVER = localhost

UID = SYSDBA

PWD = SYSDBA

TCP_PORT = 5236

6.     修改odbcinst.ini檔案

[root@rhel7 ~]#  vi /usr/local/etc/odbcinst.ini

[ DM8 ODBC DRIVER]

Description = ODBC DRIVER FOR DM8

Driver = /dm8/bin/libdodbc.so

7.     測試連線

[dmdba@rhel7 ~]$  isql dm

+---------------------------------------+

| Connected!                            |

|                                       |

| sql-statement                         |

| help [tablename]                      |

| quit                                  |

|                                       |

+---------------------------------------+

SQL>

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31516603/viewspace-2787871/,如需轉載,請註明出處,否則將追究法律責任。

相關文章