Thursday, September 11, 2008

SQLPlus (Shared Library) Not Found! (Linux, 10g2)

After installing Oracle database 10g2 on Linux, you may get the following error when trying to invoke sqlplus

$ sqlplus
sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No such file or directory

Mmmm, that's strange, the install went perfectly. This error occurs under the following conditions
  • The user invoking sqlplus is not the oracle user (or a member of the oinstall group)
  • No Metalink patches have been applied yet
So let's do some investigation

$ su -
Password:
~ # locate libsqlplus.so
/u01/app/oracle/product/10.2.0/db_1/lib/libsqlplus.so
~ # ll /u01/app/oracle/product/10.2.0/db_1/lib/libsqlplus.so
-rw-r----- 1 oracle oinstall 1047293 Jun 22 2005 /u01/app/oracle/product/10.2.0/db_1/lib/libsqlplus.so

So clearly the shared object libsqlplus.so is there but note that it is only readable by the oracle user and members of oinstall group. This is a bug in the Linux release - it does seem to indicate some pretty poor quality control on the part of Oracle's release engineering team. I would have thought that this type of "correct permissions" error is part of the standard tests run immediately before a new version is OK'd for release.......Oracle, you do have such standard checks?

A quick scan through $ORACLE_HOME will show that some of the executables are not actually executable by everyone (permissions are rwxr-x---, when they should be rwxr-xr-x). If the installation is for training, experimenting etc and thus has no license, it can be easily fixed by simply doing

# chmod -R a+rX $ORACLE_HOME

The capital X gives everyone (all) executable permissions if, and only if, the owner has executable permissions.

If it is a licensed version then download patch 4516865 which will install a script called $ORACLE_HOME/install/changePerm.sh, which you obviously need to run. But this script has a bug too - it does not update $ORACLE_HOME/lib/libclntsh.so.10.1 - you can just chmod 755 this file manually. Not sure if there is another Metalink patch to do this "officially".

1 comment:

Unknown said...

Thanks! I been battling with trying to get Tibco iProcess to run and suspected exactly what you have described in your blog.