码迷,mamicode.com
首页 > 其他好文 > 详细

informix安装

时间:2015-05-20 02:16:33      阅读:424      评论:0      收藏:0      [点我收藏+]

标签:20150520

技术分享

搜索

Linux Redhat下安装Informix11.7 --详细操作




Linux Redhat下安装Informix11.7 --详细操作

本文详细描述在Linux Redhat下安装Informix11.7,如何准备裸设备,以及快速初始化Informix数据库。创建必要的dbspace。

本文目标是在Redhat下安装Informix11.7版本,并创建数据库实例demoserver,并采用裸设备raw device作为chunk。实例包含rootdbs,plogdbs,llogdbs,2个临时表空间tmpdbs01,tmpdbs02以及6个数据表空间datadbs01--datadbs06。并创建一个数据库testdb。

将Informix安装过程分成如下7个步骤:

1.创建用户
2.创建裸设备
3.安装Informix软件
4.初始化Informix实例
5.创建表空间dbspace
6.简单配置数据库参数
7.创建数据库testdb

如下为具体操作过程:


--------------------------------------------------------------------------------------------------------
1.创建用户并设置用户环境
--------------------------------------------------------------------------------------------------------
1.1. 创建用户
创建informix用户组,并创建informix用户,并设置informix用户密码。

groupadd  informix
useradd -g informix -d /opt/informix -s /bin/bash -m informix
passwd informix

1.2. 修改informix用户环境变量

设置informix用户环境变量, 设置:INFORMIXSERVER,INFORMIXDIR, ONCONFIG,INFORMIXSQLHOSTS,PATH,TERMCAP等informix实例相关环境变量。

$ cd /opt/informix
 $ vi .bashrc 
 #Define the env for INFORMIX
 ######################################################
 INFORMIXSERVER=demoserver
 INFORMIXDIR="/opt/informix"
 ONCONFIG=onconfig.demoserver
 INFORMIXSQLHOSTS="/opt/informix/etc/sqlhosts.demo"
 PATH=${INFORMIXDIR}/bin:.:/usr/bin:${PATH}
 export INFORMIXSERVER INFORMIXDIR ONCONFIG INFORMIXSQLHOSTS PATH
 GL_DATE="%m/%d/%iy"
 DATETIME="%iY-%m-%d %H:%M:%S"
 export GL_DATE DATETIME
 LD_LIBRARY_PATH=${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql:${INFORMIXDIR}/lib/cli:${INFORMIXDIR}}/extend/TimeSeries.4.01.FC8/lib
 export LD_LIBRARY_PATH
 TERM=vt100
 export TERM
 export TERMCAP=${INFORMIXDIR}/etc/termcap
 export INFORMIXTERM=termcap

---------------------------------------------------------------------------------------------------------

2.创建裸设备
--------------------------------------------------------------------------------------------------------

在Redhat下准备informix所需要的裸设备,一共11个裸设备。1个400M的作为rootdbs,其他10个作为其他dbspaces所用。数量和具体大小,可根据实际数据库情况进行确定。


Linux Redhat下创建裸设备分成如下小步骤。

使用目前已有vg: vg_sgr下的free space来创建lv,生产raw device。

2.1 创建lv


lvcreate -L 400M -n lv400m vg_sgr  

lvcreate -L 2G -n lv2g_1 vg_sgr  

lvcreate -L 2G -n lv2g_2 vg_sgr  

lvcreate -L 2G -n lv2g_3 vg_sgr  

lvcreate -L 2G -n lv2g_4 vg_sgr  

lvcreate -L 2G -n lv2g_5 vg_sgr  

lvcreate -L 2G -n lv2g_6 vg_sgr  

lvcreate -L 2G -n lv2g_7 vg_sgr  

lvcreate -L 2G -n lv2g_8 vg_sgr 

lvcreate -L 2G -n lv2g_9 vg_sgr  

lvcreate -L 2G -n lv2g_10 vg_sgr

lvcreate -L 2G -n lv2g_11 vg_sgr  

lvcreate -L 2G -n lv2g_12 vg_sgr  

lvcreate -L 2G -n lv2g_13 vg_sgr  

lvcreate -L 2G -n lv2g_14 vg_sgr  

lvcreate -L 2G -n lv2g_15 vg_sgr  

lvcreate -L 2G -n lv2g_16 vg_sgr  

lvcreate -L 2G -n lv2g_17 vg_sgr  

lvcreate -L 2G -n lv2g_18 vg_sgr 

lvcreate -L 2G -n lv2g_19 vg_sgr 

lvcreate -L 2G -n lv2g_20 vg_sgr

2.2 绑定 lv --> raw device

cat /etc/rc.d/rc.local


raw /dev/raw/raw1 /dev/mapper/vg_sgr-lv400m

raw /dev/raw/raw2 /dev/mapper/vg_sgr-lv2g_1

raw /dev/raw/raw3 /dev/mapper/vg_sgr-lv2g_2

raw /dev/raw/raw4 /dev/mapper/vg_sgr-lv2g_3

raw /dev/raw/raw5 /dev/mapper/vg_sgr-lv2g_4

raw /dev/raw/raw6 /dev/mapper/vg_sgr-lv2g_5

raw /dev/raw/raw7 /dev/mapper/vg_sgr-lv2g_6

raw /dev/raw/raw8 /dev/mapper/vg_sgr-lv2g_7

raw /dev/raw/raw9 /dev/mapper/vg_sgr-lv2g_8

raw /dev/raw/raw10 /dev/mapper/vg_sgr-lv2g_9

raw /dev/raw/raw11 /dev/mapper/vg_sgr-lv2g_10

raw /dev/raw/raw12 /dev/mapper/vg_sgr-lv2g_11

raw /dev/raw/raw13 /dev/mapper/vg_sgr-lv2g_12

raw /dev/raw/raw14 /dev/mapper/vg_sgr-lv2g_13

raw /dev/raw/raw15 /dev/mapper/vg_sgr-lv2g_14

raw /dev/raw/raw16 /dev/mapper/vg_sgr-lv2g_15

raw /dev/raw/raw17 /dev/mapper/vg_sgr-lv2g_16

raw /dev/raw/raw18 /dev/mapper/vg_sgr-lv2g_17

raw /dev/raw/raw19 /dev/mapper/vg_sgr-lv2g_18

raw /dev/raw/raw20 /dev/mapper/vg_sgr-lv2g_19

raw /dev/raw/raw21 /dev/mapper/vg_sgr-lv2g_20


2.3 设定裸设备用户、权限规则

cat /etc/udev/rules.d/60-raw.rules

 

 


ACTION=="add",KERNEL=="vg_sgr-lv400m",RUN+="/bin/raw /dev/raw/raw1 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_1",RUN+="/bin/raw /dev/raw/raw2 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_2",RUN+="/bin/raw /dev/raw/raw3 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_3",RUN+="/bin/raw /dev/raw/raw4 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_4",RUN+="/bin/raw /dev/raw/raw5 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_5",RUN+="/bin/raw /dev/raw/raw6 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_6",RUN+="/bin/raw /dev/raw/raw7 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_7",RUN+="/bin/raw /dev/raw/raw8 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_8",RUN+="/bin/raw /dev/raw/raw9 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_9",RUN+="/bin/raw /dev/raw/raw10 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_10",RUN+="/bin/raw /dev/raw/raw11 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_11",RUN+="/bin/raw /dev/raw/raw12 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_12",RUN+="/bin/raw /dev/raw/raw13 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_13",RUN+="/bin/raw /dev/raw/raw14 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_14",RUN+="/bin/raw /dev/raw/raw15 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_15",RUN+="/bin/raw /dev/raw/raw16 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_16",RUN+="/bin/raw /dev/raw/raw17 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_17",RUN+="/bin/raw /dev/raw/raw18 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_18",RUN+="/bin/raw /dev/raw/raw19 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_19",RUN+="/bin/raw /dev/raw/raw20 %N" 

ACTION=="add",KERNEL=="vg_sgr-lv2g_20",RUN+="/bin/raw /dev/raw/raw21 %N" 



ACTION=="add", KERNEL=="raw1", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw2", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw3", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw4", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw5", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw6", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw7", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw8", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw9", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw10", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw11", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw12", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw13", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw14", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw15", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw16", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw17", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw18", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw19", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw20", OWNER="informix", GROUP="informix", MODE="660"

ACTION=="add", KERNEL=="raw21", OWNER="informix", GROUP="informix", MODE="660"

2.4 启动裸设备

start_udev


2.5. 创建链接文件 informix用户:     


为裸设备创建链接文件,链接文件可以屏蔽设备的具体路径,在系统迁移等场景更灵活。

并修改邻接文件的用户、权限属性。

vi ln.sh                   
ln -s /dev/raw/raw1  /opt/dbs/rootdbs
ln -s /dev/raw/raw2  /opt/dbs/plogdbs
ln -s /dev/raw/raw3  /opt/dbs/llogdbs
ln -s /dev/raw/raw4  /opt/dbs/tmpdbs01
ln -s /dev/raw/raw5  /opt/dbs/tmpdbs02
ln -s /dev/raw/raw6  /opt/dbs/datadbs01
ln -s /dev/raw/raw7  /opt/dbs/datadbs02
ln -s /dev/raw/raw8  /opt/dbs/datadbs03
ln -s /dev/raw/raw9  /opt/dbs/datadbs04
ln -s /dev/raw/raw10  /opt/dbs/datadbs05
ln -s /dev/raw/raw11  /opt/dbs/datadbs06

chown informix:informix *dbs*
chmod 660 *dbs*

执行 ln.sh 并查看链接文件ls -l /opt/dbs/*
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 datadbs01 -> /dev/raw/raw6
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 datadbs02 -> /dev/raw/raw7
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 datadbs03 -> /dev/raw/raw8
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 datadbs04 -> /dev/raw/raw9
lrwxrwxrwx 1 informix informix        14 Mar  1 16:30 datadbs05 -> /dev/raw/raw10
lrwxrwxrwx 1 informix informix        14 Mar  1 16:30 datadbs06 -> /dev/raw/raw11 
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 llogdbs -> /dev/raw/raw3
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 plogdbs -> /dev/raw/raw2
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 rootdbs -> /dev/raw/raw1
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 tmpdbs01 -> /dev/raw/raw4
lrwxrwxrwx 1 informix informix        13 Mar  1 16:30 tmpdbs02 -> /dev/raw/raw5


----------------------------------------------------------------------------------------------------------

3.安装Informix软件
---------------------------------------------------------------------------------------------------------

3.1. 准备informix安装包
下载获取informix11.7安装包,这里安装包名为: Informix117FC4_Linux.tar。并将文件ftp至/opt/informix/setup目录
 su - informix
 $ cd /opt/informix/setup
 $ cp /opt/dbs/Informix117FC4_Linux.tar.tar .
 $ ls -rlt
 -rw-rw-r-- 1 informix informix 449167360 Mar  1 16:32 Informix117FC4_Linux.tar
 解压安装包
 $ tar -xvf *.tar
   ...
 解压后有安装程序ids_install
 $ ls
 bundle.properties               ICONNECT                  JDBC
 CSDK                            ids_install               README.html
 IBM_Data_Server_Driver_Package  Informix117FC4_Linux.tar  SERVER

3.2. 安装Informix软件
 采用root用户安装,按照提示按照即可。其中选择不创建默认instance。
  $ su - informix 
 $ cd /opt/informix/setup
 $ su root
 注意这里从用户informix 切换到 root 用户时,su root 而不是su - root,这样可以保留informix环境,安装时不需要即可安装到指定目录。如下为安装日志信息。
 $ ids_install
 Preparing to install...
 Extracting the JRE from the installer archive...
 Unpacking the JRE...
 Extracting the installation resources from the installer archive...
 Configuring the installer for this system‘s environment...
 Launching installer...
 
 Preparing CONSOLE Mode Installation...
 ===============================================================================
 IBM Informix Software Bundle                     (created with InstallAnywhere)
 -------------------------------------------------------------------------------
 
 ===============================================================================
 Getting started with IBM Informix Software Bundle
 -------------------------------------------------
 InstallAnywhere will guide you through the installation of IBM Informix
 Software Bundle.
 
 1. Release Notes
 The Release Notes can be found in
 /opt/informix/setup/SERVER/doc/ids_unix_relnotes_11.70.html
 2. Installation Guide
 Please view the Installation / Quick Beginnings Guide at
 /opt/informix/setup/SERVER/doc/ids_unix_installg_11.70.pdf

 3. Launch Information Center
 Access the IDS 11.70 Information Center at
 
http://publib.boulder.ibm.com/infocenter/idshelp/v117/index.jsp
 To Begin Installation,
 Respond to each prompt to proceed to the next step in the installation.
 If you want to change something on a previous step, type ‘back‘.
 You may cancel this installation at any time by typing ‘quit‘
 PRESS <ENTER> TO CONTINUE: 
 ===============================================================================
  
     International Program License Agreement
    
     Part 1 - General Terms
    
     BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, CLICKING ON AN
     "ACCEPT" BUTTON, OR OTHERWISE USING THE PROGRAM, LICENSEE AGREES TO
     THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCEPTING THESE TERMS ON
     BEHALF OF LICENSEE, YOU REPRESENT AND WARRANT THAT YOU HAVE FULL
     AUTHORITY TO BIND LICENSEE TO THESE TERMS. IF YOU DO NOT AGREE TO
     THESE TERMS,  
     - DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, CLICK ON AN "ACCEPT" BUTTON,
     OR USE THE PROGRAM; AND
     - PROMPTLY RETURN THE UNUSED MEDIA, DOCUMENTATION, AND PROOF OF
     ENTITLEMENT TO THE PARTY FROM WHOM IT WAS OBTAINED FOR A REFUND OF THE
     AMOUNT PAID. IF THE PROGRAM WAS DOWNLOADED, DESTROY ALL COPIES OF THE
     PROGRAM.
     
 Press Enter to continue viewing the license agreement, or enter "1" to
    accept the agreement, "2" to decline it, "3" to print it, or "99" to go back
    to the previous screen.: 1
  
 ===============================================================================
 Installation Goals
 ------------------
 What do you want to accomplish?
   ->1- Install products and features
     2- Extract the product files (-DLEGACY option)
     3- Create an RPM image for redistribution
 ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: 
 ===============================================================================
 Installation Location
 ---------------------
 Choose location for software installation
   Default Install Folder: /opt/informix
 ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE DEFAULT
       : 
 ===============================================================================
 Installation Type
 -----------------
 Select the installation type.
 Typical: Install the database server with all features and a database server that
 is configured with default values. Includes:
 ** Client Software Development Kit (CSDK)
 ** Java Database Connectivity (JDBC)
 Minimum disk space required: 700-800MB
 
 Custom: Install the database server with specific features and software that you need.
 Optionally install a configured database server instance.
 Minimum disk space required: 75 MB (without a server instance)
 
   ->1- Typical
     2- Custom
 
 ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT::
 
 
 
 
 ===============================================================================
 Server Instance Creation
 ------------------------
 
 Create a server instance?
 
   ->1- Yes - create an instance
     2- No - do not create an instance
 
 ENTER THE NUMBER FOR YOUR CHOICE, OR PRESS <ENTER> TO ACCEPT THE DEFAULT:: 2
 
 
 
 
 ===============================================================================
 
 
 
 
     International License Agreement for Non-Warranted Programs
    
     Part 1 - General Terms
    
     BY DOWNLOADING, INSTALLING, COPYING, ACCESSING, CLICKING ON AN
     "ACCEPT" BUTTON, OR OTHERWISE USING THE PROGRAM, LICENSEE AGREES TO
     THE TERMS OF THIS AGREEMENT. IF YOU ARE ACCEPTING THESE TERMS ON
     BEHALF OF LICENSEE, YOU REPRESENT AND WARRANT THAT YOU HAVE FULL
     AUTHORITY TO BIND LICENSEE TO THESE TERMS. IF YOU DO NOT AGREE TO
     THESE TERMS,
    
     * DO NOT DOWNLOAD, INSTALL, COPY, ACCESS, CLICK ON AN "ACCEPT" BUTTON,
     OR USE THE PROGRAM; AND
    
     * PROMPTLY RETURN THE UNUSED MEDIA AND DOCUMENTATION TO THE PARTY FROM
     WHOM IT WAS OBTAINED FOR A REFUND OF THE AMOUNT PAID. IF THE PROGRAM
     WAS DOWNLOADED, DESTROY ALL COPIES OF THE PROGRAM.
    
     1. Definitions
 
 Press Enter to continue viewing the license agreement, or enter "1" to
    accept the agreement, "2" to decline it, "3" to print it, or "99" to go back
    to the previous screen.: 1
 
 
 
 
 ===============================================================================
 Installation Summary
 --------------------
 
 Please review the following before continuing:
 
 Product Name:
     IBM Informix Software Bundle
 
 Install Folder:
     /opt/informix
 
 Product Features:
     IBM Informix database server,
     Base Server,
     Extensions and tools,
     J/Foundation,
     Database extensions,
     Conversion and reversion support,
     XML publishing,
     Demonstration database scripts,
     Enterprise Replication,
     Data loading utilities,
     onunload and onload utilities,
     dbload utility,
     High-Performance Loader,
     Backup and Restore,
     archecker utility,
     ON-Bar utility,
     Informix Storage Manager,
     Informix interface to Tivoli Storage Manager,
     Administrative utilities,
     Performance monitoring utilities,
     Miscellaneous monitoring utilities,
     Auditing utilities,
     Database import and export utilities,
     IBM Informix Client SDK,
     IBM Informix Object Interface for C++,
     IBM Informix Object Interface for C++ demos,
     IBM Informix ESQL/C,
     7.2 application compatibility module,
     IBM Informix ESQL/C demos,
     IBM Informix LIBDMI for client applications,
     IBM Informix ODBC Driver,
     IBM Informix ODBC Driver demos,
     Global Language Support (GLS),
     West European and Americas,
     East European and Slavic,
     Japanese,
     Korean,
     Chinese,
     Thai,
     IBM Informix JDBC
 
 Disk Space Information (for Installation Target):
     Required:  589,190,475 bytes
     Available: 98,702,008,320 bytes
 
 PRESS <ENTER> TO CONTINUE:
 
 
 
 ===============================================================================
 Ready To Install
 ----------------
 
 InstallAnywhere is now ready to install IBM Informix Software Bundle onto your
 system at the following location:
 
    /opt/informix
 
 PRESS <ENTER> TO INSTALL:
 
 
 
 ===============================================================================
 Installing...
 -------------
 
  [==================|==================|==================|==================]
  [------------------|------------------|-------------------------------------]
 
 
 
 ===============================================================================
 Installation Complete
 ---------------------
 
 Congratulations! IBM Informix Software Bundle installation is complete.
 
 Product install status:
 IBM Informix 11.70: Successful
 IBM Informix Client-SDK: Successful
 IBM Informix JDBC Driver: Successful
 
 
 For more information about using Informix products, see the IBM Informix 11.70
 Information Center at
 
http://publib.boulder.ibm.com/infocenter/idshelp/v117/index.jsp.
 
 PRESS <ENTER> TO EXIT THE INSTALLER:

至此,informix数据库软件安装完毕。

--------------------------------------------------------------------------------------------------------

4.初始化Informix实例
--------------------------------------------------------------------------------------------------------- 
按照本文目标,创建一个数据库实例demoserver 

$ su - informix
$ cd /opt/informix/etc

4.1. 修改sqlhosts.demo文件
 $ vi sqlhosts.demo
  demo_on onipcshm        on_hostname     on_servername
  demoserver onsoctcp      9.123.147.52   9088
  demoserver_m onipcshm    9.123.147.52   9099
  注意:sqlhosts.demo与环境变量名一致,demoserver为实例名,demoserver_m为数据库实例别名。

4.2. 配置onconfig参数文件
数据库实例初始化只需要修改如下参数。

$ cp onconfig.std onconfig.demoserver
 $ vi onconfig.demoserver
    ROOTPATH /opt/dbs/rootdbs
    MSGPATH $INFORMIXDIR/online.log
    SERVERNUM 10
    DBSERVERNAME  demoserver
    DBSERVERALIASES demoserver_m
    TAPEDEV /dev/null
    LTAPEDEV /dev/null

4.3. 初始化数据库实例
运行oninit -viy初始化实例
$ oninit -viy
 Reading configuration file ‘/opt/informix/etc/onconfig.demoserver‘...succeeded
 Creating /INFORMIXTMP/.infxdirs...succeeded
 Checking config parameters...succeeded
 Allocating and attaching to shared memory...succeeded
 Creating resident pool 102966 kbytes...succeeded
 Allocating 1000016 kbytes for buffer pool of 2K page size...succeeded
 Creating infos file "/opt/informix/etc/.infos.demoserver"...succeeded
 Linking conf file "/opt/informix/etc/.conf.demoserver"...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
 Forking main_loop thread...succeeded
 Initializing DR structures...succeeded
 Forking 1 ‘soctcp‘ listener threads...succeeded
 Forking 1 ‘ipcshm‘ listener threads...succeeded
 Starting tracing...succeeded
 Initializing 8 flushers...succeeded
 Initializing log/checkpoint information...succeeded
 Initializing dbspaces...succeeded
 Opening primary chunks...succeeded
 Opening mirror chunks...succeeded
 Validating chunks...succeeded
 Creating database partition...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
 使用 onstat - onstat -d命令察看数据库实例状态。
 $ onstat -
  IBM Informix Dynamic Server Version 11.70.FC4 -- On-Line -- Up 00:00:58 -- 1174296 Kbytes
 
 $ onstat -d
  IBM Informix Dynamic Server Version 11.70.FC4 -- On-Line -- Up 00:01:14 -- 1174296 Kbytes
  Dbspaces
 address          number   flags      fchunk   nchunks  pgsize   flags    owner    name
 88779028         1        0x40001    1        1        2048     N  BA    informix rootdbs
  1 active, 2047 maximum
  Chunks
 address          chunk/dbs     offset     size       free       bpages     flags pathname
 887791d0         1      1      0          100000     37189                 PO-B-- /opt/dbs/rootdbs
   
------------------------------------------------------------------------------------------------------

 5. 创建表空间dbspace
------------------------------------------------------------------------------------------------------ 
创建plog,llog,temp表空间及用户数据空间

5.1. 准备脚本
vi dbs.sh

onspaces -c -d plogdbs -p /opt/dbs/plogdbs -o 0 -s 2000000  
onspaces -c -d llogdbs -p /opt/dbs/llogdbs -o 0 -s 2000000
onspaces -c -d tmpdbs01 -p /opt/dbs/tmpdbs01 -o 0 -s 200000 -t
onspaces -c -d tmpdbs02 -p /opt/dbs/tmpdbs02 -o 0 -s 200000 -t
onspaces -c -d datadbs01 -p /opt/dbs/datadbs01 -o 0 -s 2000000
onspaces -c -d datadbs02 -p /opt/dbs/datadbs02 -o 0 -s 2000000 
onspaces -c -d datadbs03 -p /opt/dbs/datadbs03 -o 0 -s 2000000
onspaces -c -d datadbs04 -p /opt/dbs/datadbs04 -o 0 -s 2000000 
onspaces -c -d datadbs05 -p /opt/dbs/datadbs05 -o 0 -s 2000000
onspaces -c -d datadbs06 -p /opt/dbs/datadbs06 -o 0 -s 2000000 

ontape -s -L 0
 
onmode -uy
 
onparams -p -s 1999000 -d plogdbs -y
 
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
onparams -a -d llogdbs -s 100000
 
onmode -l
onmode -l
onmode -l
onmode -l
onmode -l
onmode -l
onmode -l
onmode -c
onparams -d -l 1 -y
onparams -d -l 2 -y
onparams -d -l 3 -y
onparams -d -l 4 -y
onparams -d -l 5 -y
onparams -d -l 6 -y
 
onmode -m
ontape -s -L 0

onmode -l
onmode -c

5.2. 使用脚本创建dbspaces
$ dbs.sh
 Verifying physical disk space, please wait ...
 Space successfully added.
 
 ** WARNING **  A level 0 archive of Root DBSpace will need to be done.
 Verifying physical disk space, please wait ...
 Space successfully added.
 
 ** WARNING **  A level 0 archive of Root DBSpace will need to be done.
 Verifying physical disk space, please wait ...
 Space successfully added.
 Verifying physical disk space, please wait ...
 Space successfully added.
 Verifying physical disk space, please wait ...
 Space successfully added.
 
 ** WARNING **  A level 0 archive of Root DBSpace will need to be done.
 Verifying physical disk space, please wait ...
 Space successfully added.
 
 ** WARNING **  A level 0 archive of Root DBSpace will need to be done.
 Verifying physical disk space, please wait ...
 Space successfully added.
 
 ** WARNING **  A level 0 archive of Root DBSpace will need to be done.
 Verifying physical disk space, please wait ...
 Space successfully added.
 
 ** WARNING **  A level 0 archive of Root DBSpace will need to be done.
 Verifying physical disk space, please wait ...
 Space successfully added.
 
 ** WARNING **  A level 0 archive of Root DBSpace will need to be done.
 Verifying physical disk space, please wait ...
 Space successfully added.
 
 ** WARNING **  A level 0 archive of Root DBSpace will need to be done.
 Archive to tape device ‘/dev/null‘ is complete.
 
 Program over.
 Log operation started. To monitor progress, use the onstat -l command.
 ** WARNING ** Because the physical log has been modified, a level 0 archive
 must be taken of the following spaces before an incremental archive will be
 permitted for them: rootdbs plogdbs
 (see Dynamic Server Administrator‘s manual)
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Logical log successfully added.
 Log operation started. To monitor progress, use the onstat -l command.
 Cannot add a logical log.
 ISAM error:  DBSpace is full.
 Log operation started. To monitor progress, use the onstat -l command.
 Cannot add a logical log.
 ISAM error:  DBSpace is full.
 Log operation started. To monitor progress, use the onstat -l command.
 Cannot add a logical log.
 ISAM error:  DBSpace is full.
 Log operation started. To monitor progress, use the onstat -l command.
 Cannot add a logical log.
 ISAM error:  DBSpace is full.
 Logical log file 1 has been pre-dropped.
 It will be deleted from the log list and its space can be reused
 once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
 and non-temporary DBspaces.
 Logical log file 2 has been pre-dropped.
 It will be deleted from the log list and its space can be reused
 once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
 and non-temporary DBspaces.
 Logical log file 3 has been pre-dropped.
 It will be deleted from the log list and its space can be reused
 once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
 and non-temporary DBspaces.
 Logical log file 4 has been pre-dropped.
 It will be deleted from the log list and its space can be reused
 once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
 and non-temporary DBspaces.
 Logical log file 5 has been pre-dropped.
 It will be deleted from the log list and its space can be reused
 once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
 and non-temporary DBspaces.
 Logical log file 6 has been pre-dropped.
 It will be deleted from the log list and its space can be reused
 once you take level 0 archives of all BLOBspaces, Smart BLOBspaces
 and non-temporary DBspaces.
 Archive to tape device ‘/dev/null‘ is complete.
 
 Program over.

5.3. 查看dbspace及日志的创建情况

  $ onstat -l
 IBM Informix Dynamic Server Version 11.70.FC4 -- On-Line -- Up 00:03:26 -- 1174296 Kbytes
 
 Physical Logging
 Buffer bufused  bufsize  numpages   numwrits   pages/io
   P-2  31       64       752        51         14.75
       phybegin         physize    phypos     phyused    %used  
       2:53             999500     60         31         0.00   
 
 Logical Logging
 Buffer bufused  bufsize  numrecs    numpages   numwrits   recs/pages pages/io
   L-2  0        32       131827     10933      3562       12.1       3.1    
  Subsystem    numrecs    Log Space used
  OLDRSAM      131521     17640560     
  HA           51         2244         
  DDL          255        88740        
 
 address          number   flags    uniqid   begin                size     used    %used
 8b0b0850         7        U-B----  7        3:53                50000        1     0.00
 8b0b0920         8        U-B----  8        3:50053             50000        1     0.00
 8b0b08b8         9        U-B----  9        3:100053            50000        1     0.00
 8b0b0988         10       U-B----  10       3:150053            50000       35     0.07
 8b0b09f8         11       U---C-L  11       3:200053            50000       30     0.06
 8b0b0a70         12       A------  0        3:250053            50000        0     0.00
 8b0b0af0         13       A------  0        3:300053            50000        0     0.00
 8b0b0b78         14       A------  0        3:350053            50000        0     0.00
 8b0b0c08         15       A------  0        3:400053            50000        0     0.00
 8b0b0ca0         16       A------  0        3:450053            50000        0     0.00
 8b0b0e98         17       A------  0        3:500053            50000        0     0.00
 8b0b0f00         18       A------  0        3:550053            50000        0     0.00
 8adaef38         19       A------  0        3:600053            50000        0     0.00
 8adaefa0         20       A------  0        3:650053            50000        0     0.00
 8b0b0f68         21       A------  0        3:700053            50000        0     0.00
 8aeec698         22       A------  0        3:750053            50000        0     0.00
 8afe4fc0         23       A------  0        3:800053            50000        0     0.00
 8aeec700         24       A------  0        3:850053            50000        0     0.00
 8b0b0e30         25       A------  0        3:900053            50000        0     0.00
  19 active, 19 total
 
  $ onstat -d
 
 IBM Informix Dynamic Server Version 11.70.FC4 -- On-Line -- Up 00:03:29 -- 1174296 Kbytes
 
 Dbspaces
 address          number   flags      fchunk   nchunks  pgsize   flags    owner    name
 88779028         1        0x70001    1        1        2048     N  BA    informix rootdbs
 8ab34e50         2        0x70001    2        1        2048     N  BA    informix plogdbs
 8ab34748         3        0x60001    3        1        2048     N  BA    informix llogdbs
 8b0c1df8         4        0x42001    4        1        2048     N TBA    informix tmpdbs01
 8afe4d38         5        0x42001    5        1        2048     N TBA    informix tmpdbs02
 8b240d20         6        0x60001    6        1        2048     N  BA    informix datadbs01
 8b14f308         7        0x60001    7        1        2048     N  BA    informix datadbs02
 8aff9850         8        0x60001    8        1        2048     N  BA    informix datadbs03
 8aff9dc0         9        0x60001    9        1        2048     N  BA    informix datadbs04
 8b0b33e0         10       0x60001    10       1        2048     N  BA    informix datadbs05
 8b0ad078         11       0x60001    11       1        2048     N  BA    informix datadbs06
  11 active, 2047 maximum
 
 Chunks
 address          chunk/dbs     offset     size       free       bpages     flags pathname
 887791d0         1      1      0          100000     92177                 PO-B-- /opt/dbs/rootdbs
 8b2401b0         2      2      0          1000000    447                   PO-B-- /opt/dbs/plogdbs
 8b0b3850         3      3      0          1000000    49947                 PO-B-- /opt/dbs/llogdbs
 8b175ca8         4      4      0          100000     99947                 PO-B-- /opt/dbs/tmpdbs01
 8adaed38         5      5      0          100000     99947                 PO-B-- /opt/dbs/tmpdbs02
 8ab36458         6      6      0          1000000    999947                PO-B-- /opt/dbs/datadbs01
 8b14f4b0         7      7      0          1000000    999947                PO-B-- /opt/dbs/datadbs02
 8aff99f8         8      8      0          1000000    999947                PO-B-- /opt/dbs/datadbs03
 8b0b2b60         9      9      0          1000000    999947                PO-B-- /opt/dbs/datadbs04
 8b0b3588         10     10     0          1000000    999947                PO-B-- /opt/dbs/datadbs05
 8b0ad220         11     11     0          1000000    999947                PO-B-- /opt/dbs/datadbs06

------------------------------------------------------------------------------------------------------

6. 初步调整数据库参数
-------------------------------------------------------------------------------------------------------

vi onconfig.demoserver
MULTIPROCESSOR 1
VPCLASS cpu,num=4,noage
DBSPACETEMP tmpdbs01,tmpdbs02
BUFFERPOOL     size=2K,buffers=500000,lrus=32,lru_min_dirty=50.00,lru_max_dirty=60.00

重起数据库实例

onmode -ky

oninit -vy

---------------------------------------------------------------------------------------------------

7.创建数据库testdb
---------------------------------------------------------------------------------------------------

dbaccess sysadmin执行如下SQL.

create database testdb in datadbs01 with buffered log;

技术分享

 

本文出自 “linux” 博客,请务必保留此出处http://linda622.blog.51cto.com/9640173/1652871

informix安装

标签:20150520

原文地址:http://linda622.blog.51cto.com/9640173/1652871

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!