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
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    :
OUI version       :
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/
#Wed May 13 17:46:16 UTC 2020

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. -->
     <PROPERTY NAME="ORACLE_BASE" VAL="/u01/app/oracle"/>

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:

and etc/config/actions.xml only says
    <oracle .rdbms="" opt_req="O" patch_level="3" version="">
        <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="" make_target="ioracle">
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/": (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 ioracle
also does the trick.

Keine Kommentare: