Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have installed oracle on my ubuntu system a few months ago and its been working pretty well. I have it setup to start on system boot and I run the following commands to stop/start the service

sudo service oracledb start
sudo service oracledb stop

Which also work. However, due to system boot up being very slow, I decided to remove oracle from boot up and I don't use it as frequently as I used to. I wish to start and stop oracle as and when I need it. So, to remove it from startup, I edited my /etc/oratab file

orcl:/u01/app/oracle/product/11.2.0/dbhome_3:Y

I changed the final Y to N (after reading a bit on the web). Now oracle does not start on boot, but the start command doesn't work either. If I change the above to Y, the above start/stop commands immediately work, but oracle will also start at boot time, which is what I am trying to change.

I am unable to figure this out with my google-fu. Is there something else I should do to turn off oracle from starting up at boot time?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The /etc/oratab file is used by Oracle each time it is run, at startup AND when you ask it to run. So if you disable Oracle, it is disabled whatever method you use to run it. So left Y in this file.

To prevent a service to start automatically after boot, just remove it from /etc/rcX.d/ where X is a number from 0 to 7 (the runlevels).
You can manually remove the start links (the links starting with S are for strat, and K are for stop), or use update-rc.d -f oracledb remove; update-rc.d oracledb stop 20 016 . (with the final dot) to remove Oracle start/stop, then just add the stop links (else Oracle won't be stopped when you shutdown the computer).

share|improve this answer
    
Okay, so I believe I am in runlevel 3 right now, how can I confirm this? Also, when you say "Oracle won't be stopped when you shutdown", you mean oracle won't be gracefully shutdown right? (Because it will anyway be killed at system shutdown). –  Shrikant Sharat Mar 3 '12 at 17:55
    
Use the command shown, and you won't have any problem. If you don't, Oracle won't stop correctly at shutdown (except if you know how to delete the rights links, but you wouldn't ask here). –  Gregory MOUSSAT Mar 3 '12 at 21:22

You could start the database up manually when you need it:

$ su - <your oracle user>
ora$ lsnrctl start 
ora$ dbstart

If you don't have dbstart, use sqlplus:

ora$ sqlplus / as sysdba
...
SQL> startup

To shutdown, dbstop or with sqlplus issue shutdown [normal|immediate] depending on what you want. (To stop the listener, lsnrctl stop.)

The other option is most likely to make the oracledb service not start up automatically, and reset the oratab line to Y. How you set the service to manual mode depends on what type of service it is (traditional or upstart). This answer on AskUbuntu has a bunch of details on how to change service startup modes.

share|improve this answer

Your Answer

 
discard

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.