Linux上配置Unix ODBC连接Oracle数据库
Linux上配置Unix ODBC连接Oracle数据库作者:eygle出处:http://blog.eygle.com日期:January 05, 2005Oracle10g前,Oracle并不提供UNIX/Linux下的ODBC驱动,用的最为广泛的是UnixOdbc,UnixOdbc的配置不算复杂,但是如果不顺利的话也会遇到一些问题。今天成功安装配置了UnixO
Linux上配置Unix ODBC连接Oracle数据库
作者:eygle
出处:http://blog.eygle.com
日期:January 05, 2005
Oracle10g前,Oracle并不提供UNIX/Linux下的ODBC驱动,用的最为广泛的是UnixOdbc,UnixOdbc的配置不算复杂,但是如果不顺利的话也会遇到一些问题。
今天成功安装配置了UnixOdbc把步骤总结一下供参考。
UnixOdbc可以在官方站点上下载。
以下是测试及配置步骤:
首先你需要安装Oracle客户端,并且确认网络可达。
1.使用isql进行测试
[root@magic root]# isql
**********************************************
* unixODBC - isql *
**********************************************
* Syntax *
* *
* isql DSN [UID [PWD]] [options] *
* *
* Options *
* *
* -b batch.(no prompting etc) *
* -dx delimit columns with x *
* -x0xXX delimit columns with XX, where *
* x is in hex, ie 0x09 is tab *
* -w wrap results in an HTML table *
* -c column names on first row. *
* (only used when -d) *
* -mn limit column display width to n *
* -v verbose. *
* -lx set locale to x *
* --version version *
* *
* Notes *
* *
* isql supports redirection and piping *
* for batch processing. *
* *
* Examples *
* *
* cat My.sql | isql WebDB MyID MyPWD -w *
* *
* Each line in My.sql must contain *
* exactly 1 SQL command except for the *
* last line which must be blank. *
* *
* Please visit; *
* *
* http://www.unixodbc.org *
* pharvey@codebydesign.com *
* nick@easysoft.com *
**********************************************
[root@magic root]# isql --versio
unixODBC 2.2.10
[root@magic root]# which isql
/usr/bin/isql
2./etc/odbc.ini文件配置
[ODBC Data Sources]
test = Oracle ODBC Driver DSN
[default]
Driver = /usr/local/easysoft/oracle/libesoracle.so
[test]
Driver = /usr/local/easysoft/oracle/libesoracle.so
Description = Oracle
server = 172.16.1.21
ServerType = Oracle
Port = 1521
User = username
Password = password
Database = ava
SID = ava
METADATA_ID = 0
ENABLE_USER_CATALOG = 1
ENABLE_SYNONYMS = 1
[default]
Driver = /usr/local/easysoft/oracle/libesoracle.so
3. /etc/odbcinst.ini 文件配置
;
; odbcinst.ini
;
[test]
Description=ODBC for ORACLE
Driver = /usr/local/easysoft/oracle/libesoracle.so
[ODBC]
Trace=1
Debug=1
Pooling=No
4.sqlnet.ora文件配置
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
5.tnsnames.ora文件配置
ava = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.18.21)(PORT = 1521)) ) (CONNECT_DATA = (SID = ava) ) ) |
6.测试
[root@magic admin]# isql test -v +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> |
7.启动LDAP
|
启动成功.
更多推荐
所有评论(0)