Tuesday, 24 December 2013

UnsatisfiedLinkError exception loading native library: njni11 libnjni11.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)


In the process of R12.2 upgrade Generating database context file (adbldxml.pl) and running autoconfig (adautocfg.sh) throw java error.

Database 11g(11.2.0.3.0)
R12 12.2(Upgrading) 



bash-3.2$ perl adbldxml.pl


Starting context file generation for db tier..
Using JVM from /u01/oracle/ERP/db/tech_st/11.2.0/appsutil/jre/bin/java to execute java programs..
APPS Password:


The log file for this adbldxml session is located at:
/u01/oracle/ERP/db/tech_st/11.2.0/appsutil/log/adbldxml_11201201.log
UnsatisfiedLinkError exception loading native library: njni11
java.lang.UnsatisfiedLinkError: /u01/oracle/ERP/db/tech_st/11.2.0/lib/libnjni11.so: /u01/oracle/ERP/db/tech_st/11.2.0/lib/libnjni11.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)


Could not Connect to the Database with the above parameters, Please answer the Questions below



Enter Hostname of Database server:xxxx


Enter Port of Database server: 1521


Enter SID of Database server: xx


Enter Database Service Name: xx


Enter the value for Display Variable: xxxx:0.0


Context File  /u01/oracle/xxx/db/tech_st/11.2.0/appsutil/xxxxxxx.xml

already exists.


Overwriting Context File may cause loss of existing settings, hence
backing it up as: /u01/oracle/xxxx/db/tech_st/11.2.0/appsutil/xxxxx.xml.bak



The context file has been created at:
 /u01/oracle/xxx/db/tech_st/11.2.0/appsutil/xxxxxxx.xml


Even with the above errors it continues and creates context file (With the error it prompts few more values)
   
Autoconfig Error.


$ORACLE_HOME/appsutil/bin/adconfig.sh contextfile=/u01/oracle/ERP/db/tech_st/11.2.0/appsutil/xxx.xml

AutoConfig will consider the custom templates if present.
Using ORACLE_HOME location : /u01/oracle/ERP/db/tech_st/11.2.0
Classpath                   : :/u01/oracle/ERP/db/tech_st/11.2.0/jdbc/lib/ojdbc6.jar:/u01/oracle/ERP/db/tech_st/11.2.0/appsutil/java/xmlparserv2.jar:/u01/oracle/ERP/db/tech_st/11.2.0/appsutil/java:/u01/oracle/ERP/db/tech_st/11.2.0/jlib/netcfg.jar:/u01/oracle/ERP/db/tech_st/11.2.0/jlib/ldapjclnt11.jar

Using Context file          : /u01/oracle/ERP/db/tech_st/11.2.0/appsutil/xxx.xml



Context Value Management will now update the Context file
UnsatisfiedLinkError exception loading native library: njni11
java.lang.UnsatisfiedLinkError: /u01/oracle/ERP/db/tech_st/11.2.0/lib/libnjni11.so: /u01/oracle/ERP/db/tech_st/11.2.0/lib/libnjni11.so: wrong ELF class: ELFCLASS64 (Possible cause: architecture word width mismatch)



Root cause of the issue is 32 bit java , the program actually expects 64bit java instead of 32 bit java at $ORACLE_HOME/jre

Found java 64 under /u01/oracle/R122/fs1/FMW_Home/Oracle_EBS-app1/jdk/jre/bin so copied to $ORACLE_HOME/appsutil/

cp /u01/oracle/R122/fs1/FMW_Home/Oracle_EBS-app1/jdk/jre -RH /u01/oracle/ERP/db/tech_st/11.2.0/appsutil/

./java -version
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)

perl adbldxml.pl 


AFter copying the 64 bit jre to $ORACLE_HOME/appsutil/ location both adbldxml.pl and adautocfg.sh completed without errors.
 

Tuesday, 3 December 2013

Shirnking vmware virtual disk(vmdk) to reclaim unused space using command line


Virtual machine virtual disk grows very huge over time despite the fact that the guest os is not taking the space shown by the vmware virtual disk files.

This examples shows how to reclaim unused space using command line tools like vmware-mount and vmware-vdiskmanager.

The size of the virtual machine partitions, output of ls from the guest os


The total used space is only 10gb or so


The size of the virtual disk files on the host



To list the partition on a virtual partition use vmware-mount -p

ex: vmware-mount -p /u02/vm/vm_test_for_prod_handson/vm_test_for_prod_handson.vmdk

Partition has to be mounted to prepare it for shrinking, create a folder to mount the virtual machine partition

mkdir /tmp/vm

Mount the virtual disk partition

vmware-mount /u02/vm/vm_test_for_prod_handson/vm_test_for_prod_handson.vmdk 1 /tmp/vm (This will mount the first partition)








Now start preparing partition for shrinking

vmware-vdiskmanager -p /tmp/vm

After preparing is completed  unmount the partition

ex: vmware-vdiskmanager -d /tmp/vm

When all virtual partitions are prepared, unmount  partitions and start shrinking .

ex: vmware-vdiskmanager -k /u02/vm/vm_test_for_prod_handson/vm_test_for_prod_handson.vmdk

  

Virtual disk file size after shirnking 



Sunday, 1 December 2013

Online Patching Enablement patch(13543062:R12.AD.C) is failing with error "ORA-44305: service ebs_patch is running"

Online Patching Enablement patch: 13543062:R12.AD.C.

ORA-44305: service ebs_patch is running
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 86
ORA-06512: at "SYS.DBMS_SERVICE", line 454
ORA-06512: at "SYS.DBMS_SERVICE", line 375
ORA-06512: at "APPS.AD_ZD_PREP", line 308
ORA-06512: at line 4

Checked the error message with oerr utility

oerr ora 44305

44305, 0000, "service %s is running"
// *Document : Yes
// *Cause    : The specified service was running.
// *Action   : This message is informational only.

Actually the line 308 in package APPS.AD_ZD_PREP is where the error is happening.

The  line 308 in the package APPS.AD_ZD_PREP is executing the procedure dbms_service.start_service, as the service is already running the said error was thrown. So dbms_service.stop_service is executed explicitly to stop the service and adctrl is used to restart the failed worker. The adpatch continued to run and completed successfully.