Site icon Database Tutorials

How to Start Oracle Database Automatically When Linux Server Is Started

 

In this article, I will share linux scripts with you for staring database automatically when operating system is started.

My environment is:

Oracle 11.2.0.4 database on Oracle Enterprise Linux 6.5

First of all, we must set Oracle environment variables in a profile file.

This script must be run as a OS service so, we must create a service file under “init.d” directory. I named this file “orclScript”.

Give chmod 750 to this file.

Add orclScript service to chkconfig.

This script runs startup and shutdown scripts. So let’s create this two scripts with oracle database OS user. Put this scripts under “dbscripts” directory.

Now let’s create our startup and shutdown scripts.

/home/oracle/dbscripts/startup.sh

 

/home/oracle/dbscripts/shutdown.sh

We must give execution permission to these scripts.

Our database will start when our server is started. Also we can use service commmand to start and shutdown the database.

Exit mobile version