You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CentOS7下Informix 12.10执行oninit -v报错bad INFORMIXSERVER求助

Troubleshooting 'bad INFORMIXSERVER' Error on Informix 12.10 (CentOS 7)

Let’s walk through the most common fixes for this frustrating error—this is a classic misconfiguration issue, so we’ll start with the basics and work our way up:

1. Verify Your Environment Variables

First, make sure your core Informix environment variables are set correctly, and that you’re running commands as the right user:

  • Switch to the dedicated informix user (created during installation) with su - informix—root doesn’t have the correct environment set by default.
  • Run echo $INFORMIXSERVER to check if the value matches the server name you defined in your config files.
  • Confirm other critical variables are set:
    • INFORMIXDIR: Should point to your Informix installation path (e.g., /opt/informix)
    • PATH: Must include $INFORMIXDIR/bin
    • INFORMIXSQLHOSTS (optional): If set, it should point directly to your sqlhosts file (default is $INFORMIXDIR/etc/sqlhosts)

2. Check the sqlhosts File Configuration

The sqlhosts file maps your server name to connection details—this is where mismatches often happen:

  • Open $INFORMIXDIR/etc/sqlhosts and look for an entry matching your INFORMIXSERVER value. The format should be:
    <server_name> <connection_type> <host> <service/port>
    
    Example entry:
    my_infx_server onsoctcp localhost infx_1210_port
    
  • Critical note: <server_name> must match INFORMIXSERVER exactly—Informix is case-sensitive here!
  • Ensure the service/port in the entry exists in /etc/services (e.g., infx_1210_port 9088/tcp) or use a direct port number instead of a service name.

3. Match onconfig File Settings

Your onconfig file defines server-level parameters, and it needs to align with your server name:

  • Locate your onconfig file (default is $INFORMIXDIR/etc/onconfig, or onconfig.<server_name> if you created a custom one).
  • Check the DBSERVERNAME parameter—this must be identical to INFORMIXSERVER and the server name in sqlhosts.
  • If you’re using a custom onconfig file, specify it explicitly when starting the server:
    oninit -v -c $INFORMIXDIR/etc/onconfig.my_infx_server
    

4. Validate File Permissions

Informix needs proper access to its configuration files and temp directories:

  • Ensure the informix user has read/write permissions on $INFORMIXDIR/etc/sqlhosts, $INFORMIXDIR/etc/onconfig, and all subdirectories of $INFORMIXDIR.
  • Check /tmp permissions—Informix creates temporary files here, so run chmod 1777 /tmp if needed to ensure global read/write with sticky bit.

5. Test Basic Connectivity

Once you’ve adjusted settings, test if the configuration works:

  • Run dbaccess -l to list available servers. If this succeeds, your INFORMIXSERVER is correctly recognized.
  • If oninit -v still fails, check the online log ($INFORMIXDIR/tmp/online.log) for more detailed error messages—this often reveals specific misconfigurations the initial error doesn’t mention.

Most of the time, this error boils down to a simple mismatch between INFORMIXSERVER, sqlhosts, and onconfig settings. Double-check case sensitivity first—this is the #1 culprit!

内容的提问来源于stack exchange,提问作者Matias Barrios

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:32:08