原文: Installing Informix On Linux

Here I'll go through the steps to install the Informix (http://www.informix.com/) RDBMS on Linux.

This guide is based on http://webxpert.wordpress.com/how-to-install-informix-dynamic-server-in-redhat-linux/.

Download Informix

On the informix website go to: Support & Downloads -> Downloads -> Trials and Demos
Under I click on Informix Dynamic Server.
Download either IBM Informix Dynamic Server Express Edition or IBM Informix
Dynamic Server Developer Edition.

Create Informix User and Group

addgroup informix
adduser --ingroup informix informix

Run GUI Installer

Extract the tarball, then as root (with a working X $DISPLAY) run:

./ids_install -i console

Choose /home/informix as the installation path.
Do not create the sample database, it will likely fail anyway, we will do that later.

Configure 'informix' User Environment

Log in as the informix user:

sudo su - informix

Edit the .bashrc and add the following at the bottom:

export INFORMIXDIR=/home/informix
export INFORMIXSERVER=demo_on
export ONCONFIG=onconfig
export INFORMIXTERM=terminfo

Relogin.重新登录,这里目的其实是为了让环境变量生效。

Configure Informix

Copy etc/onconfig.std to etc/onconfig and make the following changes:

--- onconfig.std        2009-04-14 23:02:02.000000000 -0400
+++ onconfig    2010-03-26 04:00:41.000000000 -0400
@@ -40,11 +40,11 @@###################################################################ROOTNAME rootdbs
-ROOTPATH $INFORMIXDIR/tmp/demo_on.rootdbs
+ROOTPATH /home/informix/dbspaces/online_rootROOTOFFSET 0ROOTSIZE 200000MIRROR 0
-MIRRORPATH $INFORMIXDIR/tmp/demo_on.root_mirror
+MIRRORPATH /home/informix/mirrors/root_mirrorMIRROROFFSET 0###################################################################
@@ -123,7 +123,7 @@# CONSOLE      - The path of the IDS console message file###################################################################-MSGPATH $INFORMIXDIR/tmp/online.log
+MSGPATH /home/informix/logs/online.logCONSOLE $INFORMIXDIR/tmp/online.con###################################################################
@@ -198,7 +198,7 @@###################################################################SERVERNUM 0
-DBSERVERNAME
+DBSERVERNAME demo_onDBSERVERALIASES###################################################################
@@ -398,7 +398,7 @@#                positive integral multiple of LTAPEBLK.###################################################################-LTAPEDEV /dev/tapedev
+LTAPEDEV /dev/nullLTAPEBLK 32LTAPESIZE 0

Copy etc/sqlhosts.std to etc/sqlhosts and add the following line:

demo_on         onipcshm        localhost           demo_on

Change localhost to the host name of the machine. (可以通过hostname命令查看服务器name)
Make some directories and files:

cd ~
mkdir dbspaces mirrors logs
cd dbspaces
touch online_root
chmod 660 online_root

Create and start the instance:

oninit -iv

To optionally create a sample database, run dbaccessdemo7 or dbaccessdemo9. (这里没有写错,确实有这两个命令)

Starting and Stopping

To start the instance, run:

oninit

To stop, run:

onmode -ky

An init script I wrote is here:
http://blog.cachemiss.com/articles/Informix%20Init%20Script.pod
至此,你的数据库已经可以在本地使用了。

Create a Database

The sample database is not created with logging, this makes it not very useful for use with e.g. DBD::Informix.
To create a database, first log in as informix and run the dbaccess command.
Go to Database -> Create, type in the name you want; then go to Log -> Buffered_log; then Exit -> Create-new-database .
Configure your User Environment
In your .bashrc or whatever, put:

export INFORMIXDIR=/home/informix
export INFORMIXSERVER=demo_on
export INFORMIXTERM=terminfo
export DBD_INFORMIX_DATABASE=stores_demo
export DELIMIDENT=yexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/informix/lib:/home/informix/lib/esql
export PATH=$PATH:/home/informix/bin

You can now use the dbaccess command as a shell to run SQL queries. Unfortunately, it's a menu-driven program.

Build DBD::Informix for Perl

With the environment set as above, just install DBD::Informix as normally from  CPAN. Or just perl Makefile.PL; make; sudo make install. The DBD_INFORMIX_DATABASE environment variable should be set to a database that exists, you have stores_demo if you ran dbaccessdemo7 or 9.

Verify that it works:

perl -MDBI -le 'my $dbh = DBI->connect("dbi:Informix:stores_demo", "", ""); print for $dbh->selectrow_array("select today from sysmaster:sysdual")'

Replace stores_demo with the name of the logged database you created earlier.

Setting up TCP Connection Support

This information taken from http://database.itags.org/informix/57440/.
Login as the user informix.
Edit etc/onconfig.
Find the DBSERVERALIASES line and change it to:

DBSERVERALIASES hlaghdb_tcp

Edit etc/sqlhosts and add the line:

hlaghdb_tcp    onsoctcp    localhost    informix_tcp

replace localhost with your hostname.
As root, edit /etc/services and add:

informix_tcp   33333/tcp

or whatever port you want to use.
Restart informix:

onmode -ky
oninit

Your DBI DSN becomes:

dbi:Informix:hlaghdb@hlaghdb_tcp

SQL Shell

You can use the dbaccess program to run SQL statements against your DBs, but it's some sort of very cumbersome, ancient terminal GUI.
I use the DBI::Shell CPAN module: http://search.cpan.org/perldoc?DBI::Shell.
Unfortunately DBI::Shell does not have history support, so I use rlwrap to add one.
Putting it all together:

alias informix="rlwrap -a -N -t dumb -i -f ~/.informix_dbish_history -H ~/.informix_dbish_history -s 30000 dbish dbi:Informix:hlaghdb@hlaghdb_tcp"

Statements end with ; like in SQL*Plus, use /quit to quit. Readline uses emacs keybindings by default, but you can change this in your ~/.inputrc.

Linux上安装informix相关推荐

  1. linux上安装mysql,tomcat,jdk

    Linux 上安装 1 安装jdk 检测是否安装了jdk 运行 java –version 若有 需要将其卸载 a)         查看安装哪些jdk rmp –qa |grep java b)   ...

  2. linux下安装sbt_如何在Linux上安装SBT

    linux下安装sbt 介绍 (Introduction) Hi! I am Sanjula, and in this guide I hope to teach you how to install ...

  3. 在Linux上安装QT4

    比起在Windows上安装QT,在Linux上安装QT要容易多了,这都得意于Linux系统的autoconf和automake工具. 1. 将QT的源码包放至到一个目录下,笔者的目录是:/home/k ...

  4. 明明安装了模块,还是出现 错误 ImportError: No module named ‘pandas‘ 原因LINUX上安装了多个python环境,将脚本中python 改为python3问题解

    明明安装了模块,还是出现 错误 ImportError: No module named 'pandas'  原因LINUX上安装了多个python环境,将脚本中python 改为python3问题解 ...

  5. linux上安装redis

    Redis Redis在linux上安装 将redis-3.0.7.tar.gz上传到linux虚拟机上 编译: a)       因为redis是C语言开发,所以需要先编译,在linux上编译需要依 ...

  6. Linux上安装paramiko模块

    Linux上安装paramiko模块 一.paramiko模块作用 paramiko是用python语言写的一个模块,遵循SSH2协议,支持以加密和认证的方式,进行远程服务器的连接.由于使用的是pyt ...

  7. 在linux上安装Filezilla文件传输FTP软件

    在linux上安装Filezilla文件传输FTP软件 1 Filezilla安装方法一:使用apt-get安装 2 Filezilla安装方法二:使用filezilla安装包进行安装 1 Filez ...

  8. 如何在 Linux 上安装服务器管理软件 Cockpit

    如何在 Linux 上安装服务器管理软件 Cockpit Cockpit 是一个自由开源的服务器管理软件,它使得我们可以通过它好看的 web 前端界面轻松地管理我们的 GNU/Linux 服务器.Co ...

  9. kali linux 的ssh服务器,如何在 Kali Linux 上安装 SSH 服务

    目的 我们的目的是 Kali Linux 上安装 SSH(安全 shell). 要求 你需要有特权访问你的 Kali Linux 安装或者 Live 系统. 困难程度 很容易! 惯例 #– 给定命令需 ...

最新文章

  1. OpenCV3.0.0下的视频稳像代码,效果不错哦
  2. muduo之ThreadLocal
  3. gparted在线扩分区大小
  4. 淘宝双12趣味大数据:150万件打底裤被男人买走了;套套销量暴涨50%...
  5. 【lucene】入门级
  6. python socket 接口
  7. Python json.dumps() 自动缩进
  8. c语言char数字转int补位,如何补位??
  9. 【目标检测】目标检测算法-从OverFeat到YOLO
  10. 有关E45: ‘readonly‘ option is set (add!to override)错误的解决方法
  11. adt matlab 加速退化,可靠性加速退化试验
  12. Java单元测试实践-09.Mockito的Stub参数条件
  13. 选择题汇总4(括号里填的答案都是对的,不用管下面那个答案正确与错误,因为作者懒得删了)
  14. 【阿里云IoT+YF3300】7.物联网设备表达式运算
  15. speex进行音频去噪
  16. 集成电路——概念、发展分类和IC卡
  17. 北理工通报方岱宁院士处理结果
  18. android framework 引入jia包
  19. 刁肥宅手笔:纯C语言实现链式队列的相关操作
  20. idea上一步失效:Ctrl+Alt+左箭头 Ctrl+Alt+右箭头

热门文章

  1. 《程序员》杂志试刊一发刊词
  2. 互联网思维(二)——流量时代,私域为王
  3. estore电商网站项目
  4. Hexo如何修改网站图标favicon | Hexo
  5. Html5+js测试题【完整版】
  6. Java基础学习总结记录
  7. css鼠标经过样式记录
  8. 机器视觉相机怎么选型?
  9. spring-cloud-config失败快速响应与重试
  10. android4.4.2 boot,nexus4 4.4.2完美root教程