免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 8754 | 回复: 4
打印 上一主题 下一主题

Informix ODBC 的配置,烦人啊 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-03-02 17:19 |只看该作者 |倒序浏览
请各位大哥,帮帮忙啊,小弟因这一问题烦得不成样了!
在网上找了很多参考资料,配置信息如下:
Linux (RED Hat 5 server)
informix 11.50.UC3TL.Linux-RHEL4

INFORMIXDIR=/opt/informix
INFORMIXSERVER=demo_on  
INFORMIXSQLHOSTS=/opt/informix/etc/sqlhosts

sqlhosts文件信息:

demo_on         onsoctcp        informix        sqlexec
demo_se         seipcpip        se_hostname     sqlexec

services 文件信息:

sqlexec  1500/tcp

onconfig 文件信息:

(仅贴出我有修改过的部分,别的都是没改变)

ROOTNAME rootdbs
ROOTPATH /home/informix/dbspaces/online_root
ROOTOFFSET 0
ROOTSIZE 200000
MIRROR 0
MIRRORPATH $INFORMIXDIR/tmp/demo_on.root_mirror
MIRROROFFSET 0


MSGPATH /home/informix/logs/online.log
CONSOLE $INFORMIXDIR/tmp/online.con


SERVERNUM 0
DBSERVERNAME demo_on
DBSERVERALIASES

ODBC配置信息如下,
(我有安装了IBM Informix Client-SDK3.0)
window xp C:\WINDOWS\system32\drivers\etc 下的host 有加10.10.9.232    informix(linux server name), service 也有加sqlexec  1500/tcp

IBM Informix Setnet32信息:

Environment:

INFORMIXDIR=C:\Program Files\IBM\Informix\Client-SDK\
INFRORMIXSERVER=demo_on

Server Information

IBM Informix Server: demo_on
HostName:   10.10.9.232
Protocolnamensoctcp
ServiceName:sqlexec

Nost Information:

current host:10.10.9.232
user name :informix
password option :passwrod
password:informix

ILogin  for IBM Informix ....

Server:demo_on
Hostname:10.10.9.232
Servicename: sqlexec
Protocolnamensoctcp
Username:informix
Password:informix
Stores Database:stores7----默认,这一值为空也是一样


可是用ILogin 测试的时候,提示-25580 error

用window ODBC配置的时候提示
Test connection was NOT successful.[Informix ODBC Driver][Informix]System error occurred in network function.

不知道还有什么要配置的吗?还请各位大哥指点一下,小弟先谢了。

[ 本帖最后由 0770_NN 于 2009-3-2 17:24 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2009-03-03 09:01 |只看该作者
看你的配置,乱乱的,我讲下ODBC参数关系

1.原理,ODBC通过开放的特定端口与数据库沟通.既然是端口,必须服务端和客户端都要有!

2.详例: 环境: 服务端:Redhat Linux +Informix 11.5(非se版)<硬件4核单CPU> ,客户端: Windows XP

Linux: 第一条件: shm(共享内存方式)必须先online 起来,然后再添加ODBC相关参数,再重起服务器,看online起来没有,
<注意:在添加ODBC 参数前,记得备份相关配置文件>

配置如下:

</u1/informix/etc> uname -a
Linux tiptop 2.6.18-92.el5xen #1 SMP Tue Apr 29 13:45:57 EDT 2008 i686 i686 i386

</u1/informix/etc> cat onconfig.top|grep 01
DBSERVERNAME    on_shm01
DBSERVERALIASES on_tcp01   # ODBC

</u1/informix/etc> cat onconfig.top|grep 150
NETTYPE         ipcshm,2,150,CPU
NETTYPE         soctcp,1,150,NET #ODBC

</u1/informix/etc> cat sqlhosts|grep tiptop
on_shm01        onipcshm        tiptop          on_shm01_srv
on_tcp01        onsoctcp        tiptop          on_tcp01_srv  #ODBC

</u1/informix/etc> cat /etc/services|grep tcp01
on_tcp01_srv    9902/tcp #ODBC

</u1/informix/etc> netstat -na|grep 9902
tcp        0      0 192.168.1.100:9902           0.0.0.0:*              LISTEN

#上面检查服务器ODBC服务是否起来,如果是如下状态,必须修改/etc/hosts
tcp        0      0 172.0.0.1:9902           0.0.0.0:*              LISTEN

修改:
</etc>cat hosts|grep tiptop
127.0.0.1 tiptop localhost.localdomain   localhost

到:

</etc>cat hosts|grep tiptop
127.0.0.1 localhost.localdomain   localhost
192.168.1.100 tiptop

不明白原因..你看在sqlhost文件里是有引用电脑名'tiptop' 所以必须在linux上让'tiptop'指向真实IP,才能对外服务嘛!


Windows XP: 如果你用的是informix 11.5UC5 匹配的ODBC组件版本:3.50.TC3

C:\WINDOWS\system32\drivers\etc>type services|find "9902"
on_tcp01_srv     9902/tcp

安装后配置Setnet32

Environment:
CLIENT_LOCALE=zh_TW.big5  
DB_LOCALE=zh_TW.big5  
DBLANG=zh_TW.big5
INFORMIXDIR=C:\Program Files\IBM\Informix\Client-SDK\

Server Information:
IBM Informix Server on_tcp01
HostName 192.168.1.100
Protocolname onsoctcp
Service Name on_tcp01_srv

Host Information
Current Host 192.168.1.100
UserName: informix
Password Option: Paaword
Pssword XXX

然后重起电脑!

要使用或测试的话,就必须去控制面板的数据源ODBC,添加一个对象了!

用户DSN:

添加  Informix ODBC
General:
Data Source Name tiptoperp  #起个名字
Connection:
Server Name on_tcp01
Host Name 192.168.1.100
Service on_tcp01_srv
Protocol onsoctcp
Database Name demo7
User Id Informix
Paaword xxxxx

这时不要点Apply&Test Connection #即是点,也出错的!
继续配置:
Enveronment:
Client Locale zh_TW.big5
Database Locale zh_TW.big5
Use Server Database Locale [] 可打可不打,打了的话atabase Locale 变 zh_TW.57352
Translation Library C:\Program Files\IBM\Informix\Client-SDK\bin\igo4n304.dll
# Library 一定要配置,它用来解释ODBC命令的

这时可以回到
Connection:
点Apply&Test Connection

如果出现:
Test connection was successful

恭喜你,成功了!

论坛徽章:
0
3 [报告]
发表于 2009-03-04 11:14 |只看该作者
大哥,不知道你配置的
on_shm01     和on_tcp01
是不同的库吗?
如果我配置成如下:
demo_on onipcshm        informix        sqlexec
demo_tcp        onsoctcp        informix        sqlexec #odbc
或者
demo_on        onsoctcp      informix        sqlexec
的时候demo_on没办法起来,提示
listener-thread: err = -930: oserr = 0: errstr = informix: Cannot connect to database server (informix).(我只有demo_on是server)
只有
demo_on onipcshm        informix        sqlexec
这样才可以启动服务,但是没办法用ODBC连,
我已经安装了sdk3.5版本,会出现908错误

论坛徽章:
11
金牛座
日期:2015-03-19 16:56:22数据库技术版块每日发帖之星
日期:2016-08-02 06:20:00数据库技术版块每日发帖之星
日期:2016-04-24 06:20:00数据库技术版块每日发帖之星
日期:2016-04-13 06:20:00IT运维版块每日发帖之星
日期:2016-04-13 06:20:00数据库技术版块每日发帖之星
日期:2016-02-03 06:20:00数据库技术版块每日发帖之星
日期:2015-08-06 06:20:00季节之章:春
日期:2015-03-27 15:54:57羊年新春福章
日期:2015-03-27 15:54:37戌狗
日期:2015-03-19 16:56:41数据库技术版块每日发帖之星
日期:2016-08-18 06:20:00
4 [报告]
发表于 2009-03-04 11:16 |只看该作者

回复 #3 0770_NN 的帖子

-908    Attempt to connect to database server (servername) failed.

The program or application is trying to access another database server
but has failed. Note the server name in the current statement.

The desired database server is unavailable, or the network is down or
is congested. Ask your DBA and system administrator to verify that the
server and network are operational. If the network is congested, use
the environment variables INFORMIXCONTIME and INFORMIXCONRETRY to tune
connection timing. For information on setting these environment variables,
see the IBM Informix Guide to SQL: Reference.

This message appears in Version 6.0 and later versions.


-930    Cannot connect to database server servername.

The application is trying to access another computer system but failed.
Note the server name in the current statement. Ask your network
administrator and DBA to check that the network is operational and that
the particular database server is active. This message appears with
Version 6.0 and later.


-930    Cannot connect to remote host sitename.

IBM Informix STAR or IBM Informix NET is trying to access another computer
system but has failed. Note the site name in the current statement.
Contact your network administrator, and ask for a check that the
network is operational and that the particular site is active. This
message appears in database servers prior to Version 6.0.

论坛徽章:
0
5 [报告]
发表于 2009-03-04 14:35 |只看该作者
配置services 文件干嘛的呀,怎么我没发现这一端口启动的呢?
我的demo_on 已经启动了,可是我查端口,我的是 9088,
可是没有任何信息呀
好像没起来,要怎么设置吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP