首页 > 数据库 > Oracle > linux7 开机自启动oracle
[oracle@localhost ~]$ tail -1 /etc/oratab orcl:/u01/oracle/product/11.2.0/db_1:Y
注意:如果需要监听随开机启动,最后在dbstart后面跟随ORACLE_HOME的路径。
[root@localhost ray]# vim /lib/systemd/system/oracle.service [Unit] Description=oracle Server After=network.target [Service] Type=forking User=oracle Group=oinstall ExecStart=/u01/oracle/product/11.2.0/db_1/bin/dbstart /u01/app/oracle/product/19.3.0/dbhome_1 ExecStop=/u01/oracle/product/11.2.0/db_1/bin/dbshut /u01/app/oracle/product/19.3.0/dbhome_1 ExecReload= PrivateTmp=true [Install] WantedBy=multi-user.target
[root@localhost ~]# systemctl enable oracle Created symlink from /etc/systemd/system/multi-user.target.wants/oracle.service to /usr/lib/systemd/system/oracle.service
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/28572479/viewspace-2213230/ ,如需转载,请注明出处,否则将追究法律责任。