Login to where the Oracle DB is installed and vi as root

[bash]vi /etc/oratab[/bash]

Edit the file, find and set the lines as follows:

[text]orcl:/u01/app/oracle/product/10.2.0/db_1:N[/text]
vi cmd to type Insert key
[text]orcl:/u01/app/oracle/product/10.2.0/db_1:Y[/text]
vi cmd Esc to exit editing
vi cmd to write/save and exit :wq

Edit dbora, which is mainly to set the ORA home and owner and execute the listener to start or stop

[bash]vi /etc/init.d/dbora #file will be created if it does not exist[/bash]

Edit the file and enter the following as specific to your ORA environment vars:

[text]#!/bin/sh
# description: Oracle auto start-stop script.
# # Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
# # Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME PATH

ORA_HOME=/u01/app/oracle/product/10.2.0/db_1
ORA_OWNER=oracle

if [ ! -f $ORA_HOME/bin/dbstart ] then
echo “Oracle startup: cannot start”
exit fi

case “$1” in
‘start’)
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su $ORA_OWNER -c “$ORA_HOME/bin/dbstart $ORA_HOME” ;
;

‘stop’)
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su $ORA_OWNER -c “$ORA_HOME/bin/dbshut $ORA_HOME” ;
;
esac[/text]

Set the appropriate privileges to the file:
[bash]chmod 750 /etc/init.d/dbora[/bash]

Notes:
May need to set in /u01/app/oracle/product/10.2.0/db_1/bin/dbstart
[text]ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle/bin/tnslsnr
to:
ORACLE_HOME_LISTNER=$ORACLE_HOME[/text]

…in some cases where the listener won’t start.