Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've setup a handful of CentOS 5.6 servers with Oracle 11gR2 and not run into this particular problem, but I have hit a wall with CentOS 6.3 and auto-starting Oracle. Not sure if this is related to the newer release of CentOS or me having a PEBKAC moment, but I need a hand.

I've got a working install of Oracle 11gR2 on CentOS 6.3. It runs and is functional. Now I just want it to start with the server. To that end, I've done the following things I usually do:

Created /etc/init.d/oracle:

# oracle Init file for starting and stopping
# Oracle Database. Script is valid for 10g and 11g versions.
# chkconfig: 35 80 30
# description: Oracle Database startup script

# Source function library.

. /etc/init.d/functions


case "$1" in
                su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME"
                su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME"
                echo $"Usage: $0 {start|stop}"

Than ran the following two commands:

  chmod 750 /etc/init.d/oracle
  chkconfig --add oracle --level 0356

When I try a service oracle start, (as root) however, I get this error:

env: /etc/init.d/oracle: No such file or directory

Not sure how to figure out what file we're looking for.

If I run that script's actual start command with the variables expanded the database starts with no errors.

su - oracle -c "/opt/app/oracle/product/11.2.0/db_1/bin/dbstart /opt/app/oracle/product/11.2.0/db_1"

So... what am I missing here? Some casual web searching makes me feel like this approach should still work.

share|improve this question
up vote 2 down vote accepted

Bah. Figured it out right after posting it...

The whole issue was that I had created the "oracle" file on a PC and uploaded it. So it had the wrong line-endings. Rebuilt the file and everything works fine.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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