好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

linux下开机启动DB2,WAS,TDS服务

linux下开机启动DB2,WAS,TDS服务 由Linux系统中文网(Linux521.com)编辑收集整理,除Linux521注明原创文章外,其版权归原作者所有。如果您在学习中遇到问题欢迎在下面的评论中留言,我们会尽全力解答您的问题。

1.转到/etc/init.d 目录下.

以root身份执行

Shell代码

cd /etc/init.d

2.编写DB2启动脚本

Shell代码

vi startDB2

输入以下内容

Shell代码

#!/bin/sh

# chkconfig: 2345 99 01

# processname:IBMDB2

# description:db2 start

DB2_HOME=[/home/db2inst1/sqllib] #安装db2用户的sqllib

DB2_OWNER=[db2inst1] #db2用户名

case [$1] in

start )

echo -n [starting IBM db2]

su - $DB2_OWNER -c $DB2_HOME/adm/db2start

touch /var/lock/db2

echo [ok]

;;

stop )

echo -n [shutdown IBM db2]

su - $DB2_OWNER -c $DB2_HOME/adm/db2stop

rm -f /var/lock/db2

echo [ok]

;;

restart|reload)

$0 stop

$0 start

;;

*)

echo [usage:$0 start|stop|restart|reload]

exit 1

esac

exit 0

3.编写启动was和tds的脚本.

Shell代码

vi startWasTds

输入以下内容

Shell代码

#!/bin/sh

# chkconfig: 2345 99 01

# processname:IBMTDSWAS

# description:filenet was tds

/opt/IBM/WebSphere/AppServer/profiles/AppSrvTds/bin/startServer.sh server1

/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/startServer.sh server1

/opt/IBM/WebSphere/AppServer/profiles/ilog/bin/startServer.sh serve1

#TDS

/opt/ibm/ldap/V6.3/sbin/ibmdiradm -l dsrdbm01 -t

/opt/ibm/ldap/V6.3/sbin/ibmslapd

参数说明:

头部注释:

linux 命令 chkconfig 要求文件头中 包含:下面这3项

Shell chkconfig代码

# chkconfig: 2345(默认的runlevel) 99(启动优先级) 01(关闭优先级)

# processname:进程名称

# description:进程描述

4.给文件赋予权限

Shell代码

chmod -R 777 startDB2

chmod -R 777 startWasTds

chkconfig --add startDB2

chkconfig --add startWasTds

添加开机启动成功.

 

拥有帝国一切,皆有可能。欢迎访问phome.net

查看更多关于linux下开机启动DB2,WAS,TDS服务的详细内容...

  阅读:71次