知识屋:更实用的电脑技术知识网站
所在位置:首页 > 操作系统 > linux

redhat5下安装informix

发布时间:2014-09-05 17:07:32作者:知识屋

 

操作系统:Red Hat Enterprise LinuxServer release 5.5

informix版本:Informix_Ultimate_11.70.UC3_LIN_x86_32_FixPack.tar

把本机IP和hostname写到/etc/hosts里。

1.创建informix用户和组

[root@informix ~]# groupadd -g 1000 informix

[root@informix ~]# useradd -u 1000 -g informix  -m informix

[root@informix ~]# passwd informix

Changing password for user informix.

New UNIX password:

BAD PASSWORD: it is based on a dictionary word

 Retype new UNIX password:

 passwd: all authentication tokens updated successfully

[root@informix ~]# id informix

uid=1000(informix) gid=1000(informix) groups=1000(informix)

2.解压文件

[root@informix ~]# mkdir /usr/informix            #数据库安装目录

[root@informix ~]#chown informix:informix /usr/informix

[root@informix ~]#tar xvf  Informix_Ultimate_11.70.UC3_LIN_x86_32_FixPack.tar  -C /usr/informix/insta

3.安装软件:

由于informix默认会把软件安装到/opt/IBM/informix下,要更改目录可以在安装的时候更改也可以安装前更改

安装前设置安装目录:

export INFORMIXDIR=/usr/informix

以下操作以root用户执行:

1) 进入软件目录执行安装程序ids_install

[root@informix insta]# ./ids_install

 

4.配置

1)设置环境变量

以informix 用户身份登录

[root@informix ~]# su - informix

[informix@informix ~]$vi ids.env       #将以下命令行(总计3行)添加到ids.env 文件:

export INFORMIXDIR=/usr/informix

export INFORMIXSERVER=demo_on

export PATH=$INFORMIXDIR/bin:$PATH

 

[informix@informix ~]$vi .bash_profile            #在后面加上

INFORMIXDIR=/usr/informix

INFORMIXSERVER=informix

PATH=$PATH:$HOME/bin:$INFORMIXDIR/bin

export PATH INFORMIXDIR INFORMIXSERVER

2)使设置环境生效:

[informix@informix ~]$. ./ids.env

[informix@informix ~]$ source .bash_profile

3)配置onconfig和sqlhosts

cd /$INFORMIXDIR/etc/

cp onconfig.std onconfig

cp sqlhosts.std sqlhosts

 

vi onconfig

ROOTNAME rootdbs

ROOTPATH /usr/informix/dbspaces/rootdbs

MSGPATH /usr/informix/log/online.log

SERVERNUM 1

DBSERVERNAME informix

SHMBASE 0x10000000L

TAPEDEV /dev/null

DBSPACETEMP     tmpdbs

 

[informix@informix ~]$mkdir /usr/informix/dbspaces

[informix@informix ~]$mkdir /usr/informix/log

[informix@informix ~]$cd /usr/informix/dbspaces/

[informix@informix ~]$touch rootdbs

[informix@informix ~]$chmod 660 rootdbs

[informix@informix ~]$cd $INFORMIXDIR/tmp

[informix@informix ~]$touch tmpdbs

[informix@informix ~]$chmod 660 tmpdbs

 

vi sqlhosts      #尾行加

informix  onsoctcp         informix.hans.comsqlexec

 

[informix@informix ~]#vi /etc/services

sqlexec    9999/tcp

5.启动和关闭数据库

1)启动

[informix@informix ~]$oninit -ivy

启动时报:

shmget: [EEXIST][17]: key 52564801: shared memory already exists

日志信息:

10:50:13  IBM Informix Dynamic Server Started.

10:50:13  shmget: [EEXIST][17]: key 52564801: shared memory already exists

10:50:13  mt_shm_init: can't create resident segment

我的网上搜的解决方法:

NETTYPE          # Configure poll thread(s) for nettype ->暂时不设

#NETTYPE         tlitcp,1,20,NET # Configure poll thread(s) for nettype

 

NUMCPUVPS       1              # Number of user (cpu) vps ->暂时改为1

 

BUFFERS         10000           # Maximum number of shared buffers  ->暂时减小10倍为10000

CKPTINTVL       3600               # Check point interval (in sec)   ->这个设置成3600先。

oninit -ivy前请先用ipcs检查下是否有informix用户占用了内存段。

但NUMCPUVPS和BUFFERS 在onconfig文件里没有找到。

同时我又把SERVERNUM 设置为1,但我在另一个安装好的库上看到这个没有设置值

这次启动成功。

[informix@informix ~]$oninit -ivy

Reading configuration file '/usr/informix/etc/onconfig'...succeeded

Creating /INFORMIXTMP/.infxdirs...succeeded

Checking config parameters...succeeded

Allocating and attaching to shared memory...succeeded

Creating resident pool 10596 kbytes...succeeded

Allocating 100016 kbytes for buffer pool of 2K page size...succeeded

Creating infos file "/usr/informix/etc/.infos.informix"...succeeded

Linking conf file "/usr/informix/etc/.conf.informix"...succeeded

Initializing rhead structure...succeeded

Writing to infos file...succeeded

Initialization of Encryption...succeeded

Initializing ASF...succeeded

Initializing Dictionary Cache and SPL Routine Cache...succeeded

Bringing up ADM VP...succeeded

Creating VP classes...succeeded

Onlining 0 additional cpu vps...succeeded

Onlining 2 IO vps...succeeded

Forking main_loop thread...succeeded

Initializing DR structures...succeeded

Forking 1 'ipcshm' listener threads...succeeded

Starting tracing...succeeded

Initializing 8 flushers...succeeded

Initializing SDS Server network connections...succeeded

Initializing log/checkpoint information...succeeded

Initializing dbspaces...succeeded

Opening primary chunks...succeeded

Opening mirror chunks...succeeded

Validating chunks...succeeded

Initialize Async Log Flusher...succeeded

Starting B-tree Scanner...succeeded

Initializing DBSPACETEMP list...succeeded

Init ReadAhead Daemon...succeeded

Checking database partition index...succeeded

Initializing dataskip structure...succeeded

Checking for temporary tables to drop...succeeded

Updating Global Row Counter...succeeded

Forking onmode_mon thread...succeeded

Creating periodic thread...succeeded

Starting scheduling system...succeeded

Verbose output complete: mode = 5

 

运行测试程序:dbaccessdemo7

2)关闭

[informix@informix ~]$onmode -ky

 

关闭数据后又重新启动时又报错

日志信息:

14:47:39  IBM Informix Dynamic Server Started.

 

Tue Aug  2 14:47:40 2011

 

14:47:40  Event alarms enabled.  ALARMPROG = '/usr/informix/etc/alarmprogram.sh'

14:47:40  Booting Language <c> from module <>

14:47:40  Loading Module <CNULL>

14:47:40  Booting Language <builtin> from module <>

14:47:40  Loading Module <BUILTINNULL>

14:47:46  DR: DRAUTO is 0 (Off)

14:47:46  DR: ENCRYPT_HDR is 0 (HDR encryption Disabled)

14:47:46  IBM Informix Dynamic Server Version 11.70.UC3 Software Serial Number AAA#B000000

14:47:46  DISK INITIALIZATION ABORTED: potential instance overwrite detected.

To disable this check, set FULL_DISK_INIT to 1 in your config file and retry.

 

14:47:46  oninit: Fatal error in shared memory initialization

 

14:47:46  IBM Informix Dynamic Server Stopped.

 

14:47:46  mt_shm_remove: WARNING: may not have removed all/correct segments

网上给的解决方法:

在11.70中加入了FULL_DISK_INIT 这个参数,对当前已经初始化的dbspace进行保护,若是需要初始化dbspace,需要更改这个参数为1 .

 只要初始化成功了,该参数就自动变为0.

以后启动就不需要使用-i 这个命令了,直接使用oninit -vy 就行了。-i 只需要在第一次初始化的时候使用。。

设置成1启动成功。

 

创建数据库:

1、使用dbaccess进入informix交互环境

2、选择Database,回车

3、选择Create,回车

4、输入数据库名:hans,回车

5、选择Dbspace(表空间)  ,回车

6、选择跟局数据数据库bureaudb一样的表空间,回车

7、选择Log ,回车

8、选择Log,回车(选择日志模式,其他不支持事务)

9、选择Exit,回车

10、选择Create-new-database ,回车。

此时数据库应该已经建立。

查看某个数据库的表空间:

       1、使用dbaccess进入informix交互环境

       2、选择Database,回车

       3、选择Select,回车

       4、选择局数据数据库bureaudb,回车

       5、选择Info,回车

       6、选择dBSpace,回车

 

本文出自 “linux管理” 博客

(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜