O.S Start/Stop script integration since Red Hat/Oracle Linux 7

DMK provides a tiny script, which integrated to the boot procedure serves to start & stop all the oracle services smoothly, source code:

cat ${DMK_HOME}/templates/systemd/oracle.service

[Unit]
Description=Oracle Database Service
After=network-online.target remote-fs.target local-fs.target
Requires=network-online.target remote-fs.target local-fs.target
[Service]
LimitMEMLOCK=infinity
LimitNOFILE=65535
Type=simple
RemainAfterExit=yes
User=oracle
Group=oinstall
ExecStart=/u01/app/oracle/local/dmk/bin/service_start_stop.ksh start
ExecStop=/u01/app/oracle/local/dmk/bin/service_start_stop.ksh stop
TimeoutStartSec=200s
TimeoutStopSec=200s
[Install]
WantedBy=multi-user.target

Below, all steps for the implementation & integration into the boot sequence:

  • Firstly, copy the script to the /usr/lib/systemd/system” source code repository and set the correct privileges

cp /u01/app/oracle/local/dmk/templates/systemd/oracle.service \\
/usr/lib/systemd/system/
chmod 644 /usr/lib/systemd/system/oracle.service

Deploy and adapt the configuration file service_start_stop.conf In $DMK_HOME/etc

cp /u01/app/oracle/local/dmk/templates/etc/service_start_stop.conf \\
/u01/app/oracle/local/dmk/etc/
  • Secondly, reload systemd and enabled the new service

[root@svr01 ~]# systemctl daemon-reload
[root@svr01 ~]# systemctl enable oracle.service

All necessary systemd link and dependencies are automatically performed by the O.S

  • Finally, Verify the integration

[root@svr01 ~]# systemctl status oracle.service
● oracle.service - The Oracle Database Service
 Loaded: loaded (/usr/lib/systemd/system/oracle.service; enabled;
 vendor preset: disabled)
Active: inactive (dead)
  • Tail the systemd logfile

[root@svr01 ~]# journalctl --unit=oracle -f

Last updated