You have seen me rant about Oracle's provided virtual hostname solution before. If you have not, check it out here. In summary, Oracle's provided solution basically asks you to change the physical hostname of the server to the virtual one, which affects not just Oracle EBS, but everything running on that server.
In my earlier blog post, I outlined the steps to get virtual hostname working for 11i, R12.0, and R12.1 releases. Oracle EBS R12.2 is a special case, as it uses both 32-bit and 64-bit JDK.
I am happy to tell you that I have a working virtual hostname solution that works with EBS R12.2. Thanks to Maris Elsins who figured this out. In brief, the solution is to compile both 32-bit and 64-bit versions of the fakehostname library and copy them to /usr/lib and /usr/lib64 directories with the same name: libfakehostname.so.1.
The core of the fix is setting LD_PRELOAD to just libfakehostname.so.1 without the absolute path. This way, both 32-bit and 64-bit binaries pick up the appropriate library corresponding to their specific architecture.
Follow these steps to implement the solution on your environment:
[applmgr@apps ~]$ wget https://github.com/nonspecialist/fakehostname/archive/master.zip [applmgr@apps ~]$ unzip master.zip [applmgr@apps ~]$ cd fakehostname-master/
[applmgr@apps fakehostname-master]$ gcc -fPIC -m32 -shared -Wl,-soname,libfakehostname.so.1 -ldl -o libfakehostname.so.1 fakehostname.c
[applmgr@apps fakehostname-master]$ gcc -fPIC -m64 -shared -Wl,-soname,libfakehostname64.so.1 -ldl -o libfakehostname64.so.1 fakehostname.c [applmgr@apps fakehostname-master]$ ls libfakehostname* libfakehostname64.so.1 libfakehostname.so.1
# Copy the 32-bit library to /usr/lib [applmgr@apps fakehostname-master]$ sudo cp libfakehostname.so.1 /usr/lib # Copy 64-bit library to /usr/lib64 with same name as 32-bit library [applmgr@apps fakehostname-master]$ sudo cp libfakehostname64.so.1 /usr/lib64/libfakehostname.so.1
Once the libraries are in place, you can verify the redirection of the hostname command using the following environment variables:
Important Note: When setting
LD_PRELOAD, do not use the absolute path. Use only the library name so the system can toggle between/usr/liband/usr/lib64automatically.
[applmgr@apps ~]$ export LD_PRELOAD="libfakehostname.so.1" # Test the current physical hostname [applmgr@apps ~]$ hostname apps.example.com # Set and test the fake hostname [applmgr@apps ~]$ export MYHOSTNAME=virtapps.example.com [applmgr@apps ~]$ hostname virtapps.example.com
Ready to optimize your Oracle Database for the future?