Linux Start Oracle As a Service

last updated in Categories

How do I start the Oracle database server as a service under Linux operating systems?

Starting the Oracle database server is very easy under Linux:

a) Login as an oracle user

b) First start the Oracle listener processes using lsnrctl utility

c) Next start the Oracle database using dbstart utility that reads the oratab file (/etc/oratab)

d) Connect to server using sql plus client or isql pluse web based client

Type the following commands:
$ su - oracle
$ lsnrctl start
$ dbstart

To make the entire process easy we have a shell script that starts and stops Oracle database.

Download script to /tmp directory and rename it as oracle

Copy script to /etc/init.d directory:
# cp /tmp/oracle /etc/init.d/oracle
Create a soft link (Run level 3):

# cd /etc/rc3.d/
# ln -s ../init.d/oracle S100oracle
# ln -s ../init.d/oracle K100oracle

Alternatively, use the chkconfig command to add script:
# chkconfig --add oracle
# chkconfig --list oracle

Please note that you can just use script directly, to start the Oracle type the following command:
# /etc/init.d/oracle start
To stop the Oracle type the following command:
# /etc/init.d/oracle stop

Posted by: Vivek Gite

The author is the creator of nixCraft and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.

9 comment

  1. The download link has been blocked.
    Safe Browsing
    Diagnostic page for
    What is the current listing status for
    Site is listed as suspicious – visiting this web site may harm your computer.
    Part of this site was listed for suspicious activity 3 time(s) over the past 90 days.
    What happened when Google visited this site?
    Of the 17 pages we tested on the site over the past 90 days, 15 page(s) resulted in malicious software being downloaded and installed without user consent. The last time Google visited this site was on 2010-09-14, and the last time suspicious content was found on this site was on 2010-09-14.
    Malicious software is hosted on 1 domain(s), including
    1 domain(s) appear to be functioning as intermediaries for distributing malware to visitors of this site, including
    This site was hosted on 1 network(s) including AS36351 (SOFTLAYER).
    Has this site acted as an intermediary resulting in further distribution of malware?
    Over the past 90 days, did not appear to function as an intermediary for the infection of any sites.
    Has this site hosted malware?
    No, this site has not hosted malicious software over the past 90 days.
    How did this happen?
    In some cases, third parties can add malicious code to legitimate sites, which would cause us to show the warning message.
    Could you please fix it?
    Thank you.

    1. This has been already fixed, but Google will take day or two to remove the same. Try wget.



  2. cheers. was very helpful.
    on RHEL5U4.
    Can you explain what the

    # set username
    # set password

    are for?

  3. thank you for the script.
    do i need to modify the script to use it in Ubuntu 10.10 Desktop , Debian base

  4. For Ubuntu, if you use “alien” to install the Oracle 11g Express server, you will be left with an /etc/init.d/oracle-xe process management script intended for init.d based distributions.

    Ubuntu has excellent documentation on how to wire that script to the system so it autostarts.

    Still, have a question? Get help on our forum!