Error: ORA-06522: libsg.so: cannot open shared object file: No such file or directory
When accessing the Spatial Type for Oracle using SQL, the following error message displays:
ORA-06520: PL/SQL: Error loading external library
ORA-06522: libsg.so: cannot open shared object file: No such file or directory
ORA-06512: at "SDE.ST_GEOMETRY_SHAPELIB_PKG", line 12
ORA-06512: at "SDE.ST_GEOMETRY", line 56"
Instead of 'libsg.so', the error message may cite 'libpe.so', 'pe.dll' or 'sg.dll'. The same cause applies in all cases.
A required library file cannot be located and loaded by the extproc process.
The extproc process uses the directory paths listed in the environment variable EXTPROC_DLLS to find library files it directly loads, including libst_shapelib.so or st_shapelib.dll. However, that library in turn loads other libraries, such as the projection engine (libpe.so or pe.dll). The EXTPROC_DLL environment variable is not used to find those additional libraries. Those additional libraries are found using standard operating system methods, such as looking up their paths in the PATH or LD_LIBRARY_PATH environment variables.
Solution or Workaround
Instruct the extproc process where to find the library files it needs.
- In the listener.ora file, it is possible to define environment variables to be used by the extproc process when it runs. Define the environment variables that specify the search path for libraries is within the listener.ora file. Specify full paths, and do not use environment variable substitution (e.g., %mypath%). On Windows and Unix operating systems, the directory path syntax will be different. Use the correct syntax and environment variables for your operating system.
In this example that is typical for many Unix systems, the environment variable to be defined is named LD_LIBRARY_PATH.
- Restart the Oracle Listener.
Refer to Oracle's Database Net Services Administrator's Guide chapter on Enabling Advanced Features of Oracle Net Services for information about configuring the Oracle extproc process.