Sqlplus Error 57 Initializing Sql-plus Error Loading Message Shared Library

SQL*Plus looks for libraries relative to the ORACLE_HOME directory. If this variable is not set, the executable cannot find its dependencies.

Action: Verify the variable is set by echoing it:

echo $ORACLE_HOME

If it returns a blank line or an incorrect path, set it to your Oracle installation directory (e.g., /u01/app/oracle/product/19.0.0/dbhome_1):

export ORACLE_HOME=/path/to/your/oracle/home

echo %ORACLE_HOME% echo %PATH% echo %NLS_LANG%

Expected values:

# For bash
export ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
# For csh
setenv ORACLE_HOME /u01/app/oracle/product/12.2.0/dbhome_1
setenv LD_LIBRARY_PATH $LD_LIBRARY_PATH:$ORACLE_HOME/lib
setenv TNS_ADMIN $ORACLE_HOME/network/admin

Error 57 almost always means the dynamic linker can't find SQL*Plus message libraries. Setting LD_LIBRARY_PATH correctly and ensuring the basic + sqlplus packages are installed resolves it in 90% of cases.


Have you encountered this error on Windows? The symptoms differ – let me know in the comments, and I'll cover the Windows (PATH vs ORACLE_HOME) equivalent.


The key phrase in the error is "loading message shared library."

Oracle SQL*Plus relies on external shared libraries (.so files on Linux/Unix or .dll files on Windows) to operate. Specifically, it needs to load a library responsible for handling error messages and language settings. If the operating system cannot locate or load these libraries, the executable fails to initialize, resulting in Error 57. SQL*Plus looks for libraries relative to the ORACLE_HOME

There are three primary causes for this failure:


ls -l $ORACLE_HOME/lib/libclntsh*
ls -l $ORACLE_HOME/lib/libsqlplus*

First, ensure your Oracle environment is correctly set. As the Oracle software owner (e.g., oracle user), run:

echo $ORACLE_HOME
echo $PATH
echo $LD_LIBRARY_PATH

Expected Output:

If LD_LIBRARY_PATH is empty or missing the lib directory, set it: If it returns a blank line or an

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH

For AIX, use LIBPATH:

export LIBPATH=$ORACLE_HOME/lib:$LIBPATH

For HP-UX, use SHLIB_PATH:

export SHLIB_PATH=$ORACLE_HOME/lib:$SHLIB_PATH

For Solaris (64-bit), use LD_LIBRARY_PATH_64:

export LD_LIBRARY_PATH_64=$ORACLE_HOME/lib:$LD_LIBRARY_PATH_64

After setting, re-run sqlplus /nolog. If the error disappears, add the export to your .bash_profile, .profile, or .cshrc. echo %ORACLE_HOME% echo %PATH% echo %NLS_LANG%