Oracle Database Error Solutions & DBA Knowledge Base

Practical, step-by-step Oracle Database troubleshooting guides for DBAs, developers, Oracle E-Business Suite administrators, and IT professionals.

Find solutions for Oracle Database errors, RMAN, Data Guard, ASM, RAC, performance tuning, backup and recovery, installation, patching, cloning, Oracle Linux, and Oracle E-Business Suite.

Explore troubleshooting articles covering errors such as ORA-27101, ORA-28040, ORA-01555, ORA-12154, and ORA-01017, with practical guidance designed to help you diagnose problems and restore services efficiently.

```

SQL*Plus Error While Loading Shared Libraries (libsqlplus.so / libclntsh.so) – Complete Oracle DBA Troubleshooting Guide

SQL*Plus Error While Loading Shared Libraries (libsqlplus.so / libclntsh.so) – Complete Oracle DBA Troubleshooting Guide

Published: October 2012

Last Updated: August 2026

Applies To: This article has been completely reviewed, updated, and expanded for Oracle Database 10g, 11g, 12c, 18c, 19c, 21c, and 23ai. It now includes modern Linux shared library troubleshooting techniques, Oracle environment validation, production case studies, Oracle DBA best practices, FAQ, and enterprise-grade troubleshooting procedures based on real-world production environments.


One of the most common Linux errors encountered by Oracle Database Administrators is the following:

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

Sometimes the error references a different Oracle shared library such as:

libclntsh.so

libnnz19.so

libociei.so

libipc1.so

libons.so

This error prevents SQL*Plus from starting because Linux cannot locate one or more required Oracle shared libraries during program initialization.

Many administrators mistakenly reinstall Oracle Database immediately after seeing this error. However, in most production environments the database software is completely healthy. The actual problem usually involves an incorrect Oracle environment, missing library paths, broken symbolic links, permission issues, or libraries that are no longer accessible.

This guide explains how Oracle shared libraries work, why SQL*Plus fails to load them, and the production-tested troubleshooting procedures used by experienced Oracle DBAs to restore SQL*Plus without reinstalling Oracle software.

Quick Solution

Verify that ORACLE_HOME, LD_LIBRARY_PATH, and PATH are configured correctly. Confirm that the required Oracle shared libraries exist under $ORACLE_HOME/lib, have the correct ownership and permissions, and that SQL*Plus is being executed from the intended Oracle Home. If necessary, source the Oracle environment script before launching SQL*Plus.


Typical Error Messages

Depending on the Oracle Database version and missing library, you may encounter one of the following errors:

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

What Are Oracle Shared Libraries?

Oracle Database executables do not contain all required program code internally. Instead, they dynamically load shared libraries during execution.

Examples include:

  • libsqlplus.so
  • libclntsh.so
  • libnnz19.so
  • libons.so
  • libipc1.so
  • libociei.so

These libraries provide essential functionality such as:

  • Oracle Client connectivity.
  • SQL*Plus runtime components.
  • Network communication.
  • Authentication and encryption.
  • Oracle Net Services.
  • Operating system integration.

How SQL*Plus Loads Shared Libraries

When SQL*Plus starts, the Linux dynamic linker searches for every shared library required by the executable.

The search order generally includes:

  1. RPATH or RUNPATH embedded in the executable (if present).
  2. LD_LIBRARY_PATH.
  3. Directories configured in the system linker cache (for example, via ldconfig).
  4. Default operating system library locations such as /lib and /usr/lib.

If Linux cannot locate a required Oracle library, SQL*Plus terminates immediately with the shared library error.


Business Impact

Because SQL*Plus is one of the primary Oracle administration tools, this issue can affect a wide range of DBA activities.

Common impacts include:
  • DBA cannot connect locally.
  • RMAN scripts fail.
  • Data Pump jobs cannot be executed.
  • Patch installation fails.
  • AutoUpgrade may fail.
  • Maintenance activities are interrupted.
  • Database monitoring scripts stop working.
  • Application startup scripts may fail.

Common Root Causes

  • ORACLE_HOME is not set.
  • LD_LIBRARY_PATH is empty or incorrect.
  • PATH points to the wrong Oracle Home.
  • Oracle environment has not been sourced.
  • libsqlplus.so is missing.
  • libclntsh.so is missing.
  • Broken symbolic links.
  • Incorrect file ownership.
  • Incorrect library permissions.
  • Oracle Home corruption.
  • Multiple Oracle Homes causing conflicts.
  • Library cache not updated.
  • Executing SQL*Plus as the wrong operating system user.

Where Should You Start?

Rather than reinstalling Oracle software, begin by validating the Oracle runtime environment.

A structured investigation should answer the following questions:
  • Is ORACLE_HOME set correctly?
  • Does PATH reference the intended Oracle Home?
  • Is LD_LIBRARY_PATH configured properly?
  • Do the required libraries exist under $ORACLE_HOME/lib?
  • Are the libraries readable by the Oracle software owner?
  • Are there multiple Oracle Homes on the server?
  • Has the Oracle environment been sourced?
  • Were any recent operating system or Oracle patches applied?

Answering these questions typically identifies the underlying cause quickly and avoids unnecessary software reinstallation.


Production Oracle DBA Recommendation

Treat shared library loading errors as environment or operating system configuration issues rather than Oracle Database failures. Always verify ORACLE_HOME, PATH, LD_LIBRARY_PATH, library existence, permissions, and symbolic links before considering a reinstall of the Oracle software.


Step-by-Step Production Troubleshooting

When SQL*Plus reports a shared library loading error, the objective is to determine why the Linux dynamic linker cannot locate the required Oracle libraries. In most production environments, the issue is related to an incorrect Oracle environment, multiple Oracle Homes, missing library paths, or damaged symbolic links rather than corrupted Oracle software.


Step 1 – Verify ORACLE_HOME

Confirm that ORACLE_HOME points to the correct Oracle installation.

echo $ORACLE_HOME
Example output:
/u01/app/oracle/product/19.0.0/dbhome_1
If the variable is empty or incorrect, source the appropriate Oracle environment.

Step 2 – Verify PATH

Ensure SQL*Plus is executed from the intended Oracle Home.

echo $PATH

which sqlplus
The SQL*Plus executable should reside under:
$ORACLE_HOME/bin/sqlplus
If another Oracle Home appears first in the PATH, update the environment accordingly.

Step 3 – Verify LD_LIBRARY_PATH

Check whether the Oracle library directory is included in LD_LIBRARY_PATH.

echo $LD_LIBRARY_PATH
It should include:
$ORACLE_HOME/lib
If the variable is missing or incorrect, update the Oracle environment and reload the profile.

Step 4 – Verify Required Library Files

Confirm that the required Oracle shared libraries exist.

ls -l $ORACLE_HOME/lib/libsqlplus.so

ls -l $ORACLE_HOME/lib/libclntsh.so*

ls -l $ORACLE_HOME/lib/libnnz*
Verify:
  • Library exists.
  • Correct ownership.
  • Readable permissions.
  • No accidental deletion.

Step 5 – Check Shared Library Dependencies

Use the Linux ldd utility to identify missing dependencies.

ldd $ORACLE_HOME/bin/sqlplus
If any dependency displays:
not found
that library must be resolved before SQL*Plus can start successfully.

Step 6 – Verify Symbolic Links

Oracle uses symbolic links for several shared libraries.

Check them using:
ls -l $ORACLE_HOME/lib/libclntsh.so*

ls -l $ORACLE_HOME/lib/libsqlplus.so*
Broken links should be corrected according to the Oracle installation.

Step 7 – Verify Permissions

Ensure that the Oracle software owner has access to all required libraries.

Check permissions:
ls -l $ORACLE_HOME/lib
Verify:
  • Owner
  • Group
  • Read permission
  • Execute permission
Incorrect ownership after file copy or restore operations is a common cause.

Step 8 – Refresh the Dynamic Linker Cache (If Applicable)

On systems that use the dynamic linker cache for Oracle libraries, refresh the cache after library changes.

sudo ldconfig
Then verify that the libraries are visible:
ldconfig -p | grep libclntsh

Step 9 – Verify Multiple Oracle Homes

Servers often contain multiple Oracle installations.

Common examples include:
  • Oracle Database 11g
  • Oracle Database 19c
  • Oracle Client
  • Oracle Grid Infrastructure
Ensure SQL*Plus, ORACLE_HOME, PATH, and LD_LIBRARY_PATH all reference the same Oracle Home.

Step 10 – Source the Oracle Environment

Many shared library issues occur because the Oracle environment has not been loaded.

Example:
. oraenv
or
source ~/.bash_profile
Then retry SQL*Plus:
sqlplus / as sysdba

Real Production Case Study

A production Linux server hosted Oracle Database 19c and Oracle Client 12c. After a maintenance reboot, the DBA received:

sqlplus:
error while loading shared libraries:
libsqlplus.so:
cannot open shared object file

Investigation showed that the system profile loaded the Oracle Client environment instead of the Oracle Database environment. As a result, PATH referenced one Oracle Home while LD_LIBRARY_PATH referenced another.

After correcting the environment variables and sourcing the proper Oracle Database profile, SQL*Plus launched successfully without reinstalling any Oracle software.


Oracle DBA Investigation Checklist

Verification Status
ORACLE_HOME Verified
PATH Verified
LD_LIBRARY_PATH Verified
Correct SQL*Plus Binary Used
Required Libraries Exist
Symbolic Links Verified
Library Permissions Verified
ldd Output Reviewed
Multiple Oracle Homes Checked
Environment Reloaded
SQL*Plus Started Successfully

Oracle Database Version Considerations

Although the troubleshooting methodology is generally the same across Oracle releases, the names of shared libraries and Oracle Home layouts vary by version.

Oracle Version Common Libraries Key Considerations
10g libclntsh.so.10.1, libsqlplus.so Verify ORACLE_HOME and legacy environment variables.
11g libclntsh.so.11.1, libsqlplus.so Multiple Oracle Homes are a common source of conflicts.
12c libclntsh.so.12.1, libsqlplus.so Ensure the correct Oracle Home is sourced after upgrades.
18c / 19c libclntsh.so.18.1 / 19.1, libnnz19.so Confirm that PATH and LD_LIBRARY_PATH point to the same Oracle Home.
21c / 23ai Version-specific client libraries Validate Oracle Home consistency and shared library dependencies after patching.

Best Practices for Oracle DBAs

  • Always source the Oracle environment before running SQL*Plus, RMAN, or Data Pump.
  • Maintain a consistent ORACLE_HOME, PATH, and LD_LIBRARY_PATH configuration.
  • Avoid mixing Oracle Client and Oracle Database binaries in the same shell session.
  • Use Oracle's recommended environment scripts such as oraenv.
  • Document all Oracle Homes installed on the server.
  • Review symbolic links after cloning or restoring an Oracle Home.
  • Verify shared library dependencies after patching or upgrading Oracle software.
  • Restrict manual changes within the $ORACLE_HOME/lib directory.
  • Perform regular filesystem integrity and permission checks.
  • Test administrative tools after maintenance to confirm the runtime environment is intact.

Common Administrator Mistakes

  • Reinstalling Oracle without checking environment variables.
  • Running SQL*Plus from the wrong Oracle Home.
  • Leaving ORACLE_HOME unset.
  • Using an incorrect LD_LIBRARY_PATH.
  • Mixing Oracle Client and Database libraries.
  • Deleting or renaming Oracle shared libraries manually.
  • Ignoring broken symbolic links.
  • Running SQL*Plus as an operating system user that lacks access to the Oracle Home.
  • Overwriting Oracle binaries during manual file copies.
  • Skipping verification after operating system or Oracle patching.

Useful Linux Commands

Verify Oracle Environment

echo $ORACLE_HOME
echo $PATH
echo $LD_LIBRARY_PATH

Locate SQL*Plus

which sqlplus

List Oracle Libraries

ls -l $ORACLE_HOME/lib

Check Library Dependencies

ldd $ORACLE_HOME/bin/sqlplus

Find Missing Libraries

find $ORACLE_HOME -name "libsqlplus.so*"

find $ORACLE_HOME -name "libclntsh.so*"

Refresh the Linker Cache (if applicable)

sudo ldconfig

Troubleshooting Flowchart

SQL*Plus Shared Library Error

          │

          ▼

Check ORACLE_HOME

          │

          ▼

Check PATH

          │

          ▼

Check LD_LIBRARY_PATH

          │

          ▼

Verify Libraries Exist

          │

          ▼

Run ldd on SQL*Plus

          │

          ▼

Any Missing Libraries?

      ┌────┴────┐

      │         │

     Yes        No

      │         │

Repair      Check Permissions
Libraries    & Symbolic Links

          │

          ▼

Reload Oracle Environment

          │

          ▼

Run SQL*Plus Again

          │

          ▼

Problem Resolved

Frequently Asked Questions (FAQ)

Does this error mean Oracle Database is corrupted?

No. In most cases, the database software is intact. The problem usually lies in the runtime environment or the Linux dynamic linker being unable to locate the required Oracle shared libraries.

Can an incorrect LD_LIBRARY_PATH cause this error?

Yes. An incorrect or empty LD_LIBRARY_PATH is one of the most common causes because the operating system cannot locate libraries such as libsqlplus.so or libclntsh.so.

Should I reinstall Oracle Database?

Usually not. Verify the Oracle environment, library files, symbolic links, permissions, and dependencies first. Reinstallation should be considered only after confirming that the Oracle Home is genuinely corrupted.

Can multiple Oracle Homes cause this problem?

Yes. Mixing binaries and libraries from different Oracle Homes is a frequent cause of shared library loading errors on servers hosting multiple Oracle products or versions.

Can this issue affect RMAN or Data Pump?

Yes. RMAN, Data Pump, SQL*Loader, and other Oracle utilities rely on the same Oracle libraries. If the runtime environment is incorrect, several Oracle command-line tools may fail with similar shared library errors.


Related Oracle Articles


About the Author

Rana Abdul Wahid is an Oracle Database and Oracle E-Business Suite Consultant with more than 15 years of experience in Oracle Database Administration, Oracle E-Business Suite Application DBA, Oracle Cloud Infrastructure (OCI), Oracle RAC, Oracle Data Guard, RMAN Backup & Recovery, Linux/Unix Administration, MySQL, Microsoft SQL Server, PostgreSQL, and enterprise database management.

He specializes in Oracle Database administration, Linux troubleshooting, Oracle client configuration, backup and recovery, performance tuning, Oracle E-Business Suite administration, and enterprise production support, sharing practical solutions based on real-world DBA experience.

Learn more about the author →


Conclusion

The SQL*Plus error while loading shared libraries is almost always an environment or operating system configuration issue rather than a failure of the Oracle Database itself. Incorrect ORACLE_HOME, PATH, LD_LIBRARY_PATH, missing libraries, broken symbolic links, or multiple Oracle Home conflicts are the most common causes.

By methodically validating the Oracle environment, confirming the existence of required libraries, checking dependencies with ldd, verifying permissions, and ensuring all Oracle utilities reference the same Oracle Home, DBAs can resolve these issues quickly and avoid unnecessary downtime or software reinstallation.

Final Oracle DBA Recommendation

Always load the correct Oracle environment before running command-line utilities, maintain consistent Oracle Home configurations, and investigate shared library dependencies before considering repairs or reinstallation. Preventive environment validation is one of the simplest ways to avoid production outages caused by shared library loading errors.

Found this guide helpful? Visit the Oracle Error Codes Guide for more production-tested Oracle Database and Oracle E-Business Suite troubleshooting articles covering Oracle RAC, Data Guard, RMAN, SQL*Plus, Linux administration, AutoConfig, and enterprise DBA best practices.

Comments

  1. Thanks for sharing useful information. I've a question, does Oracle normally recommends to disable SELinux, I read it somewhere and did so on my server.

    ReplyDelete
    Replies
    1. Hello Ahmed,

      Kindly view Metalink Doc ID 454196.1, which provide workaround to fix it immediately or apply a patch.

      Thanks

      Delete
  2. There are four shared libraries in the distribution , have to compile using Intel ICC compiler ,and those libraries perform relocation
    so Oracle recommended SELINUX should be disable .
    you can find these libraries by setting SELINUX to "permissive" which will log errors but allow actions SELINUX would otherwise deny.Now use audit2allow command or leave
    leave SELINUX in "enforcing" mode use SELINUX troubleshooter to determine each error and troubleshooting report to fix.
    www.tcpak.com

    ReplyDelete

Post a Comment