This discussion is archived
5 Replies Latest reply: Feb 7, 2013 9:58 AM by EdStevens RSS

Remove old OHOME after upgrade

EdStevens Guru
Currently Being Moderated
Oracle GI 11.2.0.1/11.2.0.3 - standalone ASM, no RAC
Oracle db 11.2.0.1
Oracle Linux 5.6 x86-64

This last weekend I upgraded my GI from 11.2.0.1 to 11.2.0.2.0
Old home was /u01/app/oracle/product/11.2.0/grid
New home is /u01/app/oracle/product/11.2.0.2/grid
database home is /u01/app/oracle/product/11.2.0/db_1

Now I would like to clean up by deleting the old GI home, and am testing on a sandbox under VBox. Same system as I used to test the upgrade procedure, and it looks as close to the live box as I can get it.

Of course, with 11g, the OUI doesn't do installs any more, and the supplied deinstall file also has issues.

Found MOS note 883743.1, downloaded linux.x64_11203_deinstall.zip and unzipped it, then ran that deinstall.

The deinstall failed, and the really surprising thing is it complained that a whole bunch of files in the old home are still in use ..
oracle:vbdwprd$ 
oracle:vbdwprd$ ./deinstall -home /u01/app/oracle/product/11.2.0/grid
Location of logs /u01/app/oraInventory/logs/

############ ORACLE DEINSTALL & DECONFIG TOOL START ############


######################### CHECK OPERATION START #########################
## [START] Install check configuration ##


Checking for existence of the Oracle home location /u01/app/oracle/product/11.2.0/grid
Oracle Home type selected for deinstall is: Oracle Grid Infrastructure for a Standalone Server
Oracle Base selected for deinstall is: /u01/app/oracle
Checking for existence of central inventory location /u01/app/oraInventory
Checking for existence of the Oracle Grid Infrastructure home /u01/app/oracle/product/11.2.0.2/grid
Checking for sufficient temp space availability on node(s) : 'vbdwprod.vbdomain'

## [END] Install check configuration ##

Traces log file: /u01/app/oraInventory/logs//crsdc.log

Network Configuration check config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_check2013-02-05_11-25-55-AM.log

Network Configuration check config END

Asm Check Configuration START

ASM de-configuration trace file location: /u01/app/oraInventory/logs/asmcadc_check2013-02-05_11-25-57-AM.log

ASM was not detected in the Oracle Home

######################### CHECK OPERATION END #########################


####################### CHECK OPERATION SUMMARY #######################
Oracle Grid Infrastructure Home is: /u01/app/oracle/product/11.2.0.2/grid
The cluster node(s) on which the Oracle home deinstallation will be performed are:null
Oracle Home selected for deinstall is: /u01/app/oracle/product/11.2.0/grid
Inventory Location where the Oracle home registered is: /u01/app/oraInventory
The home being deconfigured is NOT a configured Grid Infrastructure home (/u01/app/oracle/product/11.2.0.2/grid)
ASM was not detected in the Oracle Home
Do you want to continue (y - yes, n - no)? [n]: y
A log of this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2013-02-05_11-25-47-AM.out'
Any error messages from this session will be written to: '/u01/app/oraInventory/logs/deinstall_deconfig2013-02-05_11-25-47-AM.err'

######################## CLEAN OPERATION START ########################
ASM de-configuration trace file location: /u01/app/oraInventory/logs/asmcadc_clean2013-02-05_11-26-02-AM.log
ASM Clean Configuration END

Network Configuration clean config START

Network de-configuration trace file location: /u01/app/oraInventory/logs/netdc_clean2013-02-05_11-26-02-AM.log

De-configuring Listener configuration file...
Listener configuration file de-configured successfully.

De-configuring Naming Methods configuration file...
Naming Methods configuration file de-configured successfully.

De-configuring Local Net Service Names configuration file...
Local Net Service Names configuration file 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

Setting the force flag to false
Setting the force flag to cleanup the Oracle Base
Oracle Universal Installer clean START

Detach Oracle home '/u01/app/oracle/product/11.2.0/grid' from the central inventory on the local node : Done

Failed to delete the directory '/u01/app/oracle/product/11.2.0/grid/auth/crs/vbdwprod'. The directory is in use.
Failed to delete the directory '/u01/app/oracle/product/11.2.0/grid/auth/crs'. The directory is not empty.
and so on .. to end with
Failed to delete the directory '/u01/app/oracle/product/11.2.0/grid/ctss'. The directory is not empty.
Failed to delete the directory '/u01/app/oracle/product/11.2.0/grid'. The directory is not empty.
Delete directory '/u01/app/oracle/product/11.2.0/grid' on the local node : Failed <<<<

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/product/11.2.0/dwprd'.

Oracle Universal Installer cleanup was successful.

Oracle Universal Installer clean END


## [START] Oracle install clean ##

Clean install operation removing temporary directory '/tmp/deinstall2013-02-05_11-25-45AM' on node 'vbdwprod'

## [END] Oracle install clean ##


######################### CLEAN OPERATION END #########################


####################### CLEAN OPERATION SUMMARY #######################
The home being deconfigured is NOT a configured Grid Infrastructure home (/u01/app/oracle/product/11.2.0.2/grid)
Successfully detached Oracle home '/u01/app/oracle/product/11.2.0/grid' from the central inventory on the local node.
Failed to delete directory '/u01/app/oracle/product/11.2.0/grid' on the local node.
Oracle Universal Installer cleanup was successful.

Oracle deinstall tool successfully cleaned up temporary directories.
#######################################################################


############# ORACLE DEINSTALL & DECONFIG TOOL END #############
So where do I go from here?
  • 1. Re: Remove old OHOME after upgrade
    P.Forstmann Guru
    Currently Being Moderated
    Did you check with fuser or lsof if directory /u01/app/oracle/product/11.2.0/grid/auth/crs/vbdwprod or some files in this directory are in use ?
  • 2. Re: Remove old OHOME after upgrade
    Sebastian Solbach (DBA Community) Guru
    Currently Being Moderated
    Hi,

    This is a known issue (listed in Readme)

    http://docs.oracle.com/cd/E11882_01/readmes.112/e22488/toc.htm#CHDDJCFH

    You can either use the workaround stated there.
    However checking for notes in MOS you find:

    How to Deinstall Old Clusterware Home Once Upgrade to Newer Version is Complete (Doc ID 1346305.1)
    How to Proceed from Failed Upgrade to 11gR2 Grid Infrastructure on Linux/Unix (Doc ID 969254.1)

    So you don't deinstall the old home, but you "simply" delete it.

    Please make sure you moved all files... I had custom failover scripts build, which I had placed under $GI_HOME/crs/public.
    These are not copied during the upgrade, so after I deleted the old home, I had to recreate the scripts and to reregister the resources...

    Regards
    Sebastian

    Regards
    Sebastian
  • 3. Re: Remove old OHOME after upgrade
    EdStevens Guru
    Currently Being Moderated
    P. Forstmann wrote:
    Did you check with fuser or lsof if directory /u01/app/oracle/product/11.2.0/grid/auth/crs/vbdwprod or some files in this directory are in use ?
    I'll get back to you on that after I've checked out Sebastian's leads.
  • 4. Re: Remove old OHOME after upgrade
    EdStevens Guru
    Currently Being Moderated
    Sebastian Solbach (DBA Community) wrote:
    Hi,

    This is a known issue (listed in Readme)

    http://docs.oracle.com/cd/E11882_01/readmes.112/e22488/toc.htm#CHDDJCFH
    Where did you find that particular document?

    I just now double checked the 'readme' docs that came with the 11.2.0.2 media I had downloaded and was working with. The download comprised of 3 (of 7) zip files. The first 2 for the database, and #3 for GI. Of course the 2 db files unzip to a common 'database' directory, and the GI unzips to its own 'grid' directory. Each unzipped directory has its own readme, and neither matches the part number of what you cited. (readme from Database is p/n E15732-03; from Grid is p/n E15732-03). Nor could I find anything about that issue in either of the readmes I have.
    You can either use the workaround stated there.
    However checking for notes in MOS you find:

    How to Deinstall Old Clusterware Home Once Upgrade to Newer Version is Complete (Doc ID 1346305.1)
    How to Proceed from Failed Upgrade to 11gR2 Grid Infrastructure on Linux/Unix (Doc ID 969254.1)

    So you don't deinstall the old home, but you "simply" delete it.
    Ok. Just as I used a vm to practice the upgrade, I've been using it to practice the cleanup. After reviewing my work some more, I see that it reported a 'detach' on the inventory. So I double checked the inventory.xml and see that it now lists the old 11.2.0 home as "removed". Also see this note in the MOS doc I was working from (note 883743.1), stating " Check if Oracle Home folder is deleted or not. If not then you have to remove it manually."

    Still leaves me wondering why the desinstaller reported that it couldn't delete files/directories. Here's a sampling of the messages. Note the variety
    Failed to delete the directory '/u01/app/oracle/product/11.2.0/grid/auth/crs/vbdwprod'. The directory is in use.
    Failed to delete the directory '/u01/app/oracle/product/11.2.0/grid/auth/crs'. The directory is not empty.
    .
    .
    Failed to delete the file '/u01/app/oracle/product/11.2.0/grid/crs/init/ohasd'. The file is in use.
    .
    .
    .
    Failed to delete the file '/u01/app/oracle/product/11.2.0/grid/crs/template/appvip.type'. The file is in use.
    Note especially that last one .. a file in the 'samples' directory is in use?!?!?! there were a total of 18 files in this samples directory that were reported "in use". And yet when I ran that list against fuser and lsof, they both returned nothing.

    At least I now have a working solution.

    Thanks to you and Pierre for your assistance.





    Please make sure you moved all files... I had custom failover scripts build, which I had placed under $GI_HOME/crs/public.
    These are not copied during the upgrade, so after I deleted the old home, I had to recreate the scripts and to reregister the resources...

    Regards
    Sebastian

    Regards
    Sebastian
  • 5. Re: Remove old OHOME after upgrade
    EdStevens Guru
    Currently Being Moderated
    final follow-up.

    As noted earlier, the documented deinstall procedure cleaned up the inventory but left the actual home directory in place, reporting a bunch of failures removing specific files or directories. Per the documentation [note 883743.1], after running the deinstall script, one should 'check if the Oracle Home folder is deleted or not. If not then you have to remove it manually."

    Because there are so many files buried down in bowels of OHOME that are owned by root, one must be root to delete them. Or have root chown them to be owned by oracle.

    So I ran another test where I had root chown the files (chown -R oracle:oinstall) *before* having user oracle run the deinstall. Voila! The deinstall ran cleanly, no errors, and completely removed the target OHOME.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points