温馨提示×

informix在ubuntu怎重启

小樊
42
2026-09-26 12:29:26
栏目: 智能运维

在 Ubuntu 上重启 IBM Informix 数据库,通常取决于它是以 服务方式 还是 手动方式 启动的。下面给你几种常见做法。


一、确认 Informix 是否以系统服务方式运行

1. 查看服务状态

systemctl status informix

或

service informix status

如果看到类似:

● informix.service - IBM Informix Database Server

说明是 systemd 服务。


二、通过 systemd 重启(推荐)

重启 Informix

sudo systemctl restart informix

仅停止 / 启动

sudo systemctl stop informix
sudo systemctl start informix

三、使用 Informix 自带脚本(常见方式)

很多 Informix 安装使用 $INFORMIXDIR 下的脚本。

1. 切换到 informix 用户

su - informix

2. 使用 onmode 关闭

onmode -ky

3. 启动数据库

oninit -vy

-v 显示过程,-y 自动确认


四、环境变量检查(很重要)

Informix 启动依赖环境变量,确保已加载:

export INFORMIXDIR=/opt/ibm/informix
export INFORMIXSERVER=ol_informix
export PATH=$INFORMIXDIR/bin:$PATH
export ONCONFIG=onconfig.ol_informix

通常 informix 用户的 .bash_profile 或 .profile 里已经配置。


五、常见问题

1. 重启报错:shared memory not removed

onclean -ky
oninit -vy

2. 查看当前实例状态

onstat -

六、总结(最常用)

系统服务方式:

sudo systemctl restart informix

手动方式:

su - informix
onmode -ky
oninit -vy

如果你能告诉我:

  • Informix 版本(如 12.10 / 14.10)
  • 是否使用 systemd
  • 安装路径(如 /opt/ibm/informix)

我可以给你更精确的重启命令。

0 踩