Donnerstag, 4. Juni 2020

patch the unpatchable

Oracle provides several VM for demo and training purpose. One of them is the Database Virtual Box Appliance / Virtual Machine. 
It's very clear these VMs are only for testing purpose. 

But they are limited even more.
(at least) this specific VM can not even be patched. 
For some reason I wanted to apply Patch:29649694
First of all, there is no OPatch in the VM. This can be mitigated :-) 

But a first try with opatch lsinventory shows a strange result:
Oracle Interim Patch Installer version 12.2.0.1.21
Copyright (c) 2020, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/version/db_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/version/db_1/oraInst.loc
OPatch version    : 12.2.0.1.21
OUI version       : 12.2.0.7.0
Log file location : /u01/app/oracle/product/version/db_1/cfgtoollogs/opatch/opatch2020-06-04_08-24-42AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/version/db_1/cfgtoollogs/opatch/lsinv/lsinventory2020-06-04_08-24-42AM.txt
--------------------------------------------------------------------------------
Local Machine Information::
Hostname: localhost
ARU platform id: 0
ARU platform description:: 

There are no Interim patches installed in this Oracle Home.


--------------------------------------------------------------------------------

OPatch succeeded.
[oracle@localhost OPatch]$ 


The most important part here is the missing of ARU platform id and description.

With some comparison of a good sandbox, I identified the missing directory $ORACLE_HOME/inventory
The first file of interest there is $ORACLE_HOME/inventory/invDetails.properties
#invDetails.properties
#Wed May 13 17:46:16 UTC 2020
XML_VER=4.1
CompsXML=comps.xml
LibsXML=libs.xml
configXML=config.xml
ReleaseNotesXML=releaseNotes.xml
OHPropsXML=oraclehomeproperties.xml

This now shows even more required files.
$ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml contains the ARU id and description:
<?xml version = '1.0' encoding = 'UTF-8'?>
<!-- Copyright (c) 1999, 2019, Oracle and/or its affiliates.
All rights reserved. -->
<!-- Do not modify the contents of this file by hand. -->
<ORACLEHOME_INFO>
   <GUID>685938240#.1069264794</GUID>
   <HOME/>
   <ARU_PLATFORM_INFO>
      <ARU_ID>226</ARU_ID>
      <ARU_ID_DESCRIPTION>Linux x86-64</ARU_ID_DESCRIPTION>
   </ARU_PLATFORM_INFO>
   <PROPERTY_LIST>
     <PROPERTY NAME="ARCHITECTURE" VAL="64"/>
     <PROPERTY NAME="ORACLE_BASE" VAL="/u01/app/oracle"/>
   </PROPERTY_LIST>
</ORACLEHOME_INFO>

This is only the first step. Especially as the real patches applied are not known (DBA_REGISTRY_HISTORY  is of limited help, and DBA_REGISTRY_SQLPATCH relies on OPatch) it's to complicated for me

My approach here is to mimic OPatch and just do it on my own. 

I'm lucky: the patch only contains 1 file to be applied:
files/lib/libserver19.a/kpdbc.o 

and etc/config/actions.xml only says
<oneoff_actions>
    <oracle .rdbms="" opt_req="O" patch_level="3" version="19.0.0.0.0">
        <archive backup_in_zip="false" name="libserver19.a" object_name="lib/libserver19.a/kpdbc.o" path="%ORACLE_HOME%/lib" shaolue="E2CB4E2A994EB8B59E24471B719EA8F2A0079E66">
        <make change_dir="%ORACLE_HOME%/rdbms/lib" make_file="ins_rdbms.mk" make_target="ioracle">
    </make></archive></oracle>
</oneoff_actions>
Doesn't look difficult.
First of course, make sure no binaries are running. Then copy kpdbc.o to $ORACLE_HOME/lib.
There (after backup of libserver19.a) in this archive, kpbdc.o is replaced:
ar -r libserver19.a kpdbc.o
It should be possible to complete with
relink all
But it fails with
  Can't open perl script "/u01/app/oracle/product/version/db_1/install/modmakedeps.pl": (null)
This file also mist be provided from another installation. To cut it short, also $ORACLE_HOME/inventory/make/makeorder.xml is required.
With the help of these files, relink is happy. 


It can be done without the help of these 2 files.
cd $ORACLE_HOME/rdbms/lib
make -f ins_rdbms.mk ioracle
also does the trick.

Keine Kommentare: