Implementing this task is required for production database, even you're willing to startup the database after the host rebooting. Because your database can crash if it is not shutdown properly due to the host is down!
In this video, we will use systemd which is available on Redhat 7, Redhat 8 and its family (Oracle Linux, CentOS, Rocky)....
This demo is using Oracle Database 21c on Rocky Linux 8.6
The below script is used in the video. You may need to change the location to your ORACLE_HOME
-------------------------
# cd /usr/lib/systemd/system # vi oracle.service [Unit] Description=Oracle Database Service After=network.target [Service] Type=simple RemainAfterExit=yes User=oracle Group=dba Environment="ORACLE_HOME=/u02/app/oracle/product/21c/dbhome_01" ExecStart=/u02/app/oracle/product/21c/dbhome_01/bin/dbstart $ORACLE_HOME >> 2>&1 & ExecStop=/u02/app/oracle/product/21c/dbhome_01/bin/dbshut $ORACLE_HOME 2>&1 & TimeoutSec=120 [Install] WantedBy=multi-user.target
----------------
No comments:
Post a Comment