Thursday, 5 September 2013

How to uninstall Oracle 11g from Windows 7/8

Yesterday, i installed oracle 11g on my machine due to some project needs but i found it was so hard to use because previously i used MySQL and the workbench the comes with MySQL is damn simple & easy to use.
Now today i decided to uninstall oracle and i was totally shocked with the uninstallation process so i thought i should share it so you may not encounter the same problem.
Below are the steps that you should follow to uninstall oracle 11g from your windows machine-

Try to use the Universal Installer to uninstall oracle. If this works then you are good and no need to read below but if you are out of luck like me then this will prompt you of a location when you will click on the remove button present there.
Basically it will ask you to use deinstall.bat file to uninstall oracle present in deinstall directory. Now the main fight begins-

1. The first thing is to stop the oracle services that are running - use services.msc and search for these services and stop them.
    • OracleE1LocalTNSListener
    • OracleServiceE1LOCAL
2. Now go the the deinstall directory that you were asked to go above and run the deinstall.bat file. 
Note: Please dont double click and run but use run as administrator - this is must

3. During installation, the OEESetup.exe program should have created several files in the c:\Oracle\<SSID>\deinstall directory. If the files were successfully created, the deinstall.bat program will not prompt for any input from the user. If for some reason the files were not created, the deinstall.bat program will prompt the user for information needed to deinstall the database. You can take the default values (shown in square brackets) for most of the prompts. These are the prompts and the values you need to provide:
  1. Specify all Single Instance listeners that are to be de-configured [LISTENER]: LISTENER
  2. Specify the list of database names that are configured in this Oracle home [E1LOCAL]: <what ever comes in [...]> 
  3. Specify the type of this database (1.Single Instance Database|2.Oracle Restart Enabled Database) [1]: 1
  4. Specify the diagnostic destination location of the database [c:\Oracle\diag\rdbms\e1local]: <what ever comes in [...]>
  5. Specify the storage type used by the Database ASM|FS []: FS
  6. Specify the list of directories if any database files exist on a shared file system. If 'E1LOCAL' subdirectory is found, then it will be deleted. Otherwise, the specified directory will be deleted. Alternatively, you can specify list of database files with full path [ ]: Just Press Enter
  7. Specify the flash recovery area location, if it is configured on the file system. If "E1LOCAL" subdirectory is found, then it will be deleted. []: Just Press Enter
  8. Specify the database spfile location [ ]: Just Press Enter
  9. Do you want to continue (y - yes, n - no)? [n]: y 
Note that the E1LOCAL is your SSID (System Identifier) - this is what you provided during your installation so it may vary but it should be replaced by that.
Important: If you go through the above prompts, you also need to delete the registry key \HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE\KEY_E1Local if present.

4. When the deinstall finishes, be sure that the c:\Oracle\<SSID> directory no longer exists. If it does, you will need to manually delete it.

For any doubts, please feel free to comment.

12 comments :

  1. i cant do the prompt no.4. i cant find the location of the database(e1local). inside rdbms i can find orcl folder.

    ReplyDelete
  2. E1Local is similar to
    Oracle"E1Local"TNSListener
    OracleService"E1LOCAL"
    The quoted names of your service in the very first step.

    If you service has different names then you need to specify that name and use that name on every step.
    Also you will have that folder on the given location in step 4 unless you have deleted it.
    This is usually when you have modified the name during your Oracle installation.

    ReplyDelete
  3. i am not able to run deinstall.bat even as administrator. The cmd window comes and disappears

    ReplyDelete
  4. you can try it the other way round, first open the command prompt as administrator and the got to the location of deinstall.bat and then try to run it from there, you will get an error message if you are getting some.

    ReplyDelete
  5. I am trying to uninstall oracle 11 g from windows 8.1. But I am unable to see the directory where oracle is installed. It does not show in program files. How to overcome this difficulty

    ReplyDelete
  6. This is simple. Go to run and type services.msc
    In the list of services, search for oracle and then check its properties. There you will get the location of Oracle Installation

    ReplyDelete
  7. First of all thank you Sir. Your tutorial was really helpful.
    please tell me how to delete the registry key ?

    ReplyDelete
    Replies
    1. In Start Menu, type regedit
      Open the program regedit.exe -> Its the registery editor

      follow below path in the registery editor
      \HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ORACLE\KEY_E1Local

      Here look for something like KEY_E1Local
      where E1Local is SSID and can be anything that you have set during oracle installation

      Delete
  8. There are million entries in registry left (if I simply search for Oracle).
    Should they be removed manually?

    ReplyDelete
  9. KEY_E1Local is the name of the folder, you just need to right click on the folder and delete it after completing all the above steps in order to perform a clean uninstall.

    ReplyDelete
  10. I am not able to delete folder that contains oracle,after uninstalling oracle using deinstal

    ReplyDelete
    Replies
    1. Hi,
      Though it will depend on what files are still present and error message you are getting, post a screenshot

      But most probably some of the oracle service is still running that is not allowing you to delete the folder
      Try to reboot the system and then check for below services using services.msc
      OracleE1LocalTNSListener
      OracleServiceE1LOCAL

      if you see any service related to Oracle, just stop it and try to delete the folder.

      Delete