summarylogtreecommitdiffstats
path: root/oracle-xe.service
diff options
context:
space:
mode:
Diffstat (limited to 'oracle-xe.service')
-rw-r--r--oracle-xe.service20
1 files changed, 16 insertions, 4 deletions
diff --git a/oracle-xe.service b/oracle-xe.service
index e84e5e6b72b0..a9d2c6774a84 100644
--- a/oracle-xe.service
+++ b/oracle-xe.service
@@ -1,8 +1,20 @@
[Unit]
-Description=Oracle XE
+Description=Oracle Database Express Edition
[Service]
+Environment=ORACLE_HOME=/opt/oracle/product/18c/dbhomeXE
+Environment=ORACLE_SID=XE
+User=oracle
+Group=oinstall
+LimitNOFILE=65536
+LimitNPROC=16384
+LimitSTACK=33554432
+LimitMEMLOCK=134217728
Type=oneshot
-ExecStart=/etc/rc.d/oracle-xe-18c start
-ExecStop=/etc/rc.d/oracle-xe-18c stop
-RemainAfterExit=yes
+ExecStartPre=/opt/oracle/product/18c/dbhomeXE/bin/lsnrctl start LISTENER
+ExecStart=bash -c 'echo -e "connect / as sysdba\nstartup\nalter pluggable database all open\nexit;" | /opt/oracle/product/18c/dbhomeXE/bin/sqlplus -s /nolog'
+ExecStop=bash -c 'echo -e "connect / as sysdba\nshutdown immediate\nexit;" | /opt/oracle/product/18c/dbhomeXE/bin/sqlplus -s /nolog'
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target