CentOS 7
Sponsored Link

Oracle Database 18c : Create Systemd Setting2018/12/05

 
Create Systemd Setting file for Oracle Database services.
[1] Login as root user and create Systemd files.
[root@dlp ~]#
vi /etc/sysconfig/db01.oracledb
# create new : define environment variables

ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/usr/oracle/database
ORACLE_SID=db01
# configure listener service

[root@dlp ~]#
vi /usr/lib/systemd/system/db01@lsnrctl.service
# this is an example, modify for free

[Unit]
Description=Oracle Net Listener
After=network.target

[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/db01.oracledb
ExecStart=/usr/oracle/database/bin/lsnrctl start
ExecStop=/usr/oracle/database/bin/lsnrctl stop
User=oracle

[Install]
WantedBy=multi-user.target

# configure database service

[root@dlp ~]#
vi /usr/lib/systemd/system/db01@oracledb.service
# this is an example, modify for free

[Unit]
Description=Oracle Database service
After=network.target lsnrctl.service

[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/db01.oracledb
ExecStart=/usr/oracle/database/bin/dbstart $ORACLE_HOME
ExecStop=/usr/oracle/database/bin/dbshut $ORACLE_HOME
User=oracle

[Install]
WantedBy=multi-user.target

[root@dlp ~]#
systemctl daemon-reload

[root@dlp ~]#
systemctl enable db01@lsnrctl db01@oracledb

Matched Content