龙空技术网

配置 Oracle 数据库开机启动

幸福梦影视 289

前言:

目前咱们对“oracle 自启动配置”大约比较关切,小伙伴们都想要学习一些“oracle 自启动配置”的相关资讯。那么小编在网上汇集了一些对于“oracle 自启动配置””的相关文章,希望兄弟们能喜欢,大家一起来了解一下吧!

配置Oracle开机启动

以下步骤全部通过 root 账户执行

1. 创建 Oracle 启动脚本文件

vi /home/oracle/.startdb

#! /bin/bashsource /home/oracle/.bash_profilelsnrctl startsqlplus / as sysdba<<EOFstartupEOF
2. 创建Oracle 关闭脚本文件

vi /home/oracle/.stopdb

#! /bin/bashsource /home/oracle/.bash_profilelsnrctl stopsqlplus / as sysdba <<EOFshutdown immediateEOF
3. 创建Oracle 服务

vi /etc/init.d/oracle

#! /bin/bash## Oracle Bring up/down Oracle Service## chkconfig: 2345 10 90# description: Activates/Deactivates oracle service configured to start at boot time.#====================================================================================# Source function library.. /etc/init.d/functions# See how we were called.case "$1" in start) su - oracle -c "/home/oracle/.startdb" ;; stop) su - oracle -c "/home/oracle/.stopdb" ;; status) ps -ef | grep 'ora_' | grep -v 'grep' ;; restart|reload|force-reload) $0 stop $0 start rc=$? ;; *) echo $"Usage: $0 {start|stop|status|restart|reload|force-reload}" exit 2esacexit $rc
4. 添加可执行权限,并设定开机启动
chmod +x /home/oracle/.st*chmod +x /etc/init.d/oraclechkconfig oracle on
5. 验证Oracle 服务状态
service oracle stopservice oracle startservice oracle status

标签: #oracle 自启动配置 #oracle数据库启动阶段 #怎么开启oracle数据库 #起oracle服务 #oraclestartup48108