SUMMARY:
Learn how to configure Oracle Database to start and stop automatically during Linux system reboots using the oratab file and OS startup configuration.
Table of contents
Introduction
Oracle recommends configuring systems to start the Oracle Database at boot automatically and to shut down cleanly during system shutdown.
Automating this process guards against incorrect database shutdowns and ensures high availability after maintenance reboots. While Oracle Restart (via Grid Infrastructure) is the preferred modern replacement for single-instance databases, the traditional dbstart and dbshut scripts remain supported and common in many environments.
Connect and perform these steps as the ROOT user.
Oracle recommends configuring systems to start the Oracle Database at boot automatically and to shut down cleanly during system shutdown. This automation reduces operational risk, prevents improper shutdowns, and improves recovery time after planned maintenance or unexpected reboots.
While Oracle Restart (via Grid Infrastructure) is the preferred modern solution, many environments still rely on dbstart/dbshut for database startup and shutdown.
This article explains how to configure Oracle autostart on Linux, clearly separating modern systemd-based setups from legacy SysV/dbora configurations, so you can safely choose the correct method for your environment.
Connect and perform these steps as the ROOT user.
How to Choose the Correct Oracle Autostart Method on Linux
Choosing the correct autostart method is critical.
Oracle Autostart Methods by Linux Version
| Linux Platform | Version | Autostart Method |
| Oracle Linux / RHEL | 7, 8, 9 | systemd (recommended) |
| Oracle Linux / RHEL | 5, 6 | SysV + dbora (legacy) |
| SLES | 12, 15 | systemd (recommended) |
| SLES | 11 | SysV + dbora (legacy) |
Important: If your system uses systemd, do not configure dbora or chkconfig.
Update /etc/oratabfile for Oracle Autostart (All Systems)
The first step is to tell Oracle which instances should be included in the autostart process.
1. Open the /etc/oratab file.
2. Locate the entry for your database. It will follow the format:
$ORACLE_SID:$ORACLE_HOME:<N|Y>
3. Change the last field from N to Y for each instance you want to autostart.
Note: If you are using a single-instance database with ASM, use W for the database entry and N for the ASM entry to ensure the database waits for ASM to start first.
Section 1: Modern Autostart Using systemd (Preferred)
Applies to: Oracle Linux / RHEL 7+, SLES 12+
Using systemd is the recommended and supported method for autostarting the Oracle database on modern Linux distributions.
Step 1.1: Create the systemd Service File
vi /etc/systemd/system/oracle-db.service
Add the following content (adjust ORACLE_HOME as needed):
[Unit]
Description=Oracle Database Autostart
After=syslog.target network.target
[Service]
Type=forking
User=oracle
Group=oinstall
# Resource limits
LimitNOFILE=1024:65536
LimitNPROC=2047:16384
LimitSTACK=10485760:33554432
LimitMEMLOCK=infinity
ExecStart=<Your_Full_Oracle_Home_Path>/bin/dbstart <Your_Full_Oracle_Home_Path>
ExecStop=<Your_Full_Oracle_Home_Path>/bin/dbshut <Your_Full_Oracle_Home_Path>
RemainAfterExit=True
Restart=no
[Install]
WantedBy=multi-user.target
Step 1.2: Enable Oracle Autostart with systemd
systemctl daemon-reload
systemctl enable oracle-db
systemctl start oracle-db
Step 1.3: Verify Oracle Database Autostart
systemctl status oracle-db
journalctl -u oracle-db.service -b --no-pager
ps -ef | grep pmon
ps -ef | grep tnslsnr
Section 2: Oracle Database Autostart Using dbora (Legacy SysV)
Applies to: Oracle Linux / RHEL 5–6, SLES 11
The dbora method uses SysV init scripts and is considered legacy. Use it only on systems that do not natively support systemd.
Step 2.1: Create the dbora Init Script
The dbora script acts as the bridge between the Linux boot process and the Oracle-provided scripts. This file calls the following files located in the Oracle-provided database home directory.
- $ORACLE_HOME/bin/dbstart
- $ORACLE_HOME/bin/dbshut
1. Navigate to /etc/init.d and create a file named dbora.
vi /etc/init.d/dbora
2. Paste the following script into the file, ensuring you replace the placeholders with your actual ORACLE_HOME path and ORACLE_OWNER:
#! /bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
ORA_HOME=<Your_Full_Oracle_Home_Path>
ORA_OWNER=oracle
case "$1" in
'start')
# Start the Oracle databases and listener
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
touch /var/lock/subsys/dbora
;;
'stop')
# Stop the Oracle databases and listener
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
rm -f /var/lock/subsys/dbora
;;
esac
Step 2.2: Configure Permissions and Group Ownership
To ensure the system can execute the script, you must set the correct permissions.
1. Change the group of the file to the OSDBA group (typicallydba or oinstall).
2. Set the permissions to 750 to allow the owner to read, write, and execute, and the group to read and execute.
chgrp dba /etc/init.d/dbora
chmod 750 /etc/init.d/dbora
Step 2.3: Register dbora for Startup
chkconfig --add dbora
Or manually:
ln -s /etc/init.d/dbora /etc/rc.d/rc0.d/K01dbora
ln -s /etc/rc.d/dbora /etc/rc.d/rc3.d/S99dbora
ln -s /etc/rc.d/dbora /etc/rc.d/rc5.d/S99dbora
SELinux Considerations
If SELinux is set to ENFORCING, legacy SysV scripts may not execute correctly during boot. In such cases, SELinux must be set to PERMISSIVE mode for the scripts to execute correctly during boot.
Please verify your organization’s security policies before making this change.
Section 3: Verification
After a reboot, you can verify if the database and listener started correctly by checking the process monitor (pmon) or reviewing the logs.
#check listener runningps -ef | grep tnslsnr
#check database runningps -ef | grep pmon
Logs to check for troubleshooting:
- /var/log/messages
- $ORACLE_HOME/startup.log
- $ORACLE_HOME/shutdown.log
Final Thoughts
Correctly configuring Oracle Database autostart ensures your most critical platform component is available immediately after system startup—without manual intervention. The key is to use the correct mechanism for your OS version and avoid mixing methods to prevent startup conflicts and database instability.
Need Expert Assistance? Managing complex Oracle environments requires constant vigilance and specialized expertise to ensure peak performance and 99.99% availability. XTIVIA’s Virtual-DBA services provide comprehensive, 24/7 remote database administration and monitoring tailored to your specific infrastructure needs. Whether you need help with automation, performance tuning, or proactive security patching, our certified professionals serve as an extension of your team, keeping your data environments healthy and scalable.
Contact XTIVIA today to learn how our Virtual-DBA team can streamline your operations and provide the peace of mind that comes with world-class database support.