Deinstalling an ORACLE_HOME in 11gR2 DB = MORE WORK!

This is a post about using the deinstall script (it is a perl script on UNIX machines) without some testing on a non-production server. Why? It has the ability remove important database components that may still be needed for that server. Especially if you haven’t implemented database component locations as part of the Oracle Flexible Architecture (OFA) method.

I typically start up the listener in the highest-upper-level $ORACLE_HOME to service all databases for a particular server. Running the ORACLE-provided deinstall on an old decommissioned $ORACLE_HOME removed all listeners in the production $ORACLE_HOME. During the run of the deinstall script there didn’t seem to be any way around this task, I was unable to leave it blank or write in a wrong answer. So I created a bogus listener that was never going to be used for the script to remove. MORE WORK!

Specify all Single Instance listeners that are to be de-configured [LISTENER1,LISTENER2]: none

Invalid listener list [ none]. You can only specify a subset of the configured listeners.

At least one listener from the discovered listener list [LISTENER1, LISTENER2] is missing in the specified listener list [LISTENER1]. 
The Oracle home will be cleaned up, so all the listeners will not be available after deinstall. 
If you want to remove a specific listener, please use Oracle Net Configuration Assistant instead. Do you want to continue? (y|n) [n]:

Basically it requests to remove all LISTENERS (they are automatically discovered during the run) and you have to choose at least one to remove.

At least it didn’t try to remove databases that weren’t in this ORACLE_HOME.

Specify the list of database names that are configured in this Oracle home []:

Apparently there are a lot of problems (ie bugs) with the deinstall scripts so Oracle recommends not to use them. The following note verifies that the deinstall doesn’t behave as it should! So very naughty. It recommends downloading and installing yet another utility to manage things. MORE WORK! The downloaded utility is specific to ORACLE versions (ex. linux.x64_11202_deinstall.zip) and operating systems, so now I have to keep more software on hand to accomplish what used to be a simple task using the ORACLE UNIVERSAL INSTALLER.  While this type of script may be useful for certain test environments that depend on extensive scripting capabilities like the deinstall tool, I am wondering how to use it safely to remove software on a production server?

One workaround would be to create a new oraInventory for each $ORACLE_HOME, then you would have to juggle multiple copies of /etc/oraInst.loc (on UNIX) to do maintenance tasks such as patching and upgrades. This would involve some local documentation on your part to keep it all straight. This would allow you to just manually remove old $ORACLE_HOME (s) along with their associated inventory when they are no longer needed. Particularly because database releases are all now required to have their own $ORACLE_HOME. MORE WORK!

How To Deinstall/Uninstall Oracle Home In 11gR2 [ID 883743.1]

“De-installation from new OUI is desupported.

Caution:
When you run the deinstall command, if the central inventory (oraInventory) contains no
other registered homes besides the home that you are deconfiguring and removing, then the deinstall command removes the following files and directory contents in the Oracle base directory of the Oracle Database installation owner:”

(In other words if this is the last ORACLE_HOME it will also remove the following directories under ORACLE_BASE)….so using a single oraInventory (s)/ORACLE_HOME and the deinstall script at the same time may be counterproductive. MORE WORK!

admin
cfgtoollogs
checkpoints
diag
oradata
flash_recovery_area

1) External de-install utility downloadable from OTN ***Recommended method***

It is advised to use the external De-install utility that is downloadable from OTN as currently there are some open bugs with the deinstall script.”

I downloaded the zip file, checked out the readme. It points you to the documentation on the standard use of deinstall. See the following output for how it was run:

>perl deinstall
Tool is being run outside the Oracle Home, -home needs to be set.
deinstall -home <Complete path of Oracle home>
 [ -silent ]
 [ -checkonly ]
 [ -local ]
 [ -paramfile <complete path of input parameter properties file> ]
 [ -params <name1=value[ name2=value name3=value ...]> ]
 [ -o <complete path of directory for saving files> ]
 [ -tmpdir <complete path of temporary directory to use> ]
 [ -help : Type -help to get more information on each of the above options. 
perl deinstall -home ORACLE_HOME_TO_BE_REMOVED  (simplest form of using this script)
###############CHECK OPERATION SUMMARY #######################
 Oracle Home selected for de-install is: /u01/app/oracle/product/11.2.0/dbhome_1
 Inventory Location where the Oracle home registered is: /u01/app/oraInventory
 Skipping Windows and .NET products configuration check
 Following Single Instance listener(s) will be de-configured: LISTENER1
 No Enterprise Manager configuration to be updated for any database(s)
 No Enterprise Manager ASM targets to update
 No Enterprise Manager listener targets to migrate
 Checking the config status for CCR
 Oracle Home exists with CCR directory, but CCR is not configured
 CCR check is finished
 Do you want to continue (y - yes, n - no)? [n]: y
########### CLEAN OPERATION START ########################
Enterprise Manager Configuration Assistant START
EMCA de-configuration trace file location: /u01/app/oraInventory/logs/emcadc_clean2012-05-08_11-03-05-AM.log
Updating Enterprise Manager ASM targets (if any)
 Updating Enterprise Manager listener targets (if any)
 Enterprise Manager Configuration Assistant END
 Database de-configuration trace file location: /u01/app/oraInventory/logs/databasedc_clean2012-05-08_11-03-51-AM.log
Network Configuration clean config START
Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2012-05-08_11-03-51-AM.log
De-configuring Single Instance listener(s): LISTENER1
De-configuring listener: LISTENER1
 Stopping listener: LISTENER1
 Listener stopped successfully.
 Deleting listener: LISTENER1
 Listener deleted successfully.
 Listener de-configured successfully.
De-configuring backup files...
 Backup files de-configured successfully.
The network configuration has been cleaned up successfully.
Network Configuration clean config END
Oracle Configuration Manager clean START
 OCM clean log file location : /u01/app/oraInventory/logs//ocm_clean_2012-05-08_11-03-05-AM.log
 Oracle Configuration Manager clean END
 Removing Windows and .NET products configuration END
 Oracle Universal Installer clean START
Detach Oracle home '/u01/app/oracle/product/11.2.0/dbhome_1' from the central inventory on the local node : Done
Delete directory '/u01/app/oracle/product/11.2.0/dbhome_1' on the local node : Done
The Oracle Base directory '/u01/app/oracle' will not be removed on local node. The directory is in use by Oracle Home '/u01/app/oracle/agent12c/core/12.1.0.1.0'.
Oracle Universal Installer cleanup was successful.
Oracle Universal Installer clean END
Oracle install clean START
Clean install operation removing temporary directory '/tmp/deinstall2012-05-08_10-58-01AM' on node 'nodename'
Oracle install clean END
############ CLEAN OPERATION END #########################
########## CLEAN OPERATION SUMMARY #######################
 Following Single Instance listener(s) were de-configured successfully: LISTENER1
 Cleaning the config for CCR
 As CCR is not configured, so skipping the cleaning of CCR configuration
 CCR clean is finished
 Skipping Windows and .NET products configuration clean
 Successfully detached Oracle home '/u01/app/oracle/product/11.2.0/dbhome_1' from the central inventory on the local node.
 Successfully deleted directory '/u01/app/oracle/product/11.2.0/dbhome_1' on the local node.
 Oracle Universal Installer cleanup was successful.
Oracle deinstall tool successfully cleaned up temporary directories.
 #######################################################################


Ok…I kinda left this post in nowhere land. What does a person do with the proliferation of ORACLE_HOMEs?   Detach from oraInventory will allow you to safely manually remove the ORACLE_HOME binary files to reclaim space as you need some more to install the next version!  Easy to do, scriptable and reasonably safe task.

Deinstall by Detaching ORACLE_HOME

 

One of the easiest ways to remove an ORACLE_HOME that is no longer needed is to just detach it from the OraInventory. This is less disruptive and faster than running the Oracle-provided deinstall tool – some personal experiences/observations related to using this utility are mentioned after the code in this section. See the following MOS Document:  How To De-install Oracle Home Using runInstaller [ID 1070610.1]

 

./runInstaller -silent -detachHome -invPtrLoc /etc/oraInst.loc ORACLE_HOME=”/u01/app/oracle/product/11.2.0/dbhome_2″

 

oracle@nodename:/u01/app/oracle/product/11.2.0/dbhome_3/oui/bin[SID]

> u01/app/oracle/product/11.2.0/dbhome_3″                                    <

Starting Oracle Universal Installer…

 

Checking swap space: must be greater than 500 MB.   Actual 35913 MB    Passed

The inventory pointer is located at /etc/oraInst.loc

The inventory is located at /u01/app/oraInventory

‘DetachHome’ was successful.

oracle@nodename:/u01/app/oracle/product/11.2.0/dbhome_3/oui/bin[SID]

 

 

The following example is removing a client install:

./runInstaller -silent -debug -force \

 

FROM_LOCATION=/u03/jobsuser/patches/client/stage/products.xml \

 

UNIX_GROUP_NAME=jobsuser \

 

ORACLE_HOME=/u03/jobsuser/product/11.2/client_2 \

 

ORACLE_HOME_NAME=”OraClient11g_Home2″ \

 

ORACLE_BASE=/u03/jobsuser \

 

oracle.install.client.installType=”Administrator”

 

For more information see the MOS Document: Master Note For Cloning Oracle Database Server ORACLE_HOME’s Using the Oracle Universal Installer (OUI) [ID 1154613.1] Another document outlining the changes for Online Patching: RDBMS Online Patching Aka Hot Patching [ID 761111.1]

 

Advertisements

About April C Sims

Oracle DBA for over a decade...enough said.
This entry was posted in Uncategorized. Bookmark the permalink.

6 Responses to Deinstalling an ORACLE_HOME in 11gR2 DB = MORE WORK!

  1. Rene says:

    Hi April

    Even though Oracle recommends to use the deinstall utility, what I have learned is the following:
    *If you are going to deinstall an ORACLE_HOME, you no longer need the $OH/network/admin/listener.ora.
    *So If you remove the listener.ora or rename it, the deinstall utility will no longer look for a listener, it actually will think that there are no listeners.
    *Also, you need to remove any entries that are present in the oratab that mention the ORACLE_HOME that you are removing.

    Once you do those 2 things, the deinstall will work as you need it to.

    • April C Sims says:

      Sorry, but my experience has shown that it still looks for listener.ora entries in a different ORACLE_HOME, I am assuming this is due to the use of the TNS_ADMIN variable. Yes, oratab entries have already been removed before attempting to do the deinstall.

  2. Ilene Kaplan says:

    Where would I find oratab entries, some file somewhere?

    • April C Sims says:

      On Unix it is usually located in /etc file location as in /etc/oratab
      On Windows there is no oratab but entries in the Windows registry.
      This article was meant for Deinstalling on UNIX, there is a different procedure on a Windows server.

      • Ilene Kaplan says:

        Thanks April. Since I am currently working on a PC, I guess I won’t be finding that file! Ilene

  3. Pawan says:

    hi
    I manually delete 11g oracle home instead of uninstalling on AIX. Now I m am going to install again but i am getting error like INS[10008] session initialization failed . could anyone help me how can i go ahead

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s