Forum Stats

  • 3,741,232 Users
  • 2,248,397 Discussions
  • 7,861,693 Comments

Discussions

Oracle 11gR2 systemd startup script

newbieRyan
newbieRyan Member Posts: 45
edited Mar 30, 2013 9:04AM in General Database Discussions
I would like to write down the systemd startup script here for I can't find any on the internet. wish people don't have to browse around and find nothing.
everything on internet is about 9i and no systemd startup script example.
I hv tried several times that the script runs right and start up oracle at bootup.
Issuing systemctl and it returns the following
oracle.service                loaded active exited    Oracle database server
the script is working on my Fedora 18 x86_64.
Please give your input if you find mistake, error, or anything wrong.
Thank you


oracle.service
[Unit]
Description=Oracle database server
After=syslog.target network.target

[Service]
Type=oneshot
User=oracle
Group=oinstall
RemainAfterExit=yes
ExecStart=/bin/oracle.sh;

[Install]
WantedBy=multi-user.target
oracle.sh
#! /bin/bash
#  script used by oracle.service

ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
ORACLE_SID=orcl
ORACLE_BASE=/home/oracle/app/oracle/product/11.2.0

$ORACLE_HOME/bin/lsnrctl start;
$ORACLE_HOME/bin/dbstart $ORACLE_HOME;
Tagged:
elygre

Comments

  • EdStevens
    EdStevens Member Posts: 28,240 Gold Crown
    newbieRyan wrote:
    I would like to write down the systemd startup script here for I can't find any on the internet. wish people don't have to browse around and find nothing.
    everything on internet is about 9i and no systemd startup script example.
    Really??!?!?!

    I googled 'start oracle on linux startup" and the very first hit is pretty much the standard reference on the subject: http://www.oracle-base.com/articles/linux/automating-database-startup-and-shutdown-on-linux.php




    I hv tried several times that the script runs right and start up oracle at bootup.
    Issuing systemctl and it returns the following
    {code}
    oracle.service loaded active exited Oracle database server
    {code}
    the script is working on my Fedora 18 x86_64.
    Please give your input if you find mistake, error, or anything wrong.
    Thank you


    oracle.service
    {code}
    [Unit]
    Description=Oracle database server
    After=syslog.target network.target

    [Service]
    Type=oneshot
    User=oracle
    Group=oinstall
    RemainAfterExit=yes
    ExecStart=/bin/oracle.sh;

    [Install]
    WantedBy=multi-user.target

    {code}

    oracle.sh
    {code}
    #! /bin/bash
    # script used by oracle.service

    ORACLE_HOME=/home/oracle/app/oracle/product/11.2.0/dbhome_1
    ORACLE_SID=orcl
    ORACLE_BASE=/home/oracle/app/oracle/product/11.2.0

    $ORACLE_HOME/bin/lsnrctl start;
    $ORACLE_HOME/bin/dbstart $ORACLE_HOME;

    {code}
  • newbieRyan
    newbieRyan Member Posts: 45
    your googled is SysV init, not Systemd.
    elygre
This discussion has been closed.