(2007 6月27日)oracle as 开机自动启动(linux)
来源:互联网 发布:电气控制仿真软件下载 编辑:程序博客网 时间:2024/06/03 23:00
一直都是我开机手动启动服务, 今天修改成开机自动启动服务。 方便以后接手负责的同事。
oracle as 10.1.2 自动启动
[root@hyapp3 init.d]# pwd
/etc/rc.d/init.d
[root@hyapp3 init.d]# cat oracleas
#!/bin/bash
# chkconfig: 345 99 10
# description: Startup Script for Oracle Application Server
# /etc/init.d/oracleas
# export ORACLE_BASE=/opt
export ORACLE_HOME=/oracle/orahome
export PATH=$PATH:$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin
if [ ! -f $ORACLE_HOME/opmn/bin/opmnctl ]
then
echo "OracleAS startup: cannot start"
exit
fi
case "$1" in
start)
echo -n "Starting OracleAs"
su oracle -c "$ORACLE_HOME/opmn/bin/opmnctl startall"
sleep 15
su oracle -c "$ORACLE_HOME/bin/emctl start iasconsole"
touch /var/lock/oracleas
echo "OK"
;;
stop)
echo -n "Shutdown OracleAs: "
su oracle -c "$ORACLE_HOME/bin/emctl stop iasconsole"
su oracle -c "$ORACLE_HOME/opmn/bin/opmnctl stopall"
rm -f /var/lock/oracleas
echo "OK"
;;
*)
echo "Usage: 'basename $0' start|stop"
exit 1
esac
exit 0
[root@hyapp3 init.d]# chmod u+x oracleas
[root@hyapp3 init.d]# chkconfig --add oracleas
[root@hyapp3 init.d]# chkconfig --list oracleas
oracleas 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[root@hyapp3 init.d]#
http://www.dbanotes.net/OpenSource/Managing_Initscripts_with_RedHat's_chkconfig_CN.htm
把脚本放到 /etc/rc.d/init.d 中并运行(以 root) :
chmod +x /etc/rc.d/init.d/oracle
使你的脚本可执行。如果你担心普通用户察看这个脚本,你可以设定更严格的文件权限 。只要这个脚本可以被 root 作为单独的脚本运行就可以。
注意脚本中的两行注释:
#chkconfig: 2345 80 05
#description: Oracle 8 Server
chkconfig 需要这些行来决定如何实现初始运行级添加服务,如何设定启动和停止顺序的优先级。这些行指明脚本将为运行级 2、3、4、5 启动 Oracle 8 服务。另外, 启动优先权将被设定为 80 而停止优先权设定为 05。
现在脚本在合适的位置,并且有合适的执行权限,以及恰当的 chkconfig 注释, 我们可以添加 init 脚本,以 root 用户执行,
# chkconfig --add oracle.
用 chkconfig 的查询,我们能核实我们所作的添加:
[root]# chkconfig --list | grep oracle
oracle 0:off 1:off 2:on 3:on 4:on 5:on 6:off
而且,我们可以用标准的 find 命令察看 chkconfig 如何设定符号连接:
[root]# find /etc/rc.d -name '*oracle' -print
/etc/rc.d/init.d/oracle
/etc/rc.d/rc0.d/K05oracle
/etc/rc.d/rc1.d/K05oracle
/etc/rc.d/rc2.d/S80oracle
/etc/rc.d/rc3.d/S80oracle
/etc/rc.d/rc4.d/S80oracle
/etc/rc.d/rc5.d/S80oracle
/etc/rc.d/rc6.d/K05oracle
- (2007 6月27日)oracle as 开机自动启动(linux)
- oracle as 开机自动启动(linux)
- linux oracle 开机自动启动(三)
- linux 开机自动启动 oracle
- linux开机自动启动ORACLE数据库
- Linux下设置ORACLE开机自动启动
- Linux开机自动启动ORACLE设置
- Linux开机自动启动ORACLE设置
- Linux Oracle开机自动启动服务
- Linux 下配置Oracle开机自动启动
- Linux下oracle服务开机自动启动
- Linux开机自动启动ORACLE设置
- oracle 开机自动启动
- oracle 开机自动启动
- Linux下Tomcat开机自动启动 原创 2014年07月18日 12:32:49 标签:Linux /tomcat /shell /启动 22095 Linux下tomcat开机自动启动有两种方法
- linux开机自动启动
- 开机自动启动(关闭)oracle服务
- [Oracle] Linux下开机自动启动Oracle的设置
- Spidermonkey学习笔记
- (2007 5月11日)Linux 下 LVM sample
- (2007 6月4日)oracle:create context引发ORA-01031,ORA-06512错误
- (2007 6月5日)oracle:跨用户访问视图
- (2007 6月26日)解决:ORA-27102: out of memory
- (2007 6月27日)oracle as 开机自动启动(linux)
- SQL语句优化汇总
- (2007 6月28日)oracle 在不同平台使用大内存
- 实习日志二:SilkPerformer帮助文档翻译(一)
- C/C++ 两大GUI库Qt & GTK比较
- NetBeans IDE 6.5 M1开始完全支持PHP
- powerbuilder程序如何对抗shudepb?pb防反编译
- DNS严重漏洞曝光 谁将面临真正的风险?
- 第二人生的源码分析(107)脚本的词法分析(5)