1. Connect through root user and create the script as below at the location “/etc/init.d”
vi startup_reboot.sh and add the below lines in the script:
su – $ORA_OWNER -c “$ORACLE_HOME/bin/lsnrctl start” $ORACLE_HOME
su – $ORA_OWNER -c $ORACLE_HOME/bin/dbstart $ORACLE_HOME
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 startup_reboot.sh
3. Connect through root user and create a link to run the script at the time of reboot:
ln -s /etc/init.d/startup_reboot.sh /etc/rc.d/rc5.d/S50startup_reboot.sh
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: