第一步:下载 ids 9.4 for linux: ftp://ftp.youngcow.net/Special/Database/DatabaseServer/Informix/ InformixDynamicServerVersion9.4/IIUG-IDS-9.4-linux.zip
csdk for linux: ftp://ftp.software.ibm.com/software/data/informix/downloads/clientsdk.2.81.UC2.LINUX.tar
第二步:linux搭建安装informix的环境
建立informix组:groupadd -g 20000 informix
建立informix用户:useradd -u 20000 -g 20000 -d /opt/informix -m informix
修改informix用户环境变量: 修改 .bash_profile文件 增加以下环境变量
INFORMIXDIR=/opt/informix INFORMIXSERVER=info_dbs ONCONFIG=onconfig.std DBDATE=MDY4* LD_LIBRARY_PATH=$INFORMIXDIR/lib:$INFORMIXDIR/lib/esql:$LD_LIBRARY_PATH export INFORMIXDIR INFORMIXSERVER ONCONFIG LD_LIBRARY_PATH PATH=$PATH:$INFORMIXDIR/bin export PATH
第三步:准备安装文件
zip文件解压 unzip IIUG-IDS-9.4-linux.zip
解开Linux-IDS.9.40.tc1e1.cpio: cpio -idmv < /usr/local/src/Linux-IDS.9.40.tc1e1.cpio;
解开clientsdk.2.81.UC2.LINUX.tar: tar xvf clientsdk.2.81.UC2.LINUX.tar 生成csdk.cpi; 解开csdk.cpi cpio -idmv < /usr/local/src/csdk.cpi;
第四步:开始安装
首先用informix用户登陆
安装ids: 在informix目录下运行./installserver
碰到提示,直接回车;
完成后su到root运行RUN_AS_ROOT.server;
这样ids就安装好了;
安装csdk: 在inforomix目录下运行./installclientsdk;
碰到提示敲yes,回车;
完成后su到root运行RUN_AS_ROOT.clientsdk;
这样clientsdk就装好了;
第五步:开始配置
1、配置/etc/services文件 sqlexe 1526/tcp sqlexec 1528/tcp
--sqlexe和sqlexec是services 名字,1526、1528是端口号; --TCP/IP表示TCP/IP协议
2、配置/etc/hosts文件 192.168.0.1 linux(本主机名称)
3、配置$INFORMIXDIR/etc/sqlhosts文件 info_dbs onipcshm linux sqlexe info_dbs_tcp onsoctcp linux sqlexec
--这里配置了共享内存方式和soctcp方式连接数据库的两种方式;linux代表主机名;sqlexe/sqlexec分
别代表在services文件中配的服务; --另外需要注意的是,informix for linux
9.4版中release提到不支持tlitcp方式;所以这里采用的onsoctcp方式; --若sqlhosts文件配置了tlitcp方式或者说sqlhosts文件中的配置和onconfig.std文件配置不一样,会
出现经常碰到的25507错误;
4、建立空间 以informix用户操作 在INFORMIXDIR中建立dbs目录; 首先 touch rootdbs logdbs phydbs blobdbs tmpdbs datadbs sbspace 然后 chmod 660 * 保证所有的dbs文件都是informix用户informix组;权限都是660;
5、配置$INFORMIXDIR/etc/onconfig.std文件 以下列出需要注意的几点内容:
--rootdbs路径、空间 ROOTNAME rootdbs # Root dbspace name ROOTPATH /opt/informix/dbs/rootdbs # Path for device containing root dbspace ROOTOFFSET 0 # Offset of root dbspace into device (Kbytes) ROOTSIZE 100000 # Size of root dbspace (Kbytes)
--物理日志的dbs空间,先用rootdbs的20M; PHYSDBS rootdbs # Location (dbspace) of physical log PHYSFILE 20000 # Physical log file size (Kbytes)
--逻辑日志用默认的 # Logical Log Configuration
LOGFILES 6 # Number of logical log files LOGSIZE 2000 # Logical log size (Kbytes)
--把磁带的东西都改成/dev/null TAPEDEV /dev/null # Tape device path TAPEBLK 32 # Tape block size (Kbytes) TAPESIZE 10240 # Maximum amount of data to put on tape (Kbytes)
# Log Archive Tape Device
LTAPEDEV /dev/null # Log tape device path LTAPEBLK 32 # Log tape block size (Kbytes) LTAPESIZE 10240 # Max amount of data to put on log tape (Kbytes)
--配置数据库服务器参数,根据自己机器配置的实际情况分配locks和buffers; SERVERNUM 0 # Unique id corresponding to a OnLine instance DBSERVERNAME info_dbs # Name of default database server DBSERVERALIASES info_dbs_tcp # List of alternate dbservernames NETTYPE ipcshm,1,8,CPU # Configure poll thread(s) for nettype NETTYPE soctcp,1,8,NET # Configure poll thread(s) for nettype
LOCKS 5000 # Maximum number of locks BUFFERS 500 # Maximum number of shared buffers NUMAIOVPS 2 # Number of IO vps PHYSBUFF 32 # Physical log buffer size (Kbytes) LOGBUFF 32 # Logical log buffer size (Kbytes) CLEANERS 1 # Number of buffer cleaner processes SHMBASE 0x10000000 # Shared memory base address SHMVIRTSIZE 8000 # initial virtual shared memory segment size SHMADD 8192 # Size of new shared memory segments (Kbytes)
另外就是onconfig.std文件中所有/usr/informix都替换成/opt/informix/ 在vi界面下使用命令 :%s#/usr/informix#/opt/informix#g
6、初始 化数据库了 oninit -ivy 成功后用onstat -i 就可以看到了 Informix Dynamic Server Version 9.40.UC1E1 -- On-Line -- Up 00:31:47 -- 18872 Kbytes onstat>
7、完善数据库空间
下面提供一个我经常使用的shell
echo "Add blobdbs, tmpdbs0, phydbs, logdbs..." echo "====================================================="
onspaces -c -b blobdbs -g 32 -p /opt/informix/dbs/blobdbs -o 0 -s 48000 onspaces -c -d tmpdbs -t -p /opt/informix/dbs/tmpdbs -o 0 -s 100000
onspaces -c -d phydbs -p /opt/informix/dbs/phydbs -o 0 -s 50200 onspaces -c -d logdbs -p /opt/informix/dbs/logdbs -o 0 -s 200000
echo "\nShut Down Server to Quiescent Mode..." echo "=====================================================" onmode -s -y sleep 5
echo "Adding Logical Log\n" onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 20000 onparams -a -d logdbs -s 10000
echo "\nArchiving Database Server Please Wait 20 seconds.\n" echo "=====================================================" ontape -s sleep 5
onmode -l onmode -l onmode -l onmode -l onmode -l onmode -l onmode -c sleep 10
echo "\nDrop the old Logical Log Files... \n" echo "=====================================================" 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
echo "\nChange Physical Log Files, please wait about 1 minutes...\n" echo "=====================================================" onparams -p -s 50000 -d phydbs -y sleep 100
echo "\nNow add more dbspaces/chunks...\n" echo "====================================================="
onspaces -c -d datadbs -p /opt/informix/dbs/datadbs -o 0 -s 500000
onspaces -c -S sbspace -g 1 -p /opt/informix/dbs/sbspace \ -o 0 -s 2000000 -Df
"ACCESSTIME=OFF,LOGGING=ON"
echo "\nTake a level 0 archive.\n" echo "====================================================="
ontape -s -L 0
echo "\nReboot IDS...\n\n" echo "====================================================="
onmode -ky oninit
sleep 10
echo "\n=====================================================" echo "Well done! \n" echo "====================================================="
最后修改onconfig.std文件 DBSPACETEMP tmpdbs # Default temp dbspaces SBSPACENAME sbspace # Default smartblob space name - this is where blobs onmode -ky oninit
|