温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Linux系统中如何安装Informix

发布时间:2022-01-24 14:55:27 来源:亿速云 阅读:325 作者:清风 栏目:开发技术

这篇“Linux系统中如何安装Informix”文章,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要参考一下,对于“Linux系统中如何安装Informix”,小编整理了以下知识点,请大家跟着小编的步伐一步一步的慢慢理解,接下来就让我们进入主题吧。

Informix是IBM公司出品的关系数据库管理系统(RDBMS)家族。作为一个集成解决方案,它被定位为作为IBM在线事务处理(OLTP)旗舰级数据服务系统。。

Linux系统中如何安装Informix

一、搭建安装环境

1.建立informix用户组和用户

以root身份登陆,然后:

groupadd -g 3000 informix

useradd -u 3000 -g 3000 -d /home/informix -m informix

2.修改环境变量

#su – informix

#cd

#ls -a

#vi .bash_profile

修改为如下:

INFORMIXDIR=/opt/IBM/informix  //informix的安装路径

export INFORMIXDIR

INFORMIXSERVER=informix //informix的服务器

export INFORMIXSERVER

ONCONFIG=onconfig.informix //informix的配置文件名

export ONCONFIG

LD_LIBRARY_PATH=/opt/IBM/informix  //informix的lib库路径

export LD_LIBRARY_PATH

PATH=INFORMIXDIR/bin

export PATH

保存退出之后,修改权限:

#chmod 755 .bash_profile

使以上设定生效

#./.bash_profile

\3. 上传安装文件

(1)设置虚拟机共享文件夹,将安装文件放到共享文件夹中,在linux: /mnt/hgfs下。

(2)以root/informix身份登陆系统,到/mnt/hgfs,解压安装文件:

$tar xvf setupfile.tar  注意文件名不能有空格

4 开始安装

以root身份登陆(我看过网上的很多文档,都是以informix用户登陆来安装,但我以informix身份登陆进行安装的时候,系统提示我需要以root身份来安装)

#cd /mnt/hgfs /Informix/SERVER

执行安装脚本

#./installserver

按提示完成即可。

\5. 配置informix

(1)在informix安装目录/opt/IBM/informix 建立data目录,然后touch一个空文件作为数据库的默认设备,并且修改空文件的权限为660

$ mkdir data

$ cd data

$ touch datadbs.dat

$ chmod 660 datadbs.dat //一定要执行这一步,否则在后续的启动过程中会出错

将data的所有权赋予informix

(2)配置onconfig文件

默认的配置文件在 /opt/IBM/informix/etc/onconfig.std

我们复制一份,并且改其后缀名为之前设定的informix服务器名,此处为 informix

$cd /opt/IBM/informix/etc

$cp onconfig.std onconfig.informix

$vim onconfig.informix

打开之后,我们需要修改的地方有以下几项:

# Root Dbspace Configuration

ROOTNAME    rootdbs  # Root dbspace name    //rootdbs换成datadbs

ROOTPATH   /dev/online_root # Path for device containing root dbspace

      // 把/dev/online_root换成 /opt/IBM/informix/data/datadbs.dat

ROOTOFFSET   0        # Offset of root dbspace into device (Kbytes)

ROOTSIZE    30000      # Size of root dbspace (Kbytes)

# Physical Log Configuration

PHYSDBS rootdbs #      //rootdbs换成 datadbs

PHYSFILE    2000      # Physical log file size (Kbytes)

# System Archive Tape Device

TAPEDEV     /dev/tapedev  # Tape device path   //tapedev换成null

TAPEBLK     32       # Tape block size (Kbytes)

TAPESIZE    10240      # Maximum amount of data to put on tape (Kbytes)

# Log Archive Tape Device

LTAPEDEV    /dev/tapedev  # Log tape device path  //tapedev换成null

LTAPEBLK    32       # Log tape block size (Kbytes)

LTAPESIZE    10240      # Max amount of data to put on log tape (Kbytes)

# System Configuration

DBSERVERNAME          # Name of default database server

//数据库服务器名称,这里设置成和环境变量里的一样 informix

最后,将这个文件中所有的/usr/informix换成 /opt/IBM/informix (informix的安装目录)

可以使用shell脚本命令来完成,在命令行运行

:%s/\/usr\/informix/\/opt\/Informix

要将onconfig.informix的所有权赋予informix

(3) 配置系统服务(需要root权限)

su到root用户

#vim /etc/services

在最后一行,添加如下内容:

informix_services 8888/tcp     #informix server services

(4)配置sqlhosts文件(切换回informix用户)

安装完成后,有个默认的sqlhosts.std文件,在/opt/IBM/informix/etc 目录下

$cd /opt/IBM/informix/etc

$cp sqlhosts.std sqlhosts

$vim sqlhosts

修改为如下内容:

informix    onipcshm    rouse      informix_services

informix    onsoctcp    rouse      informix_services

informix:是数据库服务器名,和环境变量中的一样

onipcshm/onsoctcp:使用的协议名称,连接数据库的两种方式

rouse:主机名,和/etc/hosts里的一样

informix_services:服务名,和/etc/services中的一样

(5)启动informix

修改完所有配置文件之后,重启系统,然后可以尝试启动informix服务器

$ oninit -ivy //第一次启动的时候需加 -ivy参数,以后正常启动时直接 oninit

Checking group membership to determine server run mode…succeeded

Reading configuration file ‘/opt/informix/etc/onconfig.informix’…succeeded

Creating /INFORMIXTMP/.infxdirs…succeeded

Creating infos file “/opt/informix/etc/.infos.informix”…succeeded

Linking conf file “/opt/informix/etc/.conf.informix”…succeeded

Writing to infos file…succeeded

Checking config parameters…succeeded

Allocating and attaching to shared memory…succeeded

Creating resident pool 1380 kbytes…succeeded

Allocating 10016 kbytes for buffer pool of 2K page size…succeeded

Initializing rhead structure…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

Initialization of Encryption…succeeded

Forking main_loop thread…succeeded

Initializing DR structures…succeeded

Forking 1 ‘ipcshm’ listener threads…succeeded

Starting tracing…succeeded

Initializing 1 flushers…succeeded

Initializing log/checkpoint information…succeeded

Opening primary chunks…succeeded

Opening mirror chunks…succeeded

Initializing dbspaces…succeeded

Validating chunks…succeeded

Creating database partition…succeeded

Initialize Async Log Flusher…succeeded

Forking btree cleaner…succeeded

Initializing DBSPACETEMP list…succeeded

Checking database partition index…succeeded

Checking location of physical log…succeeded

Initializing dataskip structure…succeeded

Checking for temporary tables to drop…succeeded

Forking onmode_mon thread…succeeded

Verbose output complete: mode = 5

说明执行成功,如果中间出现error或者warning,我们可以man一下日志文件(/opt/IBM/informix/online.log),来看看是什么问题。

接下来,到/opt/ IBM/informix/data 查看一下datadbs.dat文件的大小,如果不为0,那么说明数据库创建成功。

$ onstat -i

IBM Informix Dynamic Server Version 11.50.UC6   — On-Line — Up 00:06:29 — 28552 Kbytes

说明数据库状态正常

onstat>

说明数据库状态正常,退出 onstat 输入 q 就可以

停止数据库:onmode –ky

什么是Linux系统

Linux是一种免费使用和自由传播的类UNIX操作系统,是一个基于POSIX的多用户、多任务、支持多线程和多CPU的操作系统,使用Linux能运行主要的Unix工具软件、应用程序和网络协议。

以上是“Linux系统中如何安装Informix”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI