ORACLE自动启动方法
来源:互联网 发布:视频植入广告软件 编辑:程序博客网 时间:2024/05/22 02:44
前段时间整理的linux下ORACLE自动启动的方法,今天回顾一下:
1. Root用户登录,vi /etc/oratab
orcl:/u01/app/oracle/product/10.2.0/db_1:N 改为orcl:/u01/app/oracle/product/10.2.0/db_1:Y
--------------------------------------------------------------------------------------------------
2. root 用户 在/etc/rc.d/init.d/目录下新建一个文件 oracle10g,把如下内容放到这个文件里,注意参数需要修改
[root@rhel5 ~]# cd /etc/rc.d/init.d/
[root@rhel5 init.d]# touch oracle10g
[root@rhel5 init.d]# chmod a+x oracle10g
[root@rhel5 init.d]# vim oracle10g
#!/bin/bash
# chkconfig: 345 99 10
# description: Startup Script for Oracle Databases
# /etc/rc.d/init.d/oracle10g
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracle"
# if the executables do not exist -- display error
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: can not start"
exit 1
fi
# depending on parameter -- startup,shutdown,restart
# of the instance and listener or usage display
case "$1" in
'start')
# Oracle listener and instance startup
echo -n "Starting oracle10g: "
su - $ORA_OWNR -c "$ORACLE_HOME/bin/dbstart"
touch /var/lock/subsys/oracle10g
su - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl start"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl start"
echo "OK"
;;
'stop')
# Oracle listener and instance shutdown
echo -n "shutting down oracle10g: "
su - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctl stop"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/dbshut"
su - $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
rm -f /var/lock/subsys/oracle10g
echo "OK"
;;
'reload|restart')
$0 stop
$0 start
;;
*)
echo "Usage:'basename $0' start|stop|restart|reload"
exit 1
esac
exit 0
-----------------------------------------------------------------------------------------------------
3.使用oracle用户修改$ORACLE_HOME/bin/dbstart文件:
# su - oracle
$ cd $ORACLE_HOME/bin
$ gedit dbstart
找到 ORACLE_HOME_LISTNER=.....这行, 修改成
ORACLE_HOME_LISTNER=/u01/app/oracle/product/10.2.0/db_1
或者直接修改成:
ORACLE_HOME_LISTNER=$ORACLE_HOME
注意:是修改,不是增加,可是使用gedit的查找功能查找:
确保执行dbstart命令没有错误,如果不修改上面的路径,dbstart会报错
--------------------------------------------------------------------------------------------------------
4.ROOT用户编辑 /etc/rc.d/rc.local 文件,目前我这边保留的是如下:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.
touch /var/lock/subsys/local
su - oracle -lc "/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl start"
su - oracle -lc "/u01/app/oracle/product/10.2.0/db_1/bin/dbstart"
重启操作系统,就可以自动启动了
- oracle自动启动方法
- ORACLE自动启动方法
- 让oracle自动启动方法!
- 让oracle自动启动方法
- 让oracle自动启动方法!
- 让oracle自动启动方法! 选择自 zcatlinux 的 Blog
- AIX下自动启动Oracle数据库与监听器的方法
- Solaris上Oracle 9i数据库开机自动启动方法
- linux自动启动 oracle
- 自动启动ORACLE脚本
- oracle 开机自动启动
- oracle 开机自动启动
- ORACLE自动启动脚本
- centeros 自动启动oracle
- 在LINUX 启动时自动启动ORACLE 10G多个实例数据库的方法
- Oracle 自动启动与关闭
- ORACLE 自动启动与停止
- Oracle的自动启动脚本
- 公司聚会上不要做的10件事!
- 一位程序员的爱情表白(娱乐版)
- JavaScript js 精确、保留小数方法
- 客户端Git代码的下载与提交
- S2SH乱码问题
- ORACLE自动启动方法
- 浮躁的社会我们更需要冷静地思考
- Apache+php+mysql在windows下的安装与配置图解(最新版)
- 如何清理VS2005中最近的项目列表
- PCB布线 线宽和承载电流
- 真实的用户需求,你真的了解吗?
- 旭日阳刚背叛穷人是大势所趋
- 抽象类与接口的区别
- 取消Editplus保存时自动备份的功能