欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 健康 > 美食 > oracle19c开机自启动

oracle19c开机自启动

2026/3/5 9:05:34 来源:https://blog.csdn.net/u012593882/article/details/143820658  浏览:    关键词:oracle19c开机自启动

配置

cat > /etc/init.d/oracle19c <<'EOF'
#!/bin/bash
# Oracle startup and shutdown scriptexport ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export ORACLE_SID=ORCLCDB
export LISTENER_NAME=LISTENER
# General exports and vars
export PATH=$ORACLE_HOME/bin:$PATHcase "$1" instart)echo "Starting Oracle Database and Listener..."sqlplus -s / as sysdba <<EOF1startup;alter pluggable database all open;exit;
EOF1lsnrctl start;;stop)echo "Stopping Oracle Database and Listener..."lsnrctl stopsqlplus -s / as sysdba <<EOF2shutdown immediate;exit;
EOF2;;*)echo "Usage: $0 {start|stop}"exit 1;;
esacexit 0
EOFchmod 755 /etc/init.d/oracle19c
cat > /usr/lib/systemd/system/oracle.service <<"EOF"
[Unit]
Description=Oracle Database and Listener
After=network.target[Service]
Type=forking
User=oracle
Group=oinstall
ExecStart=/etc/init.d/oracle19c start
ExecStop=/etc/init.d/oracle19c stop
Restart=on-failure[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable --now oracle

参考连接

https://www.cnblogs.com/dll102/p/18454351
https://blog.csdn.net/Pepsiboy1/article/details/141718609?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EYuanLiJiHua%7EPosition-3-141718609-blog-143025821.235%5Ev43%5Econtrol&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EYuanLiJiHua%7EPosition-3-141718609-blog-143025821.235%5Ev43%5Econtrol&utm_relevant_index=6

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词