Listen carefully, I shall patch this iAS only once…
Wednesday, July 25th, 2007A customer recently had a problem with oracle forms on an application server version 10.1.2.0.2.
(Operating System: AIX version 5.3)
Some research (done by the vendor of the forms application) turned up a bug: 4509399 (when-tree-node-activated not firing if pressing return on a selected node). Well, no problem one would think…
Installing the patch using OPatch went wrong:
Printing stderr to output (from /appl/oracle/as/101202/as/.patch_storage/4509399/make_local.stderr)
/bin/sh: /appl/oracle/as/101202/as/bin/genshlib: not found
make: The error code from the last command is 127.
Stop.
Make failed. If you continue, you will have to run make manually on the local system.
Do you want to STOP?
Please respond Y|N >
Local make failed. See log file for details.
ERROR: OPatch failed as make operation did not succeed
It turns out we do not have the genshlib script! That mazed me.
But, back to metalink and see if that’s a known problem, or me having a funked up environment.
Metalink showed that it’s correct not to have genshlib installed, and has a patch available: 5488476.
I’ve installed that patch, and back to patch 4509399!
No luck this time:
Comparing "/home/oracle/patch/4509399/files/lib32/libiwfw.a/iwtreh.o" and "/appl/oracle/as/101202/as/.patch_storage/verify/lib32/libiwfw.a/iwtreh.o"
Source file name is : /home/oracle/patch/4509399/files/lib32/libiwfw.a/iwtreh.o, size is : 2820
Destination file name(from OracleHome) is : /appl/oracle/as/101202/as/.patch_storage/verify/lib32/libiwfw.a/iwtreh.o, size is : 2328
Archive failed: failed to update "/appl/oracle/as/101202/as/lib32/libiwfw.a" with updated "/home/oracle/patch/4509399/files/lib32/libiwfw.a/iwtreh.o"
There are 1 issues patching static library in Oracle Home.
FILE PROBLEM: some files are not patched.
OPATCH_JAVA_ERROR: Patch was not successfully applied.
Verification of the patch failed.
ERROR: OPatch failed as verification of the patch failed.
Warning! Any information beyond this point is unsupported and only for education purposes!!
Time to dissect this patch. What does it do?
First, look at the patch:
AS /home/oracle/patch/4509399 >find .
.
./files
./files/lib32
./files/lib32/libiwfw.a
./files/lib32/libiwfw.a/iwtreh.o
./etc
./etc/config
./etc/config/inventory
./etc/config/actions
./etc/xml
./etc/xml/GenericActions.xml
./etc/xml/ShiphomeDirectoryStructure.xml
./README.txt
The “/files” section has the files which are needed for this patch, in our case one object file, iwtreh.o.
The “/etc” section has the actions which OPatch needs to do.
Now we have to find out what is being done…One step beyond!
The “/etc/config/actions” file has the actions (not surprisingly) and the variables:
< oneoff_actions>
< oracle .developer.forms version="10.1.2.0.2" opt_req="R">
< archive name="libiwfw.a" path="%ORACLE_HOME%/lib32" object_name="lib32/libiwfw.a/iwtreh.o"/>
< make change_dir="%ORACLE_HOME%/forms/lib32" make_file="ins_forms.mk" make_target="sharedlib OBJECT_MODE=32"/>
< make change_dir="%ORACLE_HOME%/forms/lib32" make_file="ins_forms.mk" make_target="install OBJECT_MODE=32"/>
< /oracle>
< /oneoff_actions>
There are three actions here:
-archive, with variables: name, path and object_name
-make, with variables: change_dir, make_file and make_target
-make, with variables: change_dir, make_file and make_target
But OPatch needs more information; this information is present in “/etc/xml/GenericActions.xml”
< ?xml version="1.0" standalone="no"?>
< !DOCTYPE pack SYSTEM "GenericActions.dtd">
< one_off_actions>
< globalcmd name="change_dir">
< perl name="change_dir" module="CWD" perlcmd="chdir" override="true" param_num="1" />
< /globalcmd>
< globalcmd name="copy">
< perl name="copy" module="File::Copy" perlcmd="copy" param_num="2" />
< /globalcmd>
< globalcmd name="archive_lib">
< apply>
< system command="ar" parameters='-rc %1 %2' />
< /apply>
< backup>
< system command="ar" parameters='-x %1 %2' />
< /backup>
< /globalcmd>
< globalcmd name="archive_jar">
< apply>
< system command="jar" path='%ORACLE_HOME%/jdk/bin' parameters='-uf %1 %2 -m %3' />
< /apply>
< backup>
< system command="jar" path='%ORACLE_HOME%/jdk/bin' parameters='-xf %1 %2' />
< /backup>
< /globalcmd>
< globalcmd name="make">
< apply>
< perl name="change_dir" parameters='%1' />
< system name="make" parameters='-f %2 %3' />
< /apply>
< backup>
< perl name="copy" parameters='%4' />
< /backup>
< /globalcmd>
< os osname="AIX-Based Systems (64-bit)" id="38">
< action name="archive_lib">
< apply>
< system command="ar" parameters='-rc -X32_64 %1 %2' />
< /apply>
< backup>
< system command="ar" parameters='-x -X32_64 %1 %2' />
< /backup>
< /action>
< /os>
< os osname="AIX-Based Systems (64-bit) 5L" id="212">
< action name="archive_lib">
< apply>
< system command="ar" parameters='-rc -X32_64 %1 %2' />
< /apply>
< backup>
< system command="ar" parameters='-x -X32_64 %1 %2' />
< /backup>
< /action>
< /os>
< os osname="Digital Alpha Open VMS" product_id="89">
< /os>
< opack>
< action>
< name>ARCHIVE_LIST
< datatype>StringList
< parse_method>parseArchiveList
< opatch_action>archive
< validity_check>-e
< validity_check>-f
< validity_check>-r
< /action>
< action>
< name>JAR_LIST
< datatype>StringList
< parse_method>parseJarList
< opatch_action>jar
< validity_check>-e
< validity_check>-f
< validity_check>-r
< /action>
< action>
< name>COPY_LIST
< datatype>StringList
< parse_method>parseCopyList
< opatch_action>copy
< validity_check>-e
< validity_check>-f
< validity_check>-r
< /action>
< action>
< name>MAKE_TRIPLETS
< datatype>StringList
< parse_method>parseMakeTriplets
< opatch_action>make
< /action>
< /opack>
< /one_off_actions>
So, we have the actions and the variables (”actions”), and we have a file which describes how these actions are done (”GenericActions.xml”).
That’s enough to gain understanding on what this patch is doing:
1. An object (”iwtreh.o”) in the archive “/appl/oracle/as/101202/as/lib32/libiwfw.a” is being replaced
2. After that, the shared libraries are rebuild (this way the new object in the archive is known by the libraries who are depended on this archive), which is being done using the target “sharedlib”.
3. After that, the forms executables are relinked and installed in the bin (using the target “install”)
Well, we just can do that, can’t we?
1. replace object “iwtreh.o” in “libiwfw.a”
1.1 first make a safety-copy
$ cd /appl/oracle/as/101202/as/lib32/
$ cp libiwfw.a libiwfw.a.orig
1.2 replace the object using the ar command (the command is present in the osname=”AIX-Based Systems (64-bit) 5L” section)
$ ar -rc -X32_64 libiwfw.a /home/oracle/patch/4509399/files/lib32/libiwfw.a/iwtreh.o
At this point we replaced the object in the archive, now we have to manually rebuild the forms shared libraries, and relink the forms executables:
2. generate forms shared libraries
$ cd /appl/oracle/as/101202/as/forms/lib32
$ make -f ins_forms.mk sharedlib
3. relink and install forms executables
$ make -f ins_forms.mk install