INFORMIXDIR=/usr/informix
export INFORMIXDIR
echo "INPUT YOUR FREE DIVISIONS: (exp: d10???)"
read MYDEVICE
cd /dev
ls $MYDEVICE > $INFORMIXDIR/mydb.txt
cd $INFORMIXDIR
dbline=`wc -l mydb.txt|awk '{print $1}'`
if [ $dbline -lt 3 ]
then
echo "DEVICE NOT ENOUGH!!! AT LEAST 3 * 2G"
exit
fi
cd $INFORMIXDIR
ROOTDEVICE1=`cat mydb.txt|awk 'NR==1 {print $0}'`
ROOTDEVICE2=`cat mydb.txt|awk 'NR==2 {print $0}'`
ROOTDEVICE3=`cat mydb.txt|awk 'NR==3 {print $0}'`
echo $ROOTDEVICE1
echo $ROOTDEVICE2
echo $ROOTDEVICE3
MYHOST=`hostname`
MYSERVER=$MYHOST
MYCONFIG=onconfig.$MYHOST
MYPORT=8888
SOURCE=/tmp #°²װԴĿ¼
cd $INFORMIXDIR
tar xvf $SOURCE/SQL.TAR
./installsql <
AAC#J704041
YRRCJU
!
cpio -icvdBum < $SOURCE/ESQL.CPI
./installesql <
AAC#J334485
RVJAJS
!
tar xvf $SOURCE/4GL.TAR
./install4gl <
AAC#J704038
BBNUJB
!
cpio -icvdBum < $SOURCE/IDS.CPI
./installserver <
AAC#J704034
KOREJH
!
cd /usr/informix
echo "INFORMIXDIR=/usr/informix" > .profile
echo "INFORMIXSERVER=${MYSERVER}_shm" >> .profile
echo "ONCONFIG=$MYCONFIG" >> .profile
echo "PATH=$PATH:$INFORMIXDIR/bin:. # set command search path" >> .profile
echo "MAIL=/usr/spool/mail/`logname` # mailbox location" >> .profile
echo "export PATH MAIL INFORMIXDIR INFORMIXSERVER ONCONFIG" >> .profile
echo "${MYSERVER}_shm onipcshm `hostname` ${MYSERVER}_shm" >$INFORMIXDIR/etc/sqlhosts
echo "${MYSERVER}_tcp ontlitcp `hostname` ${MYSERVER}_tcp" >>$INFORMIXDIR/etc/sqlhosts
cp /etc/services /etc/services.bak
grep -v ${MYSERVER}_tcp /etc/services.bak > /etc/services
echo "${MYSERVER}_tcp ${MYPORT}/tcp" >> /etc/services
########write ONCONFIG FILES#########
cp $INFORMIXDIR/etc/onconfig.std $INFORMIXDIR/etc/${MYCONFIG}
chown informix:informix $INFORMIXDIR/etc/$MYCONFIG
cd $INFORMIXDIR/etc/
cat ${MYCONFIG}|awk -v dev1="/dev/"${ROOTDEVICE1} '$1=="ROOTPATH" {$2=dev1} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="ROOTSIZE" {$2="50000"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="LOGFILES" {$2="3"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="TAPEDEV" {$2="/dev/null"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="LOGSMAX" {$2="20"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="LTAPEDEV" {$2="/dev/null"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="LOCKS" {$2="500000"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="BUFFERS" {$2="400000"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="TAPEBLK" {$2="128"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk -v server=${MYSERVER}"_shm" '$1=="DBSERVERNAME" {print $1 " " server} !($1=="DBSERVERNAME"){print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk -v server=${MYSERVER}"_tcp" '$1=="DBSERVERALIASES" {print $1 " " server} !($1=="DBSERVERALIASES"){print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="DBSPACETEMP" {print $1 " rootdbs"} !($1=="DBSPACETEMP"){print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="LRU_MAX_DIRTY" {$2="20"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="LRU_MIN_DIRTY" {$2="15"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
cat ${MYCONFIG}|awk '$1=="CKPTINTVL" {$2="5000"} {print $0}' > /tmp/onconfig.tmp
cp /tmp/onconfig.tmp $INFORMIXDIR/etc/${MYCONFIG}
####END ONCONFIG#########
#######ONINIT#########
cd $INFORMIXDIR
. ./.profile
oninit -iy
sleep 10
#######ONINIT#########
onspaces -c -d tmpdbs -t -p /dev/$ROOTDEVICE1 -o 50002 -s 945000
onspaces -c -d phydbs -p /dev/$ROOTDEVICE1 -o 1000000 -s 1000000
onspaces -c -d logdbs -p /dev/$ROOTDEVICE2 -o 0 -s 2000000
onspaces -c -d workdbs -p /dev/$ROOTDEVICE3 -o 0 -s 2000000
onmode -s -y
sleep 3
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d logdbs -s 100000
onparams -a -d
阅读(766) | 评论(0) | 转发(0) |