Frage zu systemd und Oracle Express Edition 11 auf openSUSE 13.2

Hallo,

hat das schon mal einer gemacht?

Mit 12.2 und sysvinit war das kein Problem, die Installation etwas anpassen an openSUSE, alles klar.
Mit 13.1 und systemd geht es auch noch, aber 13.2 wird zum Albtraum.

Mit systemd klappt das starten auch, entweder über /etc/init.d/oracle-xe oder einen
selbst geschriebenen /usr/lib/systemd/system/oracledb.service Service-File.

Das herunterahren (reboot/poweroff) stellt allerdings ein Problem dar:
Das geht so schnell das die oracle-xe gar keine Zeit bekommt(?) sich runterzufahren,
da wird sie schon abgeschossen.

Beim nächsten start macht sie zwar ein Crash recovery, fühlt sich aber nicht gut an.

Das sieht dann so aus:
shutdown:


Performing implicit shutdown abort due to dead PMON
Shutting down instance (abort)
License high water mark = 3
USER (ospid: 1648): terminating the instance
Instance terminated by USER, pid = 1648
Thu Feb 26 22:42:50 2015
Instance shutdown complete
ORA-1092 : opitsk aborting process
Fri Feb 27 20:20:47 2015

startup:


Beginning crash recovery of 1 threads
Started redo scan
Completed redo scan
 read 57 KB redo, 50 data blocks need recovery
Started redo application at
 Thread 1: logseq 19, block 3
Recovery of Online Redo Log: Thread 1 Group 1 Seq 19 Reading mem 0
  Mem# 0: /u01/app/oracle/fast_recovery_area/XE/onlinelog/o1_mf_1_bgsxvxd8_.log
Completed redo application of 0.04MB
Completed crash recovery at
 Thread 1: logseq 19, block 117, scn 648314
 50 data blocks read, 50 data blocks written, 57 redo k-bytes read

Kann man reboot/poweroff irgendwie verlangsamen / bremsen?

Hier der /usr/lib/systemd/system/oracledb.service:


[Unit]
Description=<<< Oracle Express Edition 11 >>>
After=syslog.target network.target

[Service]
Type=simple
Environment=ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
Environment=ORACLE_OWNER=oracle
Environment=ORACLE_SID=XE
Environment=LSNR=$ORACLE_HOME/bin/lsnrctl
Environment=SQLPLUS=$ORACLE_HOME/bin/sqlplus
Environment=ORACLE_BASE=/u01/app/oracle
Environment=NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
Environment=ORACLE_ADMIN=/u01/app/oracle/admin/$ORACLE_SID
Environment=ORACLE_FLASH=/u01/app/oracle/fast_recovery_area/$ORACLE_SID
Environment=ORACLE_ALERT=/u01/app/oracle/diag/rdbms/xe/XE/trace
Environment=ORACLE_DATA_PUMP_DIR=/u01/app/oracle/admin/XE/dpdump
Environment=DIAGNOSTIC_DEST=$ORACLE_HOME/log
Environment=TNS_ADMIN=$ORACLE_HOME/network/admin
ExecStartPre=/usr/bin/echo "<<< Starting Oracle Express Edition 11 >>>"
ExecStart=/usr/bin/su oracle -c "/u01/app/oracle/product/11.2.0/xe/bin/startup.sh"
ExecStartPost=/usr/bin/touch /var/lock/subsys/listener
ExecStartPost=/usr/bin/touch /var/lock/subsys/oracle-xe
ExecStopPost=/usr/bin/echo "<<< Stopping Oracle Express Edition 11 >>>"
ExecStop=/usr/bin/su oracle -c "/u01/app/oracle/product/11.2.0/xe/bin/shutdown.sh"
ExecStopPost=/usr/bin/rm -f /var/lock/subsys/oracle-xe
ExecStopPost=/usr/bin/rm -f /var/lock/subsys/listener
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target

Das original /etc/init.d/oracle-xe von oracle kann ich auch noch liefern,
wenn gewünscht, ist aber ziemlich lang.

Das ganze läuft übrigens auf ext4 mit den Partitionen
swap
/
/u01
/srv/samba

ohne snapper, minimal ohne GUI

MfG

ok, keine Beiträge, macht erstmal nix.

Folgende Lösung hab ich mir überlegt:


mv  /sbin/reboot  /sbin/remove.local

Ein neues Shell-script erstellen /sbin/reboot:


#!/bin/bash
service oracle-xe stop
/sbin/reboot.local

ausführbar machen:


chmod 777 /sbin/reboot

Und jetzt das gleiche mit shutdown:


mv  /sbin/shutdown  /sbin/shutdown.local

Ein neues Shell-script erstellen /sbin/shutdown:


#!/bin/bash
service oracle-xe stop
/sbin/shutdown.local

ausführbar machen:


chmod 777 /sbin/shutdown

Jetzt darf man nur nicht mehr ein Update machen, /sbin/reboot und /sbin/shutdown
könnten überschrieben werden.

Das Problem tritt ja nur bei shutdown und reboot auf.
Das Datenbanksystem manuell stoppen und starten funktioniert probemlos.

shutdown und reboot sind eigentlich Links aus /sbin/systemctl ?
Das verstehe ich jetzt garnicht.
systemctl alleine kann ich nicht ausführen.

MfG

ok, jetzt packen wir das mal alles in ein Script und hauen die Fehler raus:


#!/bin/bash
#
# all commands pointing to /usr/bin/systemctl
#

mv /sbin/reboot /sbin/reboot.local
cat > /sbin/reboot <<EOF
#!/bin/bash
service oracle-xe stop
/sbin/reboot.local
EOF
chmod 777 /sbin/reboot

mv /sbin/poweroff /sbin/poweroff.local
cat > /sbin/poweroff <<EOF
#!/bin/bash
service oracle-xe stop
/sbin/poweroff.local
EOF
chmod 777 /sbin/poweroff

mv /sbin/shutdown /sbin/shutdown.local
cat > /sbin/shutdown <<EOF
#!/bin/bash
service oracle-xe stop
/sbin/shutdown.local
EOF
chmod 777 /sbin/shutdown

mv /sbin/halt /sbin/halt.local
cat > /sbin/halt <<EOF
#!/bin/bash
service oracle-xe stop
/sbin/halt.local
EOF
chmod 777 /sbin/halt

Und wer’s dann wieder rückgängig machen will:


# remove all the links after removing Oracle XE
rm /sbin/reboot
mv /sbin/remove.local /sbin/remove

rm /sbin/poweroff
mv /sbin/poweroff.local /sbin/poweroff

rm /sbin/shutdown
mv /sbin/shutdown.local /sbin/shutdown

rm /sbin/halt
mv /sbin/halt.local /sbin/halt