After successful installation of oracle database on Linux follow below procedure to autostart the oracle database after server reboot

Auto Start Oracle 11g Database on Linux

Step 1 – Login as root user, edit oratab file and modify the letter N to Y

vi /etc/oratab
ORCL:/u01/app/oracle/product/11.2.0/dbhome_1:Y

Step 2 – Create Init script for autostart and stop service

[root@~]# cd /etc/init.d
[root@init.d]# vi dbora
!/bin/sh
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORACLE_OWNER=oracle
case "$1" in
'start') # Start the Oracle databases and listeners
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
;;
'stop') # Stop the Oracle databases and listeners
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
;;
esac

Step 3 -Add init script created to the run level

[root@ init.d]# 
chgrp dba dbora
chmod 750 dbora
ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
ln -s /etc/init.d/dbora /etc/rc.d/rc3.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc.d/rc5.d/S99dbora

Step 4 – Reboot and test database service and listner service is starting automatically

[oracle@dbbackup]$ ps -ef|grep smon
oracle 13095 1 0 08:49 ? 00:00:00 ora_smon_orcl
[oracle@dbbackup]$ ps -ef|grep tns
oracle 8415 1 0 08:48 ? 00:00:00 /u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr LISTENER -inherit

Auto Start Oracle 12c Database on Linux

mkdir /home/oracle/scripts

By mithun

One thought on “Auto Start Oracle Database on Linux”
  1. Hi Mithun,
    I have oracle 19c running on “Ubuntu” VERSION=”20.04. I have followed the steps you mentioned very closely. Everything works excepty for one. issuuing the commands “service dbora stop” and “service dbora start” and they work. The Oracle database staops and srats as expected.
    However when I stop the server the service “service dbora stop” works but when I START the server the service
    “service dbora start” does NOT kick in. However they are set up similarly. Any ideas/comments will be appriciated.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.