How to Autostart oracle when Linux server boots up

1. Connect through root user and create the script as below at the location “/etc/init.d”
vi and add the below lines in the script:

export ORACLE_SID=mydb
export ORACLE_BASE=/home/oracle/10.2.0/product
export ORA_OWNER=oracle
su – $ORA_OWNER -c “$ORACLE_HOME/bin/lsnrctl start” $ORACLE_HOME
su – $ORA_OWNER -c $ORACLE_HOME/bin/dbstart $ORACLE_HOME
touch /var/lock/subsys/

Note: Oracle Envirnment variables may change according to the entries in .bash_profile

2. Give proper permission to the root user to avoid permission errors:
chmod +x

3. Connect through root user and create a link to run the script at the time of reboot:

ln -s /etc/init.d/ /etc/rc.d/rc5.d/
The S50 is to tell the system to start the script when it boots up.

4) Update “/etc/oratab”

Connect through oracle user and Update the <N|Y> flag to “Y” for the Database Instance that need to be started up on reboot/default.The first and second fields are the system identifier and home directory of the database respectively. The third filed indicates to the dbstart utility that the database should, “Y”, or should not,”N”, be brought up at system boot time.

# Entries are of the form:
# An example entry:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s