I successfully installed Oracle 11g on a Fedora 15 system using this guide. Unfortunately, unlike when I'm using Windows, it seems I need to restart the database every single time I reboot my machine (it's a development machine, not a server).

I'm not sure this is the intended behavior or if I messed up something while installing the database.

Anyway, every single I reboot the machine I need to:

  • Use su to change the current user to the oracle user.
  • Use sqplus to startup the database.

Like this:

(oracle@machine)$ sqplus / as sysdba
SQL> startup
SQL> (Ctrl+D)
  • Then I need to start the listener using lsnrctl.

Once more:

(oracle@machine)$ lsnrctl start 
  • And now the Enterprise Manager should also be started.

At least:

(oracle@machine)$ emctl start dbconsole

I've taken those instructions from here.

I'm sorry if this quite noobish, I usually have a DBA or a sysadmin to setup an environment for me but I'm doing this at home, where I have no help (maybe I'm becoming quite spoiled as a developer :)).

I wonder if it's possible to automate this on Fedora 15 using a shell script. After automating, I'd like to hook this on the init system, so it's performed every time I start the machine.


I've found an answer on this guide on how to install Oracle 11g on CentOS 5.3. I did some minor tweaking on the init script. For the sake of completeness, I'll add steps here:

  • Edit /etc/oratab and change the last N on the configuration file to an Y.

Like this:


To this:

  • Create the script /etc/init.d/dbora.

It should have this contents:

# chkconfig: 345 99 10
# 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.


if [ ! -f $ORA_HOME/bin/dbstart ]
        echo "Oracle startup: cannot start"

case "$1" in


# 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/emctl start dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"


# 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/emctl stop dbconsole"
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"

  • Then change the script permission.

Like this:

chmod 750 /etc/init.d/dbora
  • Add it to chkconfig

Like this:

chkconfig --level 345 dbora on

Test it with /etc/init.d/dbora start and /etc/init.d/dbora stop. Be sure to have the correct path on the dbora script.


I think lsnrctl start is already included in the dbstart script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.