WIN:Remove a Single ORACLE_HOME and Its Traces on Microsoft Windows Pla_208256.1

rongshiyuan發表於2014-05-07

WIN: How to Remove a Single ORACLE_HOME and Its Traces on Microsoft Windows Platforms (Doc ID 208256.1





PURPOSE ------- This article describes the procedure how to manually perform the actions to remove all traces of an ORACLE_HOME on Microsoft Windows 95/98/NT/2000/XP/7/2003/2008 and how to manually remove Oracle components (e.g.: Oracle Server (RDBMS), iAS, OEM, client installations, etc.) and services from your computer for a specific ORACLE_HOME with the traces of the ORACLE_HOME itself. SCOPE & APPLICATION ------------------- This article is intended for DBA's on the Microsoft Windows (95/95/NT/2000/XP/7//2003/2008) platform. This article only applies to Oracle products that are installed using Oracle Installer (ORAINST.EXE) or Oracle Universal Installer (OUI). For example the following products are not installed using Oracle installers: JDeveloper JInitiator 9iFS File Sync so they are out of the scope of this article. This article applies to multiple ORACLE_HOME installations. WARNING: 1. These procedures will also remove Oracle network configuration files, in a specific ORACLE_HOME. 2. If there are user written scripts and any other user generated files in the ORACLE_HOME they will be deleted. 3. Exercise extreme care when removing registry entries. Removing incorrect entries can severely compromise your computer. How to Remove a Single ORACLE_HOME and Its Traces on Microsoft Windows Platforms -------------------------------------------------------------------------------- A. Removing Traces of a Single ORACLE_HOME on Windows NT/2000/XP/7/2003/2008 -------------------------------------------------------------- To remove traces of an ORACLE_HOME from a computer running Windows NT/2000/XP/7/2003/2008: 1. Check privileges: ----------------- 1.a. Ensure you are logged in as a user with Administrator privileges on the console. With some OS's you may need to right click and "Run as Administrator" 2. Stop all Oracle services related to the ORACLE_HOME (if any are running): ------------------------------------------------------------------------- 2.a. NT: Choose Start > Settings > Control Panel > Services. 2000/XP: Right click My Computer > Manage > Services and Applications > Services Windows 7: Chooose Start > Control Panel > System and Security > Administrative Tools > Services 2.b. If any Oracle services (their names begin with Oracle) exist running on the ORACLE_HOME and have the status Started, select the service and stop it. To determine which services to stop, on Windows 2000, 7 and XP, check "Path to Executable" to see the directory where the executable for the service is located. If you are running Windows NT, you can check the "Path to Executable" in the registry. The key HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/ has a string value "ImagePath" containing the path. 2.c. Click Close to exit the Services window. 2.d. Close the Control Panel/Computer Management window. 3. Deinstall Products in the ORACLE_HOME ------------------------------------- The actions in this section are required since the other actions in this bulletin does not clean the Oracle inventory (for Oracle Universal Installer) from the traces of ORACLE_HOME to be deleted. 3.a. If the products in the ORACLE_HOME to be deleted are installed using the Oracle Universal Installer: - Start the Oracle Universal Installer (if it is not installed on your machine you can use the CD-ROM that you have used to install the products) - Click "Deinstall Products" - In the new dialog, expand the ORACLE_HOME to be deleted. - Check the product(s) - Click Remove Note: After completing the deinstallation of all products in an ORACLE_HOME, you will not see it in the Installed Products window. But keep in mind that the ORACLE_HOME is registered to the inventory and cannot be deregistered. Actually this does not have any harmful effect. The only effect is that you will see the ORACLE_HOME when you are performing a new installation using OUI, at the File Locations screen, the Destination selections and you cannot change the Name of an existing ORACLE_HOME. With Oracle 11 a new DOS Based Deinstall tool is provided and should be used to remove Oracle.installations. 3.b. If the products in the ORACLE_HOME to be deleted are installed using the Oracle Installer. (Developer 6i or before, 806_HOME of iAS, Discoverer, RDBMS Server 8.0 or earlier, etc.) - Start Oracle Installer (ORAINST.EXE) installed in the ORACLE_HOME to be deleted. (If you run the Installer from a product CD-ROM, be sure to select the ORACLE_HOME to be removed) - Select all items on the right-handside except the Oracle Installer. - Click Remove If there are database instances created using the products in the ORACLE_HOME to be deleted, delete all controlfiles, redo log files and datafiles belonging to the instances. If the version of the database is 8i or up, then you can use the Database Configuration Assistant to delete the instance. If there is a Listener created using the products in the ORACLE_HOME to be deleted, Use Network Configuration Assistance and delete the listener. 4. Remove the entries in the Windows registry: ------------------------------------------- 4.a. Start the registry editor: Choose Start > Run > regedit Note: On Windows NT you can use regedt32 instead. The searching capabilities of regedt32 is limited compared to regedit. It will be needed to be able to edit 32-bit entries in the registry. Since we are not going to update any 32-bit entry it is not needed. 4.b. Clean the ORACLE registry from traces of ORACLE_HOME to be deleted: (NOTE: For Oracle10g or Oracle11g, the registry entries are different than the older versions. To clean up the registry for Oracle10g or Oracle11g, you can delete the HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_. For example, if your Oracle_Home is called DB10g, then you would delete the key named: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_DB10g. Then you can continue with Step 4c.) For Oracle9i and older: Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES key - There are keys named ID1,ID2,... where the number stands for the ORACLE_HOME number. Find the key with PATH value matching your ORACLE_HOME directory and delete the ID key itself. Record the ORACLE_HOME number to use them in the following steps. - There is a String value named HOME_COUNTER. Decrease the value by 1. - There is a String value named LAST_HOME. If the value is the ID you are deleting, decrease the value by 1. - If the DEFAULT_HOME value is the one you are deleting, change the value to another existing home name. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE key - Delete the HOME key with the ORACLE_HOME number. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORACLE_HOMES key - Delete the ORACLE key with the ORACLE_HOME number if it exists. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE key again. - There are many String entries under this key. Some of them contain directories or files in full path. Delete those String entries which refers to the ORACLE_HOME to be deleted itself or a location under it Some values imply a specific product directly. (e.g. Oracle Developer 6.0 etc.) If you find something related to the product in the ORACLE_HOME you are trying to remove, delete the corresponding String entry. Under the same key, there can be some other keys that includes the path to the ORACLE_HOME you are trying to remove or some location under it (e.g. OO4O, EXPERT..., AUTOTUNE..., iSuites, iSQLPlus etc.). Delete those keys also. 4.c. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and expand all subkeys and remove the key: "Oracle in " If Oracle Lite is installed - "Oracle Lite ..." Check "Oracle ODBC Driver" key contents whether it refers to te ORACLE_HOME to be deleted. If it does, delete the key. 4.d. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services - Delete the keys that the name starts with Oracle and has a reference with the ImagePath string entry to the ORACLE_HOME to be deleted or a location under it. 4.e. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\... ...\Application - Delete the keys that the name starts with Oracle and has a reference with the EventMessageFile string entry to the ORACLE_HOME to be deleted or a location under it. 4.f. Go to HKEY_CLASSES_ROOT and search deep into the keys starting with Ora or ORCL (e.g. Oracle..., ORADC..., ORAMMC..., OraOLE..., OraPerf... and ORCL...). Delete those keys which include string values with the specific ORACLE_HOME that is to be deleted. 4.g Search for the ORACLE_HOME in the whole registry and delete the keys that has the reference. Note: Only regedit.exe has facility to search String names and values. The regedt32 can only search for Keys. 4.h. Close the registry editor. 5. Clean up the environment settings: ---------------------------------- 5.a. NT: Choose Start > Settings > Control Panel > System > Environment tab 2000,XP: Choose Start > Settings > Control Panel > System > Advanced tab > Environment variables. Win 7: Choose Start > Control Panel > System and Security > System > Advanced system settings then click on the Advanced Tab and Environment variables button. 5.b. At "System Variables" click on the variable PATH in order to modify the value. For example, you may see a path similar to this one: C:\ORACLE\ORA81\BIN;C:\PROGRAM FILES\ORACLE\JRE\1.1.7\BIN If you are deleting the ORACLE_HOME C:\ORACLE\ORA81, remove the C:\ORACLE\ORA81\BIN expression from the PATH variable. Delete any path expression in the PATH variable that contains the ORACLE_HOME to be removed or some location underneath. 5.c. If there is a CLASSPATH variable under "System Variables", delete the path expressions in the variable that contains the ORACLE_HOME to be removed or some location underneath. 5.d. Check if there are any other Oracle variables set in "System Variables", Delete those variables that contain the ORACLE_HOME that you are trying to remove. Examples: ORACLE_HOME, ORACLE_SID, TNS_ADMIN, JSERV, WV_GATEWAY_CFG, Perl5Lib 5.e. Click on APPLY and OK. 5.f. Close the Control Panel window. 6. Delete the software and start menu icons: ----------------------------------------- 6.a. NT: Choose Start > Programs > Windows NT Explorer. 2000,XP: Choose Start > Programs > Accessories > Windows Explorer. Win 7: Choose Start > Computer 6.b. NT: Go to %SystemDrive%\WINNT\PROFILES\ALL USERS\START MENU\PROGRAMS 2000,XP: Go to %SystemDrive%\DOCUMENTS AND SETTINGS\ALL USERS\START MENU\ ...\PROGRAM: Win 7 From the start > Oracle_home menu right click and delete the object(s) from the menu. Note: These locations depend on whether OS was upgraded from NT, or this was a fresh install of 2000/XP. and delete the following folders: - Oracle - where is the one that you are trying to remove Examples: Oracle for Windows NT - Dev6i Oracle Reports 6i - Dev6i Oracle Reports 6i Admin - Dev6i Oracle Forms & Reports 6i - Dev6i Oracle Olap Client 2.2 - Dev6i Oracle Forms & Reports 6i Doc - Dev6i Oracle9i Lite Oracle - OraHome92 Note: To locate your System Drive, type in Command Prompt: echo %SystemDrive% 6.c. Go to the temp directory and delete all files and directories in here NT: %SystemDrive%\Temp 2000, XP: %SystemDrive%\Documents and Settings\\Local Settings\Temp\ Note: In order to successfully delete all files, you may have to reboot your computer first, in order to clear Operating System locks on those files. 6.d. Go to the drive where the ORACLE_HOME is to be deleted. Delete the ORACLE_HOME directory. If you are deleting a database or any product including database (e.g. Oracle iAS) go to ORACLE_BASE/admin and delete the folder named as the SID of the database. Note: In order to successfully delete all files, you may have to reboot your computer first, in order to clear Operating System locks on those files. 6.e. Close the Windows Explorer / Windows NT Explorer. 7. Finish the removal: ------------------- 7.a. Empty the recycle bin Right click on recycle bin > Empty Recycle Bin. 7.b. Reboot your computer. 7.c. Optionally (for XP and 2000): run the System Defragmenter utility: It is safe run Windows Disk Defragmenter. However to avoid any negative impact to the database and application, the good practice of first shutdown the instance, and then stopping all running processes from the OracleHome is recommended. Fragmentation of the Oracle database datafiles is based on controlled by the autoextend option and next extent size. Also note that if many files are created and deleted on the volume in question, that can contribute to fragmentation. Generally it is a site specific administrative concern. An option to consider is add a defrag step to your checklist when performing scheduled maintenance that includes downtime, such as applying an Oracle RDBMS patchset. To run the System Defragmenter Utility: - from Control Panel, select Administrative Tools > Computer Management - expand Storage, then select Disk Defragmenter - highlight each virtual drive, in turn, and click Defragment - reboot your computer when finished. Note: This facility is not available on Windows NT. B. Removing Traces of a Single ORACLE_HOME on Windows 95 or Windows 98 ---------------------------------------------------------------------- To remove a specific ORACLE_HOME from a computer on Windows 95/Windows 98: 1. Deinstall Products in the ORACLE_HOME ------------------------------------- The actions in this section are required since the other actions in this bulletin does not clean the Oracle inventory (for Oracle Universal Installer) from the traces of ORACLE_HOME to be deleted. 1.a. If the products in the ORACLE_HOME to be deleted are installed using the Oracle Universal Installer: - Start the Oracle Universal Installer (if it is not installed on your machine you can use the CD-ROM that you have used to install the products) - Click "Deinstall Products" - In the new dialog, expand the ORACLE_HOME to be deleted. - Check the product(s) - Click Remove Note: After completing the deinstallation of all products in an ORACLE_HOME, you will not see it in the Installed Products window. But keep in mind that the ORACLE_HOME is registered to the inventory and cannot be deregistered. Actually this does not have any harmful effect. The only effect is that you will see the ORACLE_HOME when you are performing a new installation using OUI, at the File Locations screen, the Destination selections and you cannot change the Name of an existing ORACLE_HOME. 1.b. If the products in the ORACLE_HOME to be deleted are installed using the Oracle Installer. (Developer 6i or before, Discoverer, RDBMS Client 8.0 or earlier, etc.) - Start Oracle Installer (ORAINST.EXE) installed in the ORACLE_HOME to be deleted. (If you run the Installer from a product CD-ROM, be sure to select the ORACLE_HOME to be removed) - Select all items on the right-handside except the Oracle Installer. - Click Remove If there are database instances created using the products in the ORACLE_HOME to be deleted, delete all controlfiles, redo log files and datafiles belonging to the instances. If the version of the database is 8i or up, then you can use the Database Configuration Assistant to delete the instance. 2. Remove the entries in the Windows registry: ------------------------------------------- 2.a. Start the registry editor at the MS-DOS command prompt: C:\> REGEDIT 2.b. Clean the ORACLE registry from traces of ORACLE_HOME to be deleted: Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES key - There are keys named ID1,ID2,... where the number stands for the ORACLE_HOME number. Find the key with PATH value matching your ORACLE_HOME directory and delete the ID key itself. Record the ORACLE_HOME number to use them in the following steps. - There is a String value named HOME_COUNTER. Decrease the value by 1. - There is a String value named LAST_HOME. If the value is the ID you are deleting, decrease the value by 1. - If the DEFAULT_HOME value is the one you are deleting, change the value to another existing home name. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE key - Delete the HOME key with the ORACLE_HOME number. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ORACLE_HOMES key - Delete the ORACLE key with the ORACLE_HOME number if it exists. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE key again. - There are many String entries under this key. Some of them contain directories or files in full path. Delete those String entries which refers to the ORACLE_HOME to be deleted itself or a location under it Some values imply a specific product directly. (e.g. Oracle Developer 6.0 etc.) If you find something related to the product in the ORACLE_HOME you are trying to remove, delete the corresponding String entry. Under the same key, there can be some other keys that includes the path to the ORACLE_HOME you are trying to remove or some location under it (e.g. OO4O etc.). Delete those keys also. 2.c. Go to HKEY_LOCAL_MACHINE\SOFTWARE\ODBC and expand all subkeys and remove the key: "Oracle in " If Oracle Lite is installed - "Oracle Lite ..." Check "Oracle ODBC Driver" key contents whether it refers to te ORACLE_HOME to be deleted. If it does, delete the key. 2.d. Go to HKEY_CLASSES_ROOT and search deep into the keys starting with Ora or ORCL (e.g. Oracle..., ORADC..., ORAMMC..., OraOLE..., OraPerf... and ORCL...). Delete those keys which include string values with the specific ORACLE_HOME that is to be deleted. 2.e. Search for the ORACLE_HOME in the whole registry and delete the keys that has the reference. 2.f. Close the registry editor. 3. Clean up the environment settings: ---------------------------------- 3.a. Open your AUTOEXEC.BAT with an editor to modify the PATH variable. For example, you may see a path similar to this one: C:\ORACLE\ORA81\BIN;C:\PROGRAM FILES\ORACLE\JRE\1.1.7\BIN If you are deleting the ORACLE_HOME C:\ORACLE\ORA81, remove the C:\ORACLE\ORA81\BIN expression from the PATH variable. Delete any path expression in the PATH variable that contains the ORACLE_HOME to be removed or some location underneath. 3.b. If there CLASSPATH variable is set, delete the path expressions in the variable that contains the ORACLE_HOME to be removed or some location underneath. 3.c Check if there are any other Oracle variables set, ORACLE_HOME, ORACLE_SID or TNS_ADMIN. Delete those variables that contain the ORACLE_HOME that you are trying to remove. 3.d. Save the AUTOEXEC.BAT file and close the edit. 4. Delete the software and start menu icons: ----------------------------------------- 4.a. Choose Start > Programs > Windows Explorer 4.b. Go to SYSTEM_DRIVE:\WINDOWS\START MENU\PROGRAMS and delete the following folders: - Oracle - where is the one that you are trying to remove Examples: Oracle for Windows 95 - Dev6i Oracle Reports 6i - Dev6i Oracle Reports 6i Admin - Dev6i Oracle Forms & Reports 6i - Dev6i Oracle Forms & Reports 6i Doc - Dev6i Oracle - OraHome92 4.c. Go to SYSTEM_DRIVE:\Temp and delete all files and directories in here. 4.d. Go to the drive where the ORACLE_HOME is to be deleted. Delete the ORACLE_HOME directory. If you are deleting a Oracle Personal Edition installation go to ORACLE_BASE/admin and delete the folder named as the SID of the database. 4.e. Remove any .INI files that may exist in the Windows directory that are directly related to the products that are being deleted. The Windows directory may be found by entering "echo %WINDIR%" from a command prompt. Typical Oracle .INI files include ORADIM73.INI, ORADIM80.INI, ORACLE.INI, ORAODBC.INI 4.f. Close the Windows Explorer. 5. Finish the removal: ------------------- 5.a. Empty the recycle bin Right click on recycle bin > Empty Recycle Bin 5.b. Reboot your computer. RELATED DOCUMENTS ----------------- Oracle Installation Guides for Windows. Note 124353.1 WIN: Manually Removing all Oracle Components on Microsoft Windows Platforms Note 73963.1 WIN: Using multiple ORACLE HOMES on Windows platform SEARCH WORDS ------------ WIN95, WIN98, WINNT, WIN2000, Windows95, Windows98, WindowsNT, Windows2000, WindowsXP, de-install, deinstall, re-install, reinstall

References

NOTE:124353.1 - WIN: Manually Removing all Oracle Components on Microsoft Windows Platforms
NOTE:73963.1 - WIN: Using multiple ORACLE HOMES on Windows platform




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1155893/,如需轉載,請註明出處,否則將追究法律責任。

相關文章