您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息
免费发信息

Linux环境下配置Oracle自启动

2024/4/27 2:54:44发布7次查看
修改oracle系统配置文件/etc/oratab,如果没有oratab文件,执行root.sh生成该oratab文件。vi /etc/oratab文件 orcl:/home/oracle/
首先在/etc/rc.d/init.d/目录下配置oracle的服务文件。
touch oracle10g
chmod a+x oracle10g
然后编辑此oracle10g文件。脚本内容如下。
[root@~]# vi /etc/rc.d/init.d/oracle
#!/bin/bash
#root
#chkconfig:35 85 15
#description:oracle
#/etc/rc.d/init.d/oracle
oracle_base=/u01/app/oracle
oracle_home=$oracle_base/product/10.2.0/db_1
oracle_sid=orcl
case $1 in
start)
echo -n starting oracle10g:
su - oracle -c dbstart >>$oracle_home/log/autostart.log
su - oracle -c lsnrctl start >>$oracle_home/log/autostart.log
su - oracle -c emctl start dbconsole >>$oracle_home/log/autostart.log
;;
stop)
echo -n shutting down oracle10g:
su - oracle -c emctl stop dbconsole >>$oracle_home/log/autostart.log
su - oracle -c lsnrctl stop >>$oracle_home/log/autostart.log
su - oracle -c dbshut >>$oracle_home/log/autostart.log
;;
restart)
echo -n restarting oracle10g:
su - oracle -c dbshut >>$oracle_home/log/autostart.log
su - oracle -c lsnrctl stop >>$oracle_home/log/autostart.log
su - oracle -c emctl stop dbconsole >>$oracle_home/log/autostart.log
su - oracle -c dbstart >>$oracle_home/log/autostart.log
su - oracle -c lsnrctl start >>$oracle_home/log/autostart.log
su - oracle -c emctl start dbconsole >>$oracle_home/log/autostart.log
;;
*)
echo usage: $0{start|stop|restart}
exit 1
;;
esac
exit 0
保存文件,退出以后,添加并启动察看服务。
/sbin/chkconfig --add oracle10g
/sbin/chkconfig --list oracle10g
修改oracle系统配置文件/etc/oratab,如果没有oratab文件,执行root.sh生成该oratab文件。vi /etc/oratab文件
orcl:/home/oracle/ora/products/10.2.0:n
改成
orcl:/home/oracle/ora/products/10.2.0:y
y:代表随机启动,n:手动启动
重新启动linux的时候,如果看到启动项oracle出现ok,,代表oracle成功随linux启动了。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录