操作系统版本:
$ oslevel -r #本文中$代表以informix用户操作5100-02
数据库版本:
$ onstat -Informix Dynamic Server Version 9.40.FC1
环境描述:数据库主机有块网卡,分别连接不同的网段,如下所示:
$ ifconfig -aen0: flags=4e080863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG>
inet 192.168.1.135 netmask 0xffffffff broadcast 192.168.1.255
inet6 fe80::202:55ff:fe9a:d927/64
tcp_sendspace 131072 tcp_recvspace 65536
en2: flags=4e080863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST,GROUPRT,64BIT,PSEG>
inet 172.16.1.228 netmask 0xfffffff0 broadcast 172.16.1.255
inet6 fe80::204:acff:fe57:7b45/64
目前informix数据库服务监听端口为1526,服务起在en2(172.16.1.228)网卡上,如下所示:
$ netstat -an | grep 1526Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 172.16.1.228.1526 *.* LISTEN
现要更改informix数据库服务监听端口为1435,服务起在en0(192.168.1.135)网卡上。步骤如下:
1、备份sqlhosts文件
$ cp $INFORMIXDIR/etc/sqlhosts $INFORMIXDIR/etc/sqlhosts.bak
2、修改sqlhost文件
首先查看sqlhosts文件内容:
$ cat $INFORMIXDIR/etc/sqlhosts
#**************************************************************************
#
# INFORMIX SOFTWARE, INC.
#
# PROPRIETARY DATA
#
# THIS DOCUMENT CONTAINS TRADE SECRET DATA WHICH IS THE PROPERTY OF
# INFORMIX SOFTWARE, INC. THIS DOCUMENT IS SUBMITTED TO RECIPIENT IN
# CONFIDENCE. INFORMATION CONTAINED HEREIN MAY NOT BE USED, COPIED OR
# DISCLOSED IN WHOLE OR IN PART EXCEPT AS PERMITTED BY WRITTEN AGREEMENT
# SIGNED BY AN OFFICER OF INFORMIX SOFTWARE, INC.
#
# THIS MATERIAL IS ALSO COPYRIGHTED AS AN UNPUBLISHED WORK UNDER
# SECTIONS 104 AND 408 OF TITLE 17 OF THE UNITED STATES CODE.
# UNAUTHORIZED USE, COPYING OR OTHER REPRODUCTION IS PROHIBITED BY LAW.
#
#
# Title: sqlhosts.demo
# Sccsid: @(#)sqlhosts.demo 9.2 7/15/93 15:20:45
# Description:
# Default sqlhosts file for running demos.
#
#**************************************************************************
dbcs onsoctcp 172.16.1.228 1526
编辑$INFORMIXDIR/etc/sqlhosts文件,把172.16.1.228修改为192.168.1.135,1526修改为1435,保存退出。
3、重启informix数据库
$ onmode -ky #关闭informix数据库
$ oninit -v #重启informix数据库
4、检查informix数据库服务监听端口
$ netstat -an | grep 1435Active Internet connections (including servers)
Proto Recv-Q Send-Q Local Address Foreign Address (state)
tcp4 0 0 192.168.1.135.1435 *.* LISTEN
由上见知,informix数据库服务监听端口已成功修改为1435,服务启在en0(192.168.1.135)网卡上。
没有评论:
发表评论