Monday, March 28, 2011

How to Manually Remove Oracle Server Software on Microsoft Windows Platforms

How to Manually Remove Oracle Server Software on Microsoft Windows Platforms
============================================================================


applies to:-
Oracle Universal Installer - Version: 11.2.0.1 to 11.2.0.2
windows 32/64 bits


========================
Solution
========================

A. Single Instance or Client Environment
=========================================

1. Ensure you are logged in as a user with Local Administrative privileges.

2. Stop all Oracle services related to the ORACLE_HOME (if any are running):

* Right click (My) Computer > Manage > Services and Applications OR Configuration > Services.
* Check the Path to Executable field in the Service's Properties if you are unsure from which ORACLE_HOME the service is running.
* Close the Services and/or Computer Management window.

3. Remove any databases using the Database Configuration Assistant (DBCA) running out of the ORACLE_HOME you are removing. Remove any listeners using Net Configuration Assistant (NetCA) running out of the ORACLE_HOME you are removing.

4. Remove the ORACLE_HOME from the OUI inventory:

* %ORACLE_HOME%\OUI\BIN\setup -detachHome ORACLE_HOME=%ORACLE_HOME%

5. Remove entries in the registry:

* Start the registry editor: choose Start > Run > regedit.
* Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_ and delete that entry.
* Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC. Expand all subkeys and remove the key: "Oracle in ".
* Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. Delete any keys with names beginning with Oracle and/or have an ImagePath string pointing to the ORACLE_HOME to be deleted or a location under it.
* Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ocfs (if present) and delete that entry.
* Close regedit.

6. Clean up the environment settings:

* Right click on (My) Computer > Properties > Advanced tab OR Advanced System Settings link > Environment Variables button.
* Under System Variables section, review all variables for any reference to the deleted ORACLE_HOME. Edit by removing the ORACLE_HOME from the string value (such as removing the home from PATH statement) or by deleting the entire variable. Common examples are CLASSPATH, ORACLE_HOME, PATH, and PERL5LIB.
* Click OK to save and exit System Properties.

7. Clean up the start menu icons:

* Right click on the Start button and choose Explore All Users.
* Expand Programs folder.
* Delete the folder Oracle - and any subfolder.

8. If this is the only ORACLE_HOME on the server, delete the Oracle folder under C:\Program Files. DO NOT delete this if there are any other Oracle products on this server.

9. Reboot the Windows server.

10. Go to the TEMP/TMP directory and delete all files and directories.

11. Go to the ORACLE_HOME location and verify all folders/files have been removed.

12. Empty the Recycle Bin to clear all files.


Please note that you should reboot the server to ensure proper cleanup of any disabled Oracle services and/or any removed items still resident in memory.






==========================
B. Clustered Environment
==========================


1. Ensure you are logged in as a user with Local Administrative privileges.

2. Stop the databases and cluster resources:

* Run on any node: “srvctl stop database -d
* Run on any node: “crsctl stop cluster -all”
* Run on all nodes: “crsctl stop crs”

3. Stop all Oracle services related to the ORACLE_HOME (if any are running):

* Right click (My) Computer > Manage > Services and Applications OR Configuration > Services.
* Check the Path to Executable field in the Service's Properties if you are unsure from which ORACLE_HOME the service is running.
* Close the Services and/or Computer Management window.

4. On one node remove any databases using the Database Configuration Assistant (DBCA) running out of the ORACLE_HOME you are removing. Remove any listeners using Net Configuration Assistant (NetCA) running out of the ORACLE_HOME you are removing.

5. Due to Bug 9602707 DEINSTALL OF GI DOES NOT RUN ROOTCRS.PL -DECONFIG IF INSTALL WAS ONLY PARTIAL (fixed in 11.2.0.2), you will have to remove the GRID configuration by running the following steps in a command prompt window:

* Run "set path=%path%;\perl\bin" to set the environment on all nodes.
* For example: set path=%path%;C:\app\11.2\grid\perl\bin
* Run "perl \crs\install\rootcrs.pl -verbose -deconfig -force" on all nodes except the last one.
* Run "perl \crs\install\rootcrs.pl -verbose -deconfig -force -lastnode" on the last node. This command will zero out OCR and Voting disk.

6. Remove the ORACLE_HOME from the OUI inventory:

* %ORACLE_HOME%\OUI\BIN\setup -detachHome ORACLE_HOME=%ORACLE_HOME%

7. Remove entries in the registry:

* Start the registry editor: choose Start > Run > regedit.
* Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_ and delete that entry.
* Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC. Expand all subkeys and remove the key: "Oracle in ".
* Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. Delete all keys where the name starts with Oracle or Ora or has an ImagePath string entry to the ORACLE_HOME to be deleted or a location under it.
* Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ocfs and delete that entry.
* Close regedit.

8. Clean up the environment settings:

* Right click on (My) Computer > Properties > Advanced tab OR Advanced System Settings link > Environment Variables button.
* Under System Variables section, review all variables for any reference to the deleted ORACLE_HOME. Edit by removing the ORACLE_HOME from the string value (such as removing the home from PATH statement) or by deleting the entire variable. Common examples are CLASSPATH, ORACLE_HOME, PATH, and PERL5LIB.
* Click OK to save and exit System Properties.

9. Clean up the start menu icons:

* Right click on the Start button and choose Explore All Users.
* Expand Programs folder.
* Delete the folder Oracle - and any subfolder.

10. If this is the only ORACLE_HOME on the server, delete the Oracle folder under C:\Program Files. DO NOT delete this if there are any other Oracle products on this server.

11. Reboot the nodes.

12. Go to the TEMP/TMP directory and delete all files and directories.

13. Go to the ORACLE_HOME locations and verify all folders/files have been removed.

14. Delete the clusterware drivers in the Windows drivers folder, usually C:\WINDOWS\System32\Drivers:

* ocfs.sys
* oracleacfs.sys
* oracleadvm.sys
* oracleoks.sys
* orafencedrv.sys
* orafenceservice.sys

15. Empty the Recycle Bin on all nodes.

16. You must reinitialize all shared disks to allow for a clean environment for reinstall from one of the nodes in the cluster. Please follow all steps in Document 341214.1 How To clean up after a Failed (or Successful) Oracle Clusterware Installation on Windows, including using logpartformat to reinitialize all shared disks.


NOTE: Unless otherwise noted, the following steps must be performed on all nodes in the cluster.

Please note that you should reboot all the nodes to ensure proper cleanup of any disabled Oracle services and/or any removed items still resident in memory.

1 comment:

Oracle DBA said...

Manually uninstalling Oracle from LINUX & WINDOWS : http://chandu208.blogspot.com/2011/09/manually-uninstalling-oracle.html