欢迎进入oracle社区论坛,与200万技术人员互动交流 >>进入
六、设置oracle自动启动与关闭
1、编辑 /etc/oratab,把所有的 instance 的重启动标志设置成 'y',如:
fstest:/oracle/product/10.2.0:y
2、做一个启动脚本 /etc/init.d/dbora ,如下所示:
#!/bin/sh
# description: oracle auto start-stop script.
# chkconfig: - 20 80
#
# set ora_home to be equivalent to the $oracle_home
# from which you wish to execute dbstart and dbshut;
#
# set ora_owner to the user id of the owner of the
# oracle database in ora_home.
ora_home=/oracle/product/10.2.0/
ora_owner=oracle
if [ ! -f $ora_home/bin/dbstart ]
then
echo oracle startup: cannot start
exit
fi
case $1 in
'start')
# start the oracle databases:
# the following command assumes that the oracle login
# will not prompt the user for any values
su - $ora_owner -c $ora_home/bin/dbstart
su - $ora_owner -c $ora_home/bin/lsnrctl start
;;
'stop')
# stop the oracle databases:
# the following command assumes that the oracle login
# will not prompt the user for any values
su - $ora_owner -c $ora_home/bin/lsnrctl stop
su - $ora_owner -c $ora_home/bin/dbshut
;;
'restart')
$0 stop
$0 start
;;
esac
3、赋予执行权限
chmod 750 /etc/init.d/dbora
作成以下链接:
ln -s /etc/init.d/dbora /etc/rc0.d/k10dbora
ln -s /etc/init.d/dbora /etc/rc3.d/s99dbora
执行以下命令:
chkconfig --level 345 dbora on
我在u3下装过n次了,只要你按步骤做应该没有问题
trackback: http://tb.blog.csdn.net/trackback.aspx?postid=1479943
[1] [2] [3]
