Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Systemd and Oracle start/stop

Peter_L_Aug 17 2016 — edited Sep 1 2016

Hi,

regarding this Doc

https://docs.oracle.com/cd/B28359_01/server.111/b32009/strt_stp.htm#CFAHAHGA

what is the official way to implement Oracle instance/listener start/stop with OL7 UEK and systemd?

I did not found any official docs to that.

Because Sysvinit and chkconfig (dbora) are probably only offered by systemd and RHEL7 for backward compatibilty purposes and may be in future releases not available, I want to use systemd right from start of new OL7 system.

What are your used practices and experiences?

Thank you very much!

Peter

Update:

During tests I remarked that "systemctl stop dbora.service" worked well but  a reboot or init 0 does not trigger the "dbora stop" function and the database instance crashed. Althoug all runleves was set correctly.  I assume that the service managed by systemd over "systemd-sysv-generator" does not wait until the shutdown procedure has finished.

Anyway I've found a solution for systemd here:

https://kchiu.wordpress.com/2015/10/29/oracle-database-12c-installation/

the service unitfile as

/etc/systemd/system/dbora.service

should be:

# Systemd unit file dbora

[Unit]

Description=Oracle Database 12c

After=syslog.target network.target

[Service]

Type=simple

RemainAfterExit=yes

User=oracle

Group=dba

Environment="ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1"

ExecStart=/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbstart $ORACLE_HOME >> 2>&1 &

ExecStop=/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbshut $ORACLE_HOME 2>&1 &

[Install]

WantedBy=multi-user.target

Then enable the service:

systemctl daemon-reload

systemctl enable dbora

systemctl start dbora

That works very well.

Nachricht geändert durch Wicaz

This post has been answered by Peter_L_ on Aug 18 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 29 2016
Added on Aug 17 2016
4 comments
11,221 views