Ubuntu – Oracle only starts with autostart, doesn’t when trying manually

oracleUbuntu

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?

Best Answer

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).

Related Topic