/***********************************************************************************************************/
8T數據庫搭建
/***********************************************************************************************************/
1 安裝虛擬機 D:\jibunn\software\vmware\oracle-vm\VirtualBox-5.0.20-106931-Win 到 D:\vm
2 虛擬機 上 安裝LINUX6 D:\jibunn\software\linux-操作系統\centos-6.8 到 D:\vmlinuxnode1
使用setup 設置網卡 選on boot ,虛擬機配置爲 1.bridged(橋接模式)
3 安裝xftp4
4 創建用戶和 目錄
1) 創建用戶,組,設置口令
groupadd informix
useradd -g informix -d /home/informix -s /bin/bash -m informix
passwd informix
2)創建安裝目錄
mkdir /home/informix/gbase
chown -Rf informix:informix /home/informix/gbase
3) 創建數據庫 文件目錄
cd /opt
mkdir dbs
chown -Rf informix:informix dbs
4)配置.bash_profile
su - informix
# vi .bash_profile
export INFORMIXSERVER=gbaseserver
export INFORMIXDIR=/home/informix/gbase
export ONCONFIG=onconfig.gbaseserver
export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts.gbaseserver
export PATH=$INFORMIXDIR/bin:/usr/bin:${PATH}:.
export GL_DATE="%m%d%iY"
export DATETIME="%iY-%m-%d %H:%M:%S"
export DB_LOCALE=zh_cn.utf8
export CLIENT_LOCALE=zh_cn.utf8
export LD_LIBRARY_PATH=${INFORMIXDIR}/lib:${INFORMIXDIR}/lib/esql:${INFORMIXDIR}/lib/cli
export TERM=vt100
export TREMCAP=$INFORMIXDIR/etc/termcap
export INFORMIXTERM=termcap
export DBTEMP=$INFORMIXDIR/tmp
--注:
INFORMIXSERVER 爲INFORMIX server 的名稱
INFORMIXDIR 爲INFORMIX 安裝目錄
ONCONFIG 爲 配置文件名稱
GL_DATE 爲日期數據顯示格式
DB_LOCALE 爲 服務器,數據庫
CLIENT_LOCALE 爲客戶端 字符集
5 安裝 8T D:\南大通用\GBase 8t培訓\GBase8tV8.5.12.10.FC4G1AEE_1.6.3.54.RHEL6_x86
[root@node1 file]# tar -xvf GBase8tV8.5.12.10.FC4G1AEE_1.6.3.54.RHEL6_x86.tar
[root@node1 file]# ./ids_install $INFORMIXDIR
6 數據庫 初始化
su - informix
1) 創建DBSPACE,授權
cd /opt/dbs
touch rootdbs
chmod 660 rootdbs
2)相關配置文件
cp $INFORMIXDIR/etc/sqlhosts.std $INFORMIXSQLHOSTS
cd $INFORMIXDIR
cp $INFORMIXDIR/etc/onconfig.std $INFORMIXDIR/etc/$ONCONFIG
3)配置數據庫 IP,端口
echo "$INFORMIXSERVER onsoctcp 192.168.1.100 9088">>$INFORMIXSQLHOSTS
4) 其他 配置
sed -i "s#^ROOTPATH.*#ROOTPATH /opt/dbs/rootdbs #g" $INFORMIXDIR/etc/$ONCONFIG
sed -i "s#^DBSERVERNAME.*#DBSERVERNAME $INFORMIXSERVER #g" $INFORMIXDIR/etc/$ONCONFIG
sed -i "s#^TAPEDEV.*#TAPEDEV /dev/null #g" $INFORMIXDIR/etc/$ONCONFIG
sed -i "s#^LTAPEDEV.*#LTAPEDEV /dev/null #g" $INFORMIXDIR/etc/$ONCONFIG
5) 數據庫 初始化
# oninit -ivy
7 創建其他 DBSPACE,授權
1)dbspcae 創建
cd /opt/dbs
touch datadbs1 datadbs2 plogdbs logdbs2 tmpdbs1 tmpdbs2
chmod 660 datadbs1 datadbs2 plogdbs logdbs2 tmpdbs1 tmpdbs2
onspaces -c -d datadbs1 -p /opt/dbs/datadbs1 -o 0 -s 200000 -k 8k
onspaces -c -d datadbs2 -p /opt/dbs/datadbs2 -o 0 -s 200000 -k 8k
onspaces -c -d plogdbs -p /opt/dbs/plogdbs -o 0 -s 2000000
onspaces -c -d logdbs2 -p /opt/dbs/logdbs2 -o 0 -s 2000000
onspaces -c -d tmpdbs1 -p /opt/dbs/tmpdbs1 -o 0 -s 200000 -t -k 8k
onspaces -c -d tmpdbs2 -p /opt/dbs/tmpdbs2 -o 0 -s 200000 -t -k 8k
2) sbspace 大對象的 空間創建 -S 參數
onspaces -c -S sbspace -p /opt/dbs/sbspace -o 0 -s 2000000 -k 8k
8 常用命令
1) 靜默 模式,殺掉用戶連接
onmode -uy
2) 多用戶模式
onmode -m
3) 關閉數據庫
onmode -ky
4) 啓動數據庫
oninit -vy
5) 日誌等 文件操作
onparams -p -s 1999000 -d plogdbs -y
onparams -a -d logdbs2 -s 100000
6)與備份有關的
ontape -s -L 0
7) 數據庫狀態
a: 啓動狀態
onstat -m
b: 當前連接用戶
onstat -g sql
c: 數據庫 空間
onstat -d
9 優化數據庫參數重啓數據庫
sed -i "s#^SBSPACENAME.*#SBSPACENAME sbspace #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^SYSSBSPACENAME.*#SYSSBSPACENAME sbspace #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^DBSPACETEMP.*#DBSPACETEMP tmpdbs1,tmpdbs2 #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^MULTIPROCESSOR.*#MULTIPROCESSOR 1 #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^VPCLASS.*#VPCLASS cpu,num=2,noage #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^CLEANERS.*#CLEANERS 32 #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^LOCKS.*#LOCKS 100000 # g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^DEF_TABLE_LOCKMODE.*#DEF_TABLE_LOCKMODE row #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^SHMVIRTSIZE.*#SHMVIRTSIZE 326560 #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^SHMADD.*#SHMADD 82656 #g" $INFORMIXDIR/etc/$ONCONFIG;
sed -i "s#^BUFFERPOOL size=8K.*#BUFFERPOOL size=8K, buffers=50000,lrus=32,lru_min_dirtyize=50,lru_max_dirtyize=60 #g" $INFORMIXDIR/etc/$ONCONFIG;
10 連接方式
1) JDBC 連接
jdbc:informix-sqli://192.168.5.120:9088/testdb:informixserver=gbaseserver;DB_LOCALE=zh_cn.GB18030-2000;CLIENT_LOCALE=zh_cn.GB18030-2000;NEWCODESET=GB18030,GB18030-2000,5488
2) dbaccess 連接
# dbaccess dbname -
例如: dbaccess ifmis_jsx -
11 啓動錯誤處理 : 如果啓動 報錯,請參考下面的 操作
1)oninit -ivy
shared memory not initialized for INFORMIXSERVER 'gbaseserver'
[informix@localhost ~]$ onstat -m
shared memory not initialized for INFORMIXSERVER 'gbaseserver'
Message Log File: /home/informix/gbase/tmp/online.log
11:03:42 CCFLAGS2 value set to 0x200
11:03:42 SQL_FEAT_CTRL value set to 0x8008
11:03:42 SQL_DEF_CTRL value set to 0x4b0
11:03:42 GBase 8t Database Server Version 12.10.FC4G1AEE Software Serial Number AAA#B000000
11:03:42 Assert Warning: Unable to bind to the port (9088) on the host (192.168.1.100) for the server (gbaseserver).
11:03:42 GBase 8t Database Server Version 12.10.FC4G1AEE
11:03:42 Who: Session(3, informix@, 0, (nil))
Thread(9, soctcplst, 0, 1)
File: soc_be.c Line: 2501
11:03:42 stack trace for pid 2265 written to /home/informix/gbase/tmp/af.3f1060e
11:03:42 See Also: /home/informix/gbase/tmp/af.3f1060e
11:03:42 Unable to bind to the port (9088) on the host (192.168.1.100) for the server (gbaseserver).
11:03:42 DISK INITIALIZATION ABORTED: potential instance overwrite detected.
To disable this check, set FULL_DISK_INIT to 1 in your config file and retry.
11:03:42 oninit: Fatal error in shared memory initialization
11:03:42 GBase 8t Database Server Stopped.
11:03:42 mt_shm_remove: WARNING: may not have removed all/correct segments
[informix@localhost ~]$
2) FULL_DISK_INIT 參數 --重新初始化前需要將該參數 設置爲1
11:10:09 DISK INITIALIZATION ABORTED: potential instance overwrite detected.
To disable this check, set FULL_DISK_INIT to 1 in your config file and retry.
11:10:09 oninit: Fatal error in shared memory initialization
11:10:09 GBase 8t Database Server Stopped.
11:10:09 mt_shm_remove: WARNING: may not have removed all/correct segments
# vi /home/informix/gbase/etc/onconfig.gbaseserver
FULL_DISK_INIT 1
3) oninit: Not enough room in ROOT DBspace.
Requested 2250038K, ONCONFIG value 'ROOTSIZE' 300000K.
FAILED
informix-安裝
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章
informix ontape
/***********************************************************************/i
yutonging2016
2020-06-16 03:20:14
informix 多實例安裝
/***********************************************************************/i
yutonging2016
2020-06-16 03:20:13
informix LIST
yutonging2016
2020-06-16 03:20:13
informix-dbexport-dbimport
yutonging2016
2020-02-24 02:07:07
informix ontape
/***********************************************************************/i
yutonging2016
2020-06-16 03:20:14
informix 多實例安裝
/***********************************************************************/i
yutonging2016
2020-06-16 03:20:13
informix LIST
yutonging2016
2020-06-16 03:20:13
informix-dbexport-dbimport
yutonging2016
2020-02-24 02:07:07
informix 外部表
yutonging2016
2018-08-28 13:47:21
informix gis 數據處理
yutonging2016
2018-08-28 13:47:21
informix 分頁
yutonging2016
2018-08-28 13:47:19
informix sds 搭建
yutonging2016
2018-08-28 13:47:19
informix 分片表
yutonging2016
2018-08-28 13:47:14
informix-dbschema
yutonging2016
2018-08-28 13:47:14