免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2491 | 回复: 1
打印 上一主题 下一主题

informix for rh_linux 9.0安装全过程 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2004-09-23 11:08 |只看该作者 |倒序浏览
一、准备工作
1、使用操作系统的管理界面,建立informix用户组和informix用户,可以将用户建在/usr目录下。
2、安装介质:光盘或DDS流带或软盘,其中至少包含三个Informix数据库的产品:
Informix DS(for HP9000)或Informix SE(for PC)
Informix ESQL/C
Informix SQL

二、安装
1、以超级用户注册,设置环境变量:

# INFORMIXDIR=/usr/informix
# export INFORMIXDIR

2、Informix产品的安装必须按照先装SQL,再装ESQL/C,最后装OnLine DS或SE的顺序进行。按照介质上的说明将SQL产品拷贝到$INFORMIXDIR目录下。

3、执行命令安装SQL产品(使用超级用户)

# cd $INFORMIXDIR
# ./installsql

以下根据提示信息输入序列号和活动码,SQL安装完毕。

4、重复以上两个步骤,安装ESQL/C、OnLine DS或SE产品,安装命令分别为:installesql、installonline或installse。注意:必须拷入一个产品,安装一个产品,不能一次拷入后分别安装,这样会出错。

三、配置
1、以超级用户注册,准备数据库空间所使用的设备文件

# mkdir $INFORMIXDIR/dbs
# cd $INFORMIXDIR/dbs
# ln -s /dev/vg01/rrootdbs rootdbs
# ln -s /dev/vg01/rdatadbs datadbs
# ln -s /dev/vg01/rlogdbs logdbs
# ln -s /dev/vg01/rtmpdbs tmpdbs
# chgrp informix *
# chown informix *
# chmod 666 *

2、在Informix用户的“.profile”文件中加入以下设置:

INFORMIXDIR=$HOME
INFORMIXSERVER=bankserver
PATH=$PATHINFORMIXDIR/bin
DBDATE=Y4MD-
export INFORMIXDIR INFORMIXSERVER
export PATH DBDATE

3、以Informix用户注册,修改$INFORMIXDIR/etc/sqlhosts文件,增加一行:

bankserver onipcshm node_name sqlexec

其中,node_name是主机的hostname。

4、在Informix用户执行

$ onmonitor

然后选择其中的“Parameters”中的“Initialize”,对数据库进行初始化配置,配置过程共有6屏,每配置完一屏后按“ESC”键表示确认,进入下一屏的配置,典型的配置过程如下:

DISK PARAMETERS
Page Size [ 2]Kbytes Mirror[N]

Tape Dev. [/dev/rmt/0m ]
Block Size [ 64]Kbytes Total Tape Size[ 4000000]Kbytes
Log Tape Dev. [/dev/rmt/0m ]
Block Size [ 64]Kbytes Total Tape Size[ 4000000]Kbytes
Stage Blob [ ]

Root Name [rootdbs ] Root Size [ 250000]Kbytes
Primary Path [/usr/informix/dbs/rootdbs ]
Root Offset [ 0]Kbytes
Mirror Path [ ]
Mirror Offset [ 0]Kbytes
Phy. Log Size [ 100000]Kbytes Log. Log size[ 50000]Kbytes
Number of Logical Logs [ 3]











SHARED MEMORY PARAMETERS
Server Number [ 1] Server Name [bankserver ]
Server Aliases [ ]
Dbspace Temp [ tmpdbs ]
Deadlock Timeout [ 60]Secs Number of Page Cleaners [ 1]
Forced Residency [N] Stack Size (K) [ 32]
Non Res. SegSize (K) [ 8000] Optical Cache Size (K) [ 0]

Dbspace Down Option [ 2]
Preserve Log For Log Backup [N]
Heterogeneous Commit [N] Transaction Timeout [ 300]
Physical Log Buffer Size [ 64] K Long TX HWM [ 50]
Logical Log Buffer Size [ 128]K Long TX HWM Exclusive [ 60]
Max # of Logical Logs [ 8] Index Page Fill Factor [ 90]
Max # of Locks [ 20000] Add SegSize (K) [ 8192]
Max # of Buffers [ 5000] Total Memory (K) [ 0]

Resident Shared Memory size [ 13920]Kbytes Page Size [ 2] Kbytes

PERFORMANCE TUNING PARAMETERS
Multiprocessor Machine [Y] LRU Max Dirty [ 60]
  Num Procs to Affinity [ 2] LRU Min Dirty [ 50]
  Proc Num to start with [ 2] Checkpoint Interval [ 300]
Num of Read Ahead Pages [ ]
CPU VPs [ 2] Read Ahead Threshold [ ]
AIO VPs [ ]
Single CPU VP [N] NETTYPE settings:
Use OS Time [N] Protocol Threads Users VP-class
Disable Priority Aging [N] [ ] [ ] [ ] [ ]
Off-Line Recovery Threads [ 10] [ ] [ ] [ ] [ ]
On-Line Recovery Threads [ 1] [ ] [ ] [ ] [ ]
Num of LRUS queues [ 8] [ ] [ ] [ ] [ ]

DATA REPLICATION PARAMETERS
Interval [ 30]
Timeout [ 30]
Auto [0]
Lost & Found [/usr/informix/etc/dr.lostfound ]

DIAGNOSTIC PARAMETERS
Message Log [/usr/informix/online.log ]
Console Msgs. [/dev/console ]
Alarm Program [/usr/informix/log_full.sh ]

Dump Shared Memory [Y]
Dump Gcore [N]
Dump Core [N]
Dump Count [ 1]
Dump Directory [/usr/informix/tmp ]

PARALLEL DATABASE QUERIES PARAMETERS
Max PDQ Priority [100]
Decision Support Queries [ ]
Decision Support Memory (Kbytes) [ ]
Maximum Decision Support Scans [ 1048576]
Dataskip [off ]
Optimizer Hint [0]

配置完成后,系统会自动进行初始化,这需要一些时间。

5、初始化完成后,在主菜单的“Dbspaces”项中选择“Create”,建立其它三个数据库空间:datadbs、logdbs和tmpdbs:

CREATE DBSPACE
Dbspace Name [datadbs ] Mirror [N] Temp [N]
PRIMARY CHUNK INFORMATION:
Full Pathname [/usr/informix/dbs/datadbs ]
offset [ 0]Kbytes size [ 4000000]Kbytes
MIRROR CHUNK INFORMATION:
Full Pathname [ ]
offset [ 0]Kbytes





CREATE DBSPACE
Dbspace Name [logdbs ] Mirror [N] Temp [N]
PRIMARY CHUNK INFORMATION:
Full Pathname [/usr/informix/dbs/logdbs ]
offset [ 0]Kbytes size [ 500000]Kbytes
MIRROR CHUNK INFORMATION:
Full Pathname [ ]
offset [ 0]Kbytes

CREATE DBSPACE
Dbspace Name [tmpdbs ] Mirror [N] Temp [Y]
PRIMARY CHUNK INFORMATION:
Full Pathname [/usr/informix/dbs/tmpdbs ]
offset [ 0]Kbytes size [ 250000]Kbytes
MIRROR CHUNK INFORMATION:
Full Pathname [ ]
offset [ 0]Kbytes

6、在主菜单的“Parameters”项中选择“Drop-Log”,将“rootdbs”中的三个逻辑日志删除。

7、在主菜单的“Parameters”项中选择“Physical-Log”,将“rootdbs”中的物理日志移到“logdbs”中。

8、在主菜单的“Parameters”项中选择“Add-Log”,在“logdbs”中增加4个逻辑日志。

注意:建立bankroom数据库时,必须指定将其建立在datadbs数据库空间上,否则数据空间会不够。

9、以上是HP9000小型机上Informix数据库配置方法,如果是要在PC服务器上配置Informix,由于其为SE 7.X版,配置过程为:首先在Informix用户的“.profile”文件中加入以下设置:

INFORMIXDIR=$HOME
INFORMIXSERVER=bankserver
PATH=$PATHINFORMIXDIR/bin
DBDATE=Y4MD-
DBPATH=$INFORMIXDIR/dbs
export INFORMIXDIR INFORMIXSERVER
export PATH DBDATE DBPATH

然后,在$INFORMIXDIR/etc/sqlhosts文件中增加一行:

bankserver seipcpip node_name sqlexec

其中,node_name是主机的hostname。

以上配置为DACI NT在上线初始时的建议配置,在今后的运行过程中,可以对以上参数进行调整,请参阅《HP9000系统管理员手册》、《Informix管理员手册》等随机资料。






10 用vi编辑onconfig文件
#**************************************************************************
#
# INFORMIX SOFTWARE, INC.
#
# Title: onconfig.std
# Description: INFORMIX-OnLine Configuration Parameters
#
#**************************************************************************

# Root Dbspace Configuration

ROOTNAME rootdbs # Root dbspace name
ROOTPATH /dev/online_root # Path for device containing root dbspace
ROOTOFFSET 0 # Offset of root dbspace into device (Kbytes)
ROOTSIZE 20000 # Size of root dbspace (Kbytes)

# Disk Mirroring Configuration Parameters

MIRROR 0 # Mirroring flag (Yes = 1, No = 0)/*一般不用镜像,用RAID 5)
MIRRORPATH # Path for device containing mirrored root
MIRROROFFSET 0 # Offset into mirrored device (Kbytes)

# Physical Log Configuration

PHYSDBS rootdbs # Location (dbspace) of physical log
PHYSFILE 100 # Physical log file size (Kbytes)
在设初始值时放在rootdbs,并且空间可以很小,等到数据库服务器初始化后再进行在其它Dbspace上建立物理日志

# Logical Log Configuration
LOGFILES 3 # Number of logical log files(最少3个)
LOGSIZE 40 # Logical log size (Kbytes)
在设初始值时放在rootdbs,并且空间可以很小,等到数据库服务器初始化后再进行在其它Dbspace上建立物理日志和逻辑日志

# Diagnostics

MSGPATH /usr/informix/online.log # System message log file path
CONSOLE /dev/console # System console message path
ALARMPROGRAM /usr/informix/log_full.sh # Alarm program path

# System Archive Tape Device

TAPEDEV /dev/tapedev # Tape device path
如果是调试环境可将备份设到:/dev/null
TAPEBLK 16 # Tape block size (Kbytes)
如果是要备份到磁带,最好设置得大一些(1024 or 2048),可提高备份速度。
TAPESIZE 10240 # Maximum amount of data to put on tape (Kbytes)

# Log Archive Tape Device

LTAPEDEV /dev/tapedev # Log tape device path
LTAPEBLK 16 # Log tape block size (Kbytes)
LTAPESIZE 10240 # Max amount of data to put on log tape (Kbytes)

# Optical

STAGEBLOB # INFORMIX-OnLine/Optical staging area

# System Configuration

SERVERNUM 0 # Unique id corresponding to a OnLine instance
如果只用一个服务器,则设为0,如果有多个服务器,其值必须是1到255之间。
DBSERVERNAME # Name of default database server
DBSERVERALIASES # List of alternate dbservernames
NETTYPE # Configure poll thread(s) for nettype
DEADLOCK_TIMEOUT 60 # Max time to wait of lock in distributed env.
RESIDENT 0 # Forced residency flag (Yes = 1, No = 0)


MULTIPROCESSOR 0 # 0 for single-processor, 1 for multi-processor
CPU VPs INFORMIX使用VP的个数,一般为1
NUMCPUVPS 0 # Number of user (cpu) vps
AIO VPs 使用操作系统的VP个数,取缺省值
SINGLE_CPU_VP 0 # If non-zero, limit number of cpu vps to one
如果CPU个数在4个以下,可设为Y--1

如果CPU个数在4个以下,则多CPU绑定VP配置应设为N--0
AFF-SPROCS NUM PROCS TO AFFINITY 绑定在CPU上的VP个数
AFF-NPROCS PROC NUM TO START WITH 从第几个SPU开始绑定
NOAGE 1 # Process aging
AFF_SPROC 2-3 取缺省值 # Affinity start processor
AFF_NPROCS 0 # Affinity number of processors

# Shared Memory Parameters

LOCKS 2000 # Maximum number of locks
对于比较大的应用、内存,锁的个数可设得大一些。
经验值:100000
每个锁:44字节
BUFFERS 200 # Maximum number of shared buffers
逻辑日志的大小,经验值为物理内存的25%。
数据量大的应用应适当增加(必须与SHMVIRSIZE同时增加),
NUMAIOVPS # Number of IO vps
PHYSBUFF 32 # Physical log buffer size (Kbytes)
LOGBUFF 32 # Logical log buffer size (Kbytes)
LOGSMAX 6 # Maximum number of logical log files
CLEANERS 1 # Number of buffer cleaner processes
SHMBASE 0 # Shared memory base address
SHMVIRTSIZE 8000 # initial virtual shared memory segment size
数据量大的应用应适当增加(必须与BUFFERS同时增加),
SHMADD 8192 # Size of new shared memory segments (Kbytes)
SHMTOTAL 0 # Total shared memory (Kbytes). 0=>;unlimited
CKPTINTVL 300 # Check point interval (in sec)
LRUS 8 # Number of LRU queues
LRU_MAX_DIRTY 60 # LRU percent dirty begin cleaning limit
LRU_MIN_DIRTY 50 # LRU percent dirty end cleaning limit
LTXHWM 50 # Long transaction high water mark percentage
LTXEHWM 60 # Long transaction high water mark (exclusive)
TXTIMEOUT 300 # Transaction timeout (in sec)
STACKSIZE 32 # Stack size (Kbytes)

# System Page Size
# BUFFSIZE - OnLine no longer supports this configuration parameter.
# To determine the page size used by OnLine on your platform
# see the last line of output from the command, 'onstat -b'.


# Recovery Variables
# OFF_RECVRY_THREADS:
# Number of parallel worker threads during fast recovery or an offline restore.
# ON_RECVRY_THREADS:
# Number of parallel worker threads during an online restore.

OFF_RECVRY_THREADS 10 # Default number of offline worker threads
ON_RECVRY_THREADS 1 # Default number of online worker threads

# Data Replication Variables
# DRAUTO: 0 manual, 1 retain type, 2 reverse type
DRAUTO 0 # DR automatic switchover
DRINTERVAL 30 # DR max time between DR buffer flushes (in sec)
DRTIMEOUT 30 # DR network timeout (in sec)
DRLOSTFOUND /usr/informix/etc/dr.lostfound # DR lost+found file path

# CDR Variables
CDR_LOGBUFFERS 2048 # size of log reading buffer pool (Kbytes)
CDR_EVALTHREADS 1,2 # evaluator threads (per-cpu-vp,additional)
CDR_DSLOCKWAIT 5 # DS lockwait timeout (seconds)
CDR_QUEUEMEM 4096 # Maximum amount of memory for any CDR queue (Kbytes)

# Backup/Restore variables
BAR_ACT_LOG /tmp/bar_act.log
BAR_MAX_BACKUP 0
BAR_RETRY 1
BAR_NB_XPORT_COUNT 10
BAR_XFER_BUF_SIZE 31

# Read Ahead Variables
RA_PAGES # Number of pages to attempt to read ahead
RA_THRESHOLD # Number of pages left before next group

# DBSPACETEMP:
# OnLine equivalent of DBTEMP for SE. This is the list of dbspaces
# that the OnLine SQL Engine will use to create temp tables etc.
# If specified it must be a colon separated list of dbspaces that exist
# when the OnLine system is brought online. If not specified, or if
# all dbspaces specified are invalid, various ad hoc queries will create
# temporary files in /tmp instead.

DBSPACETEMP # Default temp dbspaces

# DUMP*:
# The following parameters control the type of diagnostics information which
# is preserved when an unanticipated error condition (assertion failure) occurs
# during OnLine operations.
# For DUMPSHMEM, DUMPGCORE and DUMPCORE 1 means Yes, 0 means No.

DUMPDIR /tmp # Preserve diagnostics in this directory
DUMPSHMEM 1 # Dump a copy of shared memory
DUMPGCORE 0 # Dump a core image using 'gcore'
DUMPCORE 0 # Dump a core image (Warning:this aborts OnLine)
DUMPCNT 1 # Number of shared memory or gcore dumps for
# a single user's session

FILLFACTOR 90 # Fill factor for building indexes

# method for OnLine to use when determining current time
USEOSTIME 0 # 0: use internal time(fast), 1: get time from OS(slow)

# Parallel Database Queries (pdq)
MAX_PDQPRIORITY 100 # Maximum allowed pdqpriority
如果是没有大型的并行数据库的操作,应设为0
DS_MAX_QUERIES # Maximum number of decision support queries
DS_TOTAL_MEMORY # Decision support memory (Kbytes)
DS_MAX_SCANS 1048576 # Maximum number of decision support scans
取缺省值
DATASKIP OFF # List of dbspaces to skip

# OPTCOMPIND
# 0 =>; Nested loop joins will be preferred (where
# possible) over sortmerge joins and hash joins.
# 1 =>; If the transaction isolation mode is not
# "repeatable read", optimizer behaves as in (2)
# below. Otherwise it behaves as in (0) above.
# 2 =>; Use costs regardless of the transaction isolation
# mode. Nested loop joins are not necessarily
# preferred. Optimizer bases its decision purely
# on costs.
OPTCOMPIND 2 # To hint the optimizer
优化因子:0如果有索引则通过索引优化
优化因子:2系统优化SQL语句
ONDBSPACEDOWN 2 # Dbspace down option: 0 = CONTINUE, 1 = ABORT, 2 = WAIT
LBU_PRESERVE 0 # Preserve last log for log backup
经验值:1
目的:逻辑日志全部满后又无备份机制,数据库将会出错并导致系统死机。
OPCACHEMAX 0 # Maximum optical cache size (Kbytes)

# HETERO_COMMIT (Gateway participation in distributed transactions)
# 1 =>; Heterogeneous Commit is enabled
# 0 (or any other value) =>; Heterogeneous Commit is disabled
HETERO_COMMIT 0
配置完毕后,启动数据库SERVER,进入ONLINE状态则成功。

建立系统表以外的DB Space
数据库状态应在单用户模式:Quiescent
onmonitor界面里:Mode, Graceful-Shutdown
或命令行:oninit -s
建立dbspace
# onmonitor
Dbspace, Create:
Dbspace Name [app_dbs] Mirror [N] Temp [N] (如果是临时表则要填:Y)
Full Pathname [ /bocsv/database/app_dbs ]
Offset [50] Kbytes (专家经验:不从0开始) Size [ 1000000 ] Kbytes
MIRROR CHUNK INFORMATION:
Full pathname [ ]
Offset [ 0 ] Kbytes

增加物理日志
# onparams -p -s 250000 -d phylog ( size = kbyte )
# onstat -d (size = page ( 2 kbyte) )
增加逻辑日志
# onparams -a -d logdbs -s 100000
如果有11个,就做11次。注意个数要同onconfig中的个数一样。
逻辑日志个数可以很多,但每个日志不宜太大(10M-20M),否则大日志损坏时不已恢复。
由于数据库在初始化的时候有3个逻辑日志在rootdbs中,则需要删除,但第一个日志正在用,可用命令
# ontape -s
archive full system
# onmode -l
强制将逻辑日志下移。
此时用 onstat -l查看时(SIZE单位是PAGE),flag会是U,此时还无法删除,要用命令
# ontape -a
将逻辑日志全部备份,状态有B或是F的则可以删除了:
# onparams -d -l log_id
应用表
通过建库命令即可使用app_dbs。
备份与恢复
# onstape -s (全备份)
执行时会有提问:备份级别,选择0级即全备份
# ontape -c 连续备份逻辑日志,每次备份均自动绕带,即从流带头开始备份。
# ontape -r 恢复数据,恢复全备份及逻辑日志。

文件:onconfig, oncfg_servername.0

数据库优化:update statistics

********************************************************
以上的文档是我参考其它网上的文档写的,如果在高版本的(7.1以上)的linux上,具体安装过程中还可能会有某些地方报错,大多数都是在共享库文件(*.so.*)上出问题,一般来讲按照错误提示稍作修改都可以解决
ln -s $INFORMIXDIR/lib/*.so /usr/lib
ln -s $INFORMIXDIR/esql/*.so /usr/lib   ***如果还是提示原来的错误,那么就到相应的目录下找找所说的库文件,原因有可能仅仅是有多个文件都指向同一个库,删除多余的就可以了。
ln -s /usr/lib/libcurses.so.5 /usr/lib/libcurses.so.4   ***这一条要根据具体的情况而定,libcurses.so.*(3,4,5)中的函数都是通用的,少哪个补哪个就好。
还有就是如果oninit -iy的时候提示有关共享内存的错误,首先ps -e 一下,看看进程里面是不是已经有oninit还没死,有的话kill掉再试一下。。。
怕忘了所以借论坛宝地留个备忘录 :em11:
第一次搞informix,好多地方不懂,说得不对的地方多担待

论坛徽章:
0
2 [报告]
发表于 2004-09-23 13:35 |只看该作者

informix for rh_linux 9.0安装全过程

收下!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP