原文地址:http://blog.sina.com.cn/s/blog_66b6922b0100nvw6.html
研究了好幾天了,終於裝上了,下面我就來給大家分享一下我安裝informix數據庫的過程吧。
Linux下安裝informix數據庫
1.準備安裝文件
a)
b)
2.配置Java環境
a)
b)
export
export
export
3.配置informix環境
a)
#useradd
# passwd Informix
# Changing password for user informix.
New password:
BAD PASSWORD: it is based on a dictionary word
Retype new password:
passwd: all authentication tokens updated successfully.
用informix用戶登錄,修改/opt/Informix/.bash_profile,增加如下內容:
export INFORMIXDIR=/opt/informix
PATH=$INFORMIXDIR/bin:$PATH
export PATH
export INFORMIXSERVER=tramsserver
export ONCONFIG=onconfig.tramsserver
export CLIENT_LOCALE=zh_CN.gb
export DB_LOCALE=zh_CN.gb
export SERVER_LOCALE=zh_CN.gb
export DBLANG=en_us
export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts
export INFORMIXTERM=$INFORMIXDIR/etc/termcap
LD_LIBRARY_PATH=$INFORMIXDIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
export TERMCAP=$INFORMIXDIR/etc/termcap
export INFORMIXTERM=TERMCAP
4.安裝數據庫
a)
5.Informix環境變量設置
容如下:
$cd $cd etc $cp onconfig.std onconfig.tramsserver $vi onconfig.tramsserver # Root數據庫空間配置
ROOTNAME
ROOTPATH
ROOTOFFSET
ROOTSIZE # Disk Mirroring Configuration Parameters
MIRROR
MIRRORPATH
MIRROROFFSET # Physical Log Configuration
PHYSDBS
PHYSFILE # Logical Log Configuration
LOGFILES
LOGSIZE LOG_BACKUP_MODE MANUAL # Logical log backup mode (MANUAL, CONT) # Tablespace Tablespace Configuration in Root Dbspace
TBLTBLFIRST
TBLTBLNEXT # Security # DBCREATE_PERMISSION: # By default any user can create a database. Uncomment DBCREATE_PERMISSON to # limit database creation to a specific user. Add a new DBCREATE_PERMISSION # line for each permitted user.
#DBCREATE_PERMISSION # DB_LIBRARY_PATH: # When loading a (C or C++) shared object (for a UDR or UDT), IDS checks that # the user-specified path starts with one of the directory prefixes listed in # the comma-separated list of prefixes in DB_LIBRARY_PATH. The string # "$INFORMIXDIR/extend" must be included in DB_LIBRARY_PATH in order for # extensibility and IBM supplied blades to work correctly. # DB_LIBRARY_PATH $INFORMIXDIR/extend # IFX_EXTEND_ROLE: # 0 (or off) => Disable use of EXTEND role to control who can register
# # 1 (or on) => Enable use of EXTEND role to control who can register
# # IFX_EXTEND_ROLE 1# To control the usage of EXTEND role. # Diagnostics
MSGPATH
CONSOLE # To automatically backup logical logs, edit alarmprogram.sh and set # BACKUPLOGS=Y
ALARMPROGRAM
ALRM_ALL_EVENTS 0
TBLSPACE_STATS 1 # System Archive Tape Device
TAPEDEV
TAPEBLK
TAPESIZE
# Log Archive Tape Device
LTAPEDEV
LTAPEBLK
LTAPESIZE # Optical
STAGEBLOB # System Configuration
SERVERNUM
DBSERVERNAME
DBSERVERALIASES
#NETTYPE
DEADLOCK_TIMEOUT
RESIDENT
MULTIPROCESSOR 0
NUMCPUVPS
SINGLE_CPU_VP
NOAGE
AFF_SPROC
AFF_NPROCS # Shared Memory Parameters
LOCKS
NUMAIOVPS
PHYSBUFF
LOGBUFF
CLEANERS
SHMBASE
SHMVIRTSIZE
SHMADD
EXTSHMADD Kbytes)
SHMTOTAL
CKPTINTVL
TXTIMEOUT
STACKSIZE # Dynamic Logging # DYNAMIC_LOGS:
#
#
# # When dynamic logging is on, we can have higher values for LTXHWM/LTXEHWM, # because the server can add new logical logs during long transaction rollback. # However, to limit the number of new logical logs being added, LTXHWM/LTXEHWM # can be set to smaller values. # # If dynamic logging is off, LTXHWM/LTXEHWM need to be set to smaller values # to avoid long transaction rollback hanging the server due to lack of logical # log space, i.e. 50/60 or lower. # # In case of system configured with CDR, the difference between LTXHWM and # LTXEHWM should be atleast 30% so that we could minimize log overrun issue.
DYNAMIC_LOGS
LTXHWM
LTXEHWM
# System Page Size # BUFFSIZE - OnLine no longer supports this configuration parameter.
#
#
# 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
ON_RECVRY_THREADS # Data Replication Variables # DRAUTO: 0 manual, 1 retain type, 2 reverse type
DRAUTO
DRINTERVAL
DRTIMEOUT
DRLOSTFOUND
DRIDXAUTO # CDR Variables
CDR_EVALTHREADS 1,2
CDR_DSLOCKWAIT 5
CDR_QUEUEMEM CDR_NIFCOMPRESS 0 # Link level compression (-1 never, 0 none, 9 max)
CDR_SERIAL
CDR_DBSPACE
CDR_QHDR_DBSPACE
CDR_QDATA_SBSPACE # CDR_MAX_DYNAMIC_LOGS # -1 => unlimited # 0 => disable dynamic log addition # >0 => limit the no. of dynamic log additions with the specified value. # Max dynamic log requests that CDR can make within one server session.
CDR_MAX_DYNAMIC_LOGS
# Backup/Restore variables
BAR_ACT_LOG BAR_DEBUG_LOG / opt /informix/bar_dbug.log # ON-Bar Debug Log - not in /tmp please BAR_MAX_BACKUP 0
BAR_RETRY BAR_NB_XPORT_COUNT 20 BAR_XFER_BUF_SIZE 31
RESTARTABLE_RESTORE
BAR_PROGRESS_FREQ
# Informix Storage Manager variables
ISM_DATA_POOL
ISM_LOG_POOL
# Read Ahead Variables
RA_PAGES
RA_THRESHOLD
# 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
# 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
DUMPSHMEM
DUMPGCORE
DUMPCORE
DUMPCNT
FILLFACTOR # method for OnLine to use when determining current time
USEOSTIME
# Parallel Database Queries (pdq)
MAX_PDQPRIORITY 100
DS_MAX_QUERIES
DS_TOTAL_MEMORY
DS_MAX_SCANS 1048576 DS_NONPDQ_QUERY_MEM -1 # Non PDQ query memory (Kbytes)
DATASKIP
# OPTCOMPIND # 0 => Nested loop joins will be preferred (where
# # 1 => If the transaction isolation mode is not
#
# # 2 => Use costs regardless of the transaction isolation
#
#
#
OPTCOMPIND
DIRECTIVES
ONDBSPACEDOWN
OPCACHEMAX # HETERO_COMMIT (Gateway participation in distributed transactions) # 1 => Heterogeneous Commit is enabled # 0 (or any other value) => Heterogeneous Commit is disabled
HETERO_COMMIT
SBSPACENAME
SYSSBSPACENAME
BLOCKTIMEOUT SYSALARMPROGRAM / opt /informix/etc/evidence.sh # System Alarm program path # Optimization goal: -1 = ALL_ROWS(Default), 0 = FIRST_ROWS
OPT_GOAL
ALLOW_NEWLINE but 1) #Create Index Online Shared Memory usage limitation
ONLIDX_MAXMEM #Timeout for client connection request
LISTEN_TIMEOUT 10 #Following are the deprecated configuration parameters, instead of these #use BUFFERPOOL configuration parameter #BUFFERS, LRUS, LRU_MIN_DIRTY, LRU_MAX_DIRTY
IFX_FOLDVIEW # # The following are default settings for enabling Java in the database. # Replace all occurrences of /usr/informix with the value of $INFORMIXDIR.
#VPCLASS
JVPJAVAHOME ctory
JVPHOME
JVPPROPFILE
JVPLOGFILE
JDKVERSION # The path to the JRE libraries relative to JVPJAVAHOME
JVPJAVALIB # The JRE libraries to use for the Java VM
JVPJAVAVM # use JVPARGS to change Java VM configuration #To display jni call
#JVPARGS
# Classpath to use upon Java VM start-up (use _g version for debugging)
#JVPCLASSPATH /usr/informix/extend/krakatoa/krakatoa_g.jar:/usr/informix/extend/kra katoa/jdbc_g.jar JVPCLASSPATH / opt /informix/extend/krakatoa/krakatoa.jar:/usr/informix/extend/krakat oa/jdbc.jar
# The following parameters are related to the buffer pool
#BUFFERPOOL
BUFFERPOOL |
注意以上紅色部分,修改正確的informix安裝路徑,並在$INFORMIXDIR目錄下新建data、log兩個目錄
D.
$cd $mkdir data $mkdir log $cd data $touch rootdbs $chmod 660 rootdbs $cd ../tmp $touch tmpdbs $chmod 660 tmpdbs |
E.
tramsserver |
其中sqlexec需要在/etc/services中定義
# Local services
sqlexec |
6.Informix數據庫初始化
a)
b)
$onmonitor
Dynamic Server:
Status menu to view Dynamic Server.
-----------------------------Off-Line------- Press CTRL-W for Help. --------
c)
其中在Non PDQ Query Memory處修改爲空
d)
Do you really want to continue? (y/n)
WARNING: The ROOT DBspace will be initialized. All previous data will be destroyed. |
e)
Initializing, please wait ... Press Return to continue. |
f)
$oninit $onmode -ky |
g)
19:11:40 'sysmaster' database built successfully. 19:11:40 'sysutils' database built successfully. 19:11:40 'sysuser' database built successfully. …… 19:12:01 Maximum server connections 1 19:12:02 IBM Informix Dynamic Server Stopped. |
h)