Home‎ > ‎

Starting and Stopping Oracle in Windows

    Usually, when you install Oracle 11g, it is setup such that it always starts along with Windows. This may slow down Windows startup a lot if you have less RAM or have many applications to be started along with Windows. This article shows you how to prevent Oracle 11g from starting automatically with Windows. It also shows you how to start and stop Oracle at your own will.

    Before proceeding, I'd like to mention that the global database name that I've used is mydb and the username is abhiram. They are highlighted wherever they are found in this article to catch your attention.
You just replace them with your own global database name and username when following this article in your system. The exact release of Oracle Database being used is Oracle 11gR2.

    First, let's see how we can prevent the autostart of Oracle 11g.
  1. Open Run box either from Start Menu or by holding Windows key and letter R together
  2. Type services.msc and press enter
  3. Find the Oracle 11g services with names OracleOraDb11g_home1TNSListener, OracleServiceMYDB  and OracleDBConsolemydb
  4. Change their startup type from Automatic to Manual by right clicking on each of them, selecting properties and changing the value in startup type.
    Now, we have to write two batch files, one for starting Oracle 11g and the other for stopping the same. Let's see the  batch file which starts Oracle. Just copy the below lines into notepad and save the file as "Start Oracle.bat". Remember to replace the global database name and username.

net start OracleOraDb11g_home1TNSListener
net start OracleServiceMYDB
call C:\app\abhiram\product\11.2.0\dbhome_1\bin\emctl.bat start dbconsole
pause

    Next comes the batch file that stops Oracle. Just copy the below lines into notepad and save the file as "Stop Oracle.bat". Remember to replace the global database name and username.

call C:\app\abhiram\product\11.2.0\dbhome_1\bin\emctl.bat stop dbconsole
net stop OracleOraDb11g_home1ClrAgent
net stop OracleMTSRecoveryService
net stop OracleOraDb11g_home1TNSListener
net stop OracleServiceMYDB
pause

    You might also have to change the product version in the path from 11.2.0 to other in both of these batch files. Just open explorer, navigate to C:\app\[username]\product and see the product version you have.    

    I suggest you copying these two batch files to either desktop or Oracle menu in the All Programs section of Start menu. Now you can easily start or stop Oracle as you wish.

Share this article with your friends:
 
 
 


 

Feedback:


Number of visits to this page: