informix 多实例安装

来源:互联网 发布:mac os x install dvd 编辑:程序博客网 时间:2024/06/05 02:57
/***********************************************************************/
informix  多实例安装
本文在一台机器上安装2个 实例 gbase101,gbase102
/***********************************************************************/
1 参数文件onconfig.gbase101 ,onconfig.gbase102
1) 拷贝参数文件
# cp onconfig.std oncofig.gbase101
# cp onconfig.std oncofig.gbase102
修改下列参数 oncofig.gbase101
ROOTPATH /opt/gbase101/rootdbs 
SERVERNUM 1
DBSERVERNAME gbase101
MSGPATH $INFORMIXDIR/tmp/online_gbase101.log




修改下列参数 oncofig.gbase102
ROOTPATH /opt/gbase102/rootdbs 
SERVERNUM 2
DBSERVERNAME gbase102
MSGPATH $INFORMIXDIR/tmp/online_gbase102.log


注:同一台机器上多个实例是 SERVERNUM 需要为不同的值,否则不能初始化


2 sqlhosts 文件
# cp sqlhosts.std sqlhosts.gbase101
# cp sqlhosts.std sqlhosts.gbase102


# more sqlhosts.gbase101
gbase101 onsoctcp 192.168.6.200 9111


[informix@node1 etc]$ more sqlhosts.gbase102
gbase102 onsoctcp 192.168.6.200 9112


3 profile 文件
[informix@node1 ~]$ more profile_gbase101
export INFORMIXSERVER=gbase101
export INFORMIXDIR=/home/informix/gbase
export ONCONFIG=onconfig.gbase101


export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts.gbase101


[informix@node1 ~]$ more profile_gbase102
export INFORMIXSERVER=gbase102
export INFORMIXDIR=/home/informix/gbase
export ONCONFIG=onconfig.gbase102


export INFORMIXSQLHOSTS=$INFORMIXDIR/etc/sqlhosts.gbase102


4 磁盘
# cd /opt/
# mkdir gbase101
# mkdir gbase102
# chown informix:informix gbase101
# chown informix:informix gbase102
# chmod 755 gbase101
# chmod 755 gbase102


# su - informix
# cd /opt/gbase101 
# touch rootdbs
# chmod 660 rootdbs 


# su - informix
# cd /opt/gbase102
# touch rootdbs
# chmod 660 rootdbs 




5 初始化
1) gbase101
# source profile.gbase101
# oninit -ivy


2) gbase102
# source profile.gbase102
# oninit -ivy






/***********************************************************************/
informix  从客户机访问 数据库 
本文su11 机器访问 node1 上的 2个 实例 gbase101,gbase102
/***********************************************************************/


1 node1 上建立 对 SU11的互信 
[informix@node1 ~]$  vi .rhosts
su11 informix




2 SU11 sqlhosts.gbaseserver 
informix@su11:~/gbase/etc> vi sqlhosts.gbaseserver 
gbase101 onsoctcp 192.168.6.200 9111
gbase102 onsoctcp 192.168.6.200 9112
gbaseserver200 onsoctcp 192.168.6.200 9100


注:如果 连接的 实例有重名的,需要使用别名进行连接。
使用别名是 服务器端要进行如下设置 
[informix@node1 etc]$ vi onconfig.gbaseserver
DBSERVERNAME gbaseserver
DBSERVERALIASES gbaseserver200


[informix@node1 etc]$ vi sqlhosts.gbaseserver (DBSERVERNAME,DBSERVERALIASES 2行都要写) 
gbaseserver onsoctcp 192.168.6.200 9100
gbaseserver200 onsoctcp 192.168.6.200 9100






2 node1 上建立 对 SU11的互信 
[informix@node1 ~]$  vi .rhosts
su11 informix


3 SU11 访问 node1 上的 2个 实例 gbase101,gbase102


informix@su11:~/gbase/etc> dbaccess d101@gbase101 -


Database selected.


> select * from t101;




          a 


          1


1 row(s) retrieved.


informix@su11:~/gbase/etc> dbaccess d102@gbase102 -


Database selected.


> select * from t102;




          a 


      23333


1 row(s) retrieved.




/***********************************************************************/
informix  OAT
/***********************************************************************/
# cd /home
# chmod 755 informix
0 0
原创粉丝点击