免费注册 查看新帖 |

Chinaunix

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

关于esql/c问题,程序执行连不上数据库 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-12-29 23:10 |只看该作者 |倒序浏览
大家好,

我使用 rhel 4.6 + informix 11.10【自带sdk】 环境

环境变量
INFORMIXDIR=/home/informix
INFORMIXSERVER=jn_dbs
ONCONFIG=onconfig.jn
DBDATE=MDY4*
INFORMIXSQLHOSTS=/home/informix/etc/sqlhosts
export INFORMIXDIR INFORMIXSERVER ONCONFIG INFORMIXSQLHOSTS
INFORMIXC=gcc
INFORMIXCPP=g++
export INFORMIXC INFORMIXCPP

LD_LIBRARY_PATH=$INFORMIXDIR/libINFORMIXDIR/lib/esql
export LD_LIBRARY_PATH

数据库设置:
sqlhost

Jn_dbs onipcshm 192.168.1.132 sqlexe
jn_dbs_tcp onsoctcp 192.168.1.132 sqlexec

onconfig.jn 部分文件如下
--rootdbs路径、空间
  ROOTNAME rootdbs # Root dbspace name
  ROOTPATH /home/informix/dbs/rootdbs # Path for device containing root dbspace
  ROOTOFFSET 0 # Offset of root dbspace into device (Kbytes)
  ROOTSIZE 100000 # Size of root dbspace (Kbytes)
  
  --物理日志的dbs空间,先用rootdbs的20M;
  PHYSDBS rootdbs # Location (dbspace) of physical log
  PHYSFILE 20000 # Physical log file size (Kbytes)
  
  --逻辑日志用默认的
  # Logical Log Configuration
  
  LOGFILES 6 # Number of logical log files
  LOGSIZE 2000 # Logical log size (Kbytes)
  
  --把磁带的东西都改成/dev/null
  TAPEDEV /dev/null # Tape device path
  TAPEBLK 32 # Tape block size (Kbytes)
  TAPESIZE 10240 # Maximum amount of data to put on tape (Kbytes)
  
  # Log Archive Tape Device
  
  LTAPEDEV /dev/null # Log tape device path
  LTAPEBLK 32 # Log tape block size (Kbytes)
  LTAPESIZE 10240 # Max amount of data to put on log tape (Kbytes)
  
  --配置数据库服务器参数,根据自己机器配置的实际情况分配locks和buffers;
  # System Configuration
SERVERNUM        0                # Unique id corresponding to a OnLine instance
DBSERVERNAME                jn_dbs                # Name of default database server
DBSERVERALIASES        jn_dbs_tcp                # List of alternate dbservernames
NETTYPE         ipcshm,1,8,CPU  # Configure poll thread(s) for nettype
NETTYPE         soctcp,1,8,CPU  # Configure poll thread(s) for nettype
DEADLOCK_TIMEOUT        60        # Max time to wait of lock in distributed env.
RESIDENT        0                # Forced residency flag (Yes = 1, No = 0)


编译没问题

运行时错误

错误信息:
** Insufficient host variables to store results.
** FILE: [tuxsql.ec] LINE: [84] TIME: Sat Dec 29 22:54:53 2007
** SQLCODE=[-329]
** ERRMSG:

论坛徽章:
0
2 [报告]
发表于 2007-12-29 23:17 |只看该作者

329信息

-329    Database not found or no system permission.

The database you tried to open is not visible to the database server.
Check the spelling of the name. Possibly the database is located in a
different database server (or network system), and you have omitted to
specify the server name (or site name) with the database name. If you
are sure the database should exist just as you spelled it, your next
step depends on the database server you are using.

If you are using IBM Informix SE, the visible databases are directories
with names in the form dbname.dbs. You must be able to read from and
write to them. The database server looks first in the current working
directory and then in each directory named in the DBPATH environment
variable. The most common cause of this error is an incorrect setting
or no setting for the DBPATH environment variable.

If you are using IBM Informix Dynamic Server, IBM Informix Universal Server, or
IBM Informix OnLine Dynamic Server, the database does not exist as you spelled it.
In some environments, two or more instances of the database server can run at
once and each instance has its own collection of databases. For Version 6.0
and later, the value of the INFORMIXSERVER environment variable determines the
instance of the database server that you use. For Versions 5.1x and earlier,
the ONCONFIG environment variable points to the configuration file that
determines the instance. See your database server administrator if you think
you might be using the wrong instance.

If you are connected to a secondary database server, the database you tried
to open might exist, but is not logged. Databases are required to be logged
to be able to access them on secondary database servers.

论坛徽章:
0
3 [报告]
发表于 2007-12-29 23:19 |只看该作者

数据库权限为 DBA

数据库权限为 DBA

相同用户下可以dbaccess,可以操作
但是运行程序就出现 329 错误,很是奇怪

请各位老大帮吗

论坛徽章:
0
4 [报告]
发表于 2008-06-04 10:53 |只看该作者

回复 #3 ningth 的帖子

我也遇到同样的问题,有高手帮忙看一下吗?

论坛徽章:
0
5 [报告]
发表于 2008-06-16 14:31 |只看该作者
看来搞Informix的高手真是不多了啊

论坛徽章:
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
6 [报告]
发表于 2008-06-16 14:33 |只看该作者

回复 #5 wstar 的帖子

不懂esql,米办法~~

论坛徽章:
0
7 [报告]
发表于 2008-06-16 23:38 |只看该作者
可能方向:
A. EXEC SQL database :dbname; or EXEC SQL connect to :dbname;没有调用或者dbname没给对,调试一下,判断这个语句的sqlca.sqlcode.
B. 程序不是你说的那个用户下运行的,或者程序的属主不对,应该和informix在同一个组,并且你这个用户应该有要操作的数据库的dba(操作要用,如果仅仅是连接可以没有)和connect权限。
C. 环境变量,可能性很小。

论坛徽章:
0
8 [报告]
发表于 2008-06-18 19:21 |只看该作者

回复 #4 reneyangs 的帖子

看样子好像是TUXEDO的中间键环境,你先用esqldemo的程序调通了,记得TUXEDO有自己联INFORMIX的函数库的。

论坛徽章:
0
9 [报告]
发表于 2008-06-19 12:16 |只看该作者
楼主哪里提到用了tuxedo了,我怎么没看见。如果是tuxedo的服务,你需要自己打开数据库,例如再tuxedo的callback函数中加入连接数据库的语句

论坛徽章:
1
射手座
日期:2013-09-30 15:24:05
10 [报告]
发表于 2008-06-20 09:46 |只看该作者
权限的问题
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP