标签:
确保之前已装好ORACLE和ODBC,ODBC连接数据库时会出现几个问题 一、登陆oracle并启动 [root@bunsol:/export]$su - oracle Oracle Corporation SunOS 5.10 Generic Patch January 2005 [oracle@bunsol:/export/home/oracle]$sqlplus / as sysdba SQL*Plus: Release 10.2.0.2.0 - Production on Thu Jul 9 11:01:34 2015 Copyright (c) 1982, 2005, Oracle. All Rights Reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 583008256 bytes Fixed Size 1281480 bytes Variable Size 159384120 bytes Database Buffers 415236096 bytes Redo Buffers 7106560 bytes Database mounted. Database opened. SQL> quit 二、打开数据库监听 [oracle@bunsol:/export/home/oracle]$lsnrctl start LSNRCTL for Solaris: Version 10.2.0.2.0 - Production on 09-JUL-2015 11:02:17 Copyright (c) 1991, 2005, Oracle. All rights reserved. Starting /opt/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait... 三、监听打开后我们使用网络方式登入 [oracle@bunsol:/export/home/oracle]$sqlplus / nolog SQL> conn scott/tiger@127.0.0.1/orcl Connected. 四、/usr/local/etc相关配置 [oracle@bunsol:/usr/local/etc]$ls ODBCDataSources odbc.ini odbcinst.ini odbc.ini ------------------------ [Easysoft ODBC-Oracle WP] Description=Easysoft Oracle ODBC WP Driver [ORCL] driver = Easysoft ODBC-Oracle WP description = Easysoft Oracle ODBC WP driver server = localhost port = 1521 sid = orcl user = scott password = tiger logging = No logfile = enable_user_catalog = yes enable_synonyms = yes metadata_dont_change_case = no metadata_dont_do_schema = no metadata_id = no limit_long = 0 -------------------------------------------------------------------------------- odbcinst.ini ------------------------ [Easysoft ODBC-Oracle WP] Description=Easysoft Oracle ODBC WP Driver Driver=/usr/local/easysoft/oraclewp/lib/libesorawp.so Setup=/usr/local/easysoft/oraclewp/lib/libesorawpS.so Threading=0 FileUsage=1 DontDLClose=1 UsageCount=1 -------------------------------------------------------------------------------- 五、ODBC连接数据库出现第一个错 [oracle@bunsol:/usr/local/etc]$isql -v ORCL [01000][unixODBC][Driver Manager]Can‘t open lib ‘/usr/local/easysoft/oraclewp/lib/libesorawp.so‘ : file not found [ISQL]ERROR: Could not SQLConnect 解决办法: 在/etc/profile中加入相关库的路径,可先用ldd /usr/local/easysoft/oraclewp/lib/libesorawp.so查看差哪些 然后,在根目录下搜索即可(之前都装好了,库文件应该都会有的),然后再次查看,确保结果如下: [oracle@bunsol:/export/home/oracle]$ldd /usr/local/easysoft/oraclewp/lib/libesorawp.so 警告:ldd: /usr/local/easysoft/oraclewp/lib/libesorawp.so: 是不可执行的 libodbcinst.so.1 => /usr/local/easysoft/unixODBC/lib//libodbcinst.so.1 libessupp.so => /usr/local/easysoft/lib//libessupp.so libeslicshr.so => /usr/local/easysoft/lib//libeslicshr.so libesextra.so => /usr/local/easysoft/lib//libesextra.so libsocket.so.1 => /usr/lib/libsocket.so.1 libnsl.so.1 => /usr/lib/libnsl.so.1 libdl.so.1 => /usr/lib/libdl.so.1 libthread.so.1 => /usr/lib/libthread.so.1 libc.so.1 => /usr/lib/libc.so.1 libmp.so.2 => /usr/lib/libmp.so.2 libmd.so.1 => /usr/lib/libmd.so.1 libscf.so.1 => /usr/lib/libscf.so.1 libdoor.so.1 => /usr/lib/libdoor.so.1 libuutil.so.1 => /usr/lib/libuutil.so.1 libgen.so.1 => /usr/lib/libgen.so.1 libm.so.2 => /usr/lib/libm.so.2 六、ODBC连接数据库出现第二个错 [oracle@bunsol:/export/home/oracle]$isql -v ORCL [S1000][unixODBC][Easysoft][ODBC-ORACLE WP Driver][ORACLE]General error: General error: Failed to initialise licensing - No valid licenses for this product found, return code 9 [ISQL]ERROR: Could not SQLConnect 解决办法: 这是没有相关许可造成的,有两种方式拿到许可,一种在线一种离线,这里建议并使用在线方式,要注册账号。 1.首先配置下网卡,确保可以上网 # ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000803<UP,BROADCAST,MULTICAST,IPv4> mtu 1500 index 2 inet 192.168.31.100 netmask ffffff00 broadcast 192.168.31.255 ether 0:1f:16:c:8b:d6 # ifconfig e1000g0 plumb ifconfig: SIOCSLIFNAME for ip: e1000g0: already exists # ifconfig e1000g0 192.168.71.222 netmask 255.255.255.0 up # route add default 192.168.71.1 add net default: gateway 192.168.71.1 # ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2 inet 192.168.71.222 netmask ffffff00 broadcast 192.168.71.255 ether 0:1f:16:c:8b:d6 # ping 8.8.8.8 8.8.8.8 is alive 2.开始配置,启动成功 #cd /usr/local/easysoft/license/ #./licenses 接下来会出现几个选项我这里是三个,选择所安装的产品[2] [2]Oracle ODBC Driver(WP) v1.1 然后输入你注册的信息,输完后依次回车即可(看好提示一步一步走就行),没有的直接回车。 完成后自动会得到秘钥,选择automatically自动处理就好,自己什么都不做。 选择自动获取秘钥即可 cle@bunsol:/export/home/oracle]$isql -v ORCL +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> 官网获取许可详细说明文档:ftp://ftp.easysoft.com/pub/docs/licensing/edalicensing.pdf SOLARIS网络配置参考:http://www.cnblogs.com/jdonson/archive/2011/04/28/2031946.html 官网在线帮助文档:http://www.easysoft.com/support/kb/products/odbc_oracle_driver/
Solaris-[ODBC-ORACLE WP Driver]遇到的几个问题
标签:
原文地址:http://www.cnblogs.com/luoxiang/p/4635556.html