失效链接处理 |
Centos7.4配置oracle自启动 PDF 下载
本站整理下载:
相关截图:
主要内容:
1.配置 /etc/oratab
# vi /etc/oratab
xdjadb:/u01/app/oracle/product/12.2.0/dbhome_1:Y
2.创建 oracle 服务启动脚本
# vi /etc/init.d/oracle
#!/bin/bash
# chkconfig: 345 61 61
# description: Oracle 12c R2 AutoRun Service
# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interface
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/dbhome_1
export ORACLE_SID=xdjadb
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: cannot 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
su $ORA_OWNR -lc "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
echo "Oracle Start Succesful!OK."
;;
stop)
# Oracle listener and instance shutdown
su $ORA_OWNR -lc "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
echo "Oracle Stop Succesful!OK."
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo $"Usage: `basename $0` {start|stop|reload|reload}"
exit 1
esac
exit 0
3.增加 oracle 服务启动脚本的可执行权限
# cd /etc/rc.d/init.d
# chmod +x oracle
4.加入自启动服务
# chkconfig --add oracle
5.查看自启动服务是否加入成功
# chkconfig --list oracle
|