Ld library path linux oracle

Ld library path linux oracle

4.3.2 LD_LIBRARY_PATH Environment Variable

Use the LD_LIBRARY_PATH environment variable to specify directory paths that the linker should search for libraries specified with the -l library option.

Multiple directories can be specified, separated by a colon. Typically, the LD_LIBRARY_PATH variable contains two lists of colon-separated directories separated by a semicolon:

The directories in dirlist1 are searched first, followed by any explicit -L dir directories specified on the command line, followed by dirlist2 and the standard directories.

That is, if the compiler is called with any number of occurrences of -L , as in:

then the search order is:

dirlist1 path1 . pathn dirlist2 standard_paths

When the LD_LIBRARY_PATH variable contains only one colon-separated list of directories, it is interpreted as dirlist2 .

In the Solaris operating environment, a similar environment variable, LD_LIBRARY_PATH_64 can be used to override LD_LIBRARY_PATH when searching for 64-bit dependencies. See the Solaris Linker and Libraries Guide and the ld (1) man page for details.

On a 32-bit SPARC processor, LD_LIBRARY_PATH_64 is ignored.

If only LD_LIBRARY_PATH is defined, it is used for both 32-bit and 64-bit linking.

If both LD_LIBRARY_PATH and LD_LIBRARY_PATH_64 are defined, 32-bit linking will be done using LD_LIBRARY_PATH , and 64-bit linking with LD_LIBRARY_PATH_64 .

Use of the LD_LIBRARY_PATH environment variable with production software is strongly discouraged. Although useful as a temporary mechanism for influencing the runtime linker’s search path, any dynamic executable that can reference this environment variable will have its search paths altered. You might see unexpected results or a degradation in performance.

Источник

Как правильно использовать LD_LIBRARY_PATH?

Решил на выходных повтыкать в одну игру с gog, а там в start.sh есть такой кусок:

просто у тебя есть эти нужные библиотеки, а в указанной директории нет

То есть, если задана эта переменная, то системные папки не проверяются?

Похоже, что LD_LIBRARY_PATH уже содержит какие-то пути, в т.ч. к libGL.so.1, но этот скрипт вместо того, чтобы добавить к ним свои, затирает их.

васче это странно. как их можно затереть?

Очень просто, в переменной лежало одно значение, а export в скрипте положил новое вместо старого. Правильно было бы добавить в начало:

никогда так не делал и всё работало. просто, скорее всего, там и ./$bin_name тоже какой-то скрипт.

просто у тебя есть эти нужные библиотеки, а в указанной директории нет

Наоборот. В указанной директории есть какие-то библиотеки, с которыми игра не работает.

скорее всего, так.

Это же очень легко выяснить. Если ОП напишет в консоли echo $LD_LIBRARY_PATH , и там не пусто, и в одном из этих каталогов есть libGL.so.1, то игра не нашла libGL из-за того, что скрипт изменил значение LD_LIBRARY_PATH, стерев те пути, которые там были.

Запускается игра и при отсутствии export LD_LIBRARY_PATH в скрипте, скорее всего, из-за того, что нужные библиотеки (которые лежали в game и lib) есть и в системных каталогах.

На правах мэйнтэйнера: чем не устроил games-strategy/spaz ?

Или там версия старая?

Update: пардон, почудилось что ты задавал вопрос про humble bundle версию, а не про gog.

В том-то и дело что в LD_LIBRARY_PATH пусто по-умолчанию.

Источник

Andrew Beacock’s Blog

eng mgr / leader / full stack / java / agile / tdd / security / aws / go

Search This Blog

How to add shared libraries to Linux’s system library path

Sometimes in Linux when you install a new software package the instructions tell you to add a directory of shared libraries to your $LD_LIBRARY_PATH environment variable in your .bashrc.

You may have noticed that if you then create a shortcut icon on your desktop to this application it won’t start because it can’t find the libraries.
A typical solution is to write a wrapper shell script to set the LD_LIBRARY_PATH and then call that application.

Well, I’ve discovered how to add them to your system’s library path allowing all environments to access them. Note: There are differences between Debian and Ubuntu (the two flavours of Linux that I’m familiar with).

Ubuntu
Create a new file in /etc/ld.so.conf.d/ called .conf

Edit the file and add a line per directory of shared libraries (*.so files), it will look something like:Reload the list of system-wide library paths:Debian
Edit /etc/ld.so.conf

Add a line per directory of shared libraries (*.so files) to the bottom of the file, it will look something like:Reload the list of system-wide library paths:
If you run your new application it should now work fine without you having to set any LD_LIBRARY_PATH environment variables.
If you still have problems you can obtain a list of the libraries that are on the system path by re-running the ldconfig command in verbose mode:

Читайте также:  Windows portable usb что это

Источник

Ld library path linux oracle

Oracle Instant Client provides the necessary Oracle Database client-side files to create and run OCI, OCCI, ODBC, and JDBC OCI applications. Useful command-line utilities including SQL*Plus, SQL*Loader and Oracle Data Pump are also available. Oracle Instant Client simplifies the deployment of applications by eliminating the need for an Oracle home on the client machines.

The storage space requirement of an OCI application running in Instant Client mode is significantly reduced compared to the same application running in a full client-side installation. A minimal install of Instant Client shared libraries can occupy less than 10% of the space of a full client-side installation. Finally, the Instant Client is easy to install.

Why use Instant Client?

Installation involves unzipping a few files, or installing RPM packages.

The number of required files and the total disk storage are significantly reduced.

There is no loss of functionality or performance for applications deployed using Instant Client.

It is simple for independent software vendors to package applications.

A README file is included with the Instant Client installation. It describes the version, date and time, and the operating system the Instant Client was generated on.

OCI applications, by default, look for the OCI Data Shared Library, libociei.so (or Oraociei19.dll on Windows) in the runtime library search path (for example LD_LIBRARY_PATH on Linux, or PATH on Windows) to determine if the application should operate in the Instant Client mode. If this library is not found, then OCI tries to load the Instant Client Light Data Shared Library (see Table 2-3 and Table 2-4), libociicus.so (or Oraociicus19.dll on Windows). If the Instant Client Light library is found, then the application operates in the Instant Client Light mode. Otherwise, a full installation based on Oracle home is assumed.

For Instant Client, the following tables shows the Oracle Database client-side files required to deploy an OCI application for Linux and UNIX and Microsoft Windows. Other libraries and utilities get installed, but are not needed for OCI runtime use. For example, you can delete files such as jdbc.jar .

Table 2-1 Instant Client Shared Libraries for Linux and UNIX

Client Code Library

OCI Instant Client Data Shared Library

Oracle Notification Service (ONS) library

Light Weight IPC Library

Message Queue Light Library

The libraries must reside in the same directory in order to use Instant Client.

Table 2-2 Instant Client Shared Libraries for Microsoft Windows

Linux and UNIX Description for Linux and UNIX

Forwarding functions that applications link with

ONS library used by OCI internally

On Microsoft Windows, a .sym file is provided for each dynamic-link library (DLL). When the .sym file is present in the same location as the DLL, a stack trace with function names is generated when a failure occurs in OCI on Microsoft Windows.

In general, all OCI functionality is available to an application being run using the Instant Client, except that the Instant Client is for client-side operation only. Therefore, server-side external procedures cannot use Instant Client libraries.

For development you can also use the Instant Client SDK.

Install from ZIP Files, from RPMs, and from Oracle Universal Installer

Oracle Instant Client can be installed in several ways.

The Instant Client libraries can be installed by either choosing the Instant Client option from Oracle Universal Installer or by downloading and installing either the ZIP files or RPMs from the OCI page on the Oracle Technology Network website: Oracle Instant Client.

Installing from the ZIP files

This section describes how to install the Instant Client from the ZIP files.

  1. Download the desired Instant Client ZIP files. All installations require a Basic or Basic Light package.
  2. Run the following command to unzip the packages into a single directory such as /opt/oracle/instantclient_19_3 that is accessible to your application:

Alternatively, run the following command to set the LD_LIBRARY_PATH environment variable prior to running the applications:

The variable can be added optionally to the configuration files such as

/.bash_profile and to the application configuration files such as /etc/sysconfig/httpd .

This is the default Oracle configuration directory for applications linked with the Instant Client.

Alternatively, Oracle configuration files can be placed in another accessible directory and then set the environment variable TNS_ADMIN to that directory name.

Installing from the RPM files

This section describes how to install the Instant Client from the RPM files.

  1. Download the desired Instant Client RPM files. All installations require a Basic or Basic Light package.
  2. Run the following command to install the packages with yum :

Starting from version 19.3, by default only one version of the Instant Client RPM libraries can be installed at a time.

For Instant Client 19.3 RPM packages, these commands are run automatically.

Alternatively, run the following command to set the LD_LIBRARY_PATH environment variable prior to running the applications:

The variable can optionally be added to configuration files such as

/.bash_profile and to the application configuration files such as /etc/sysconfig/httpd .

This is the default Oracle configuration directory for applications linked with the Instant Client.

Alternatively, Oracle configuration files can be placed in another accessible directory and then set the environment variable TNS_ADMIN to that directory name.

Installing from the Oracle Universal Installer

This section describes how to install Oracle Instant Client from the Oracle Universal Installer.

For installing Instant Client from Oracle Universal Installer , invoke the Oracle Universal Installer, select the Instant Client option and then install the Instant Client shared libraries to an empty directory, such as instantclient_19_3 , for Oracle Database release 19c, version 19.3.

See Steps 5 and 6 in Installing from the ZIP files about setting the environment variables.

If you did a complete client installation (by choosing the Admin option in Oracle Universal Installer), the locations of the Instant Client shared libraries in a full client installation are:

On Linux or UNIX:

libociei.so library is in $ORACLE_HOME/instantclient

libclntsh.so.19.1 , libclntshcore.so.19.1 , and libnnz19.so are in $ORACLE_HOME/lib

oraociei19.dll library is in ORACLE_HOME\instantclient

oci.dll , ociw32.dll , and orannzsbb19.dll are in ORACLE_HOME\bin

To enable running the OCI application using Instant Client, copy the preceding libraries to a different directory and then set the operating system shared library path to locate this directory.

All the libraries must be copied from the same Oracle home and must be placed in the same directory. Co-location of symlinks to Instant Client libraries is not a substitute for physical co-location of the libraries.

There should be only one set of Oracle libraries on the operating system Library Path variable. That is, if you have multiple directories containing Instant Client libraries, then only one such directory should be on the operating system Library Path.

Similarly, if an Oracle home-based installation is performed on the same system, then you should not have ORACLE_HOME/lib and the Instant Client directory on the operating system Library Path simultaneously regardless of the order in which they appear on the Library Path. That is, either the ORACLE_HOME/lib directory (for non-Instant Client operation) or Instant Client directory (for Instant Client operation) should be on the operating system Library Path variable, but not both.

To enable other capabilities such as OCCI and JDBC OCI, you must copy a few additional files. To enable OCCI, you must install the OCCI Library ( libocci.so.19.1 on Linux or UNIX and oraocci19.dll on Windows) in the Instant Client directory. For the JDBC OCI driver, in addition to the three OCI shared libraries, you must also download OCI JDBC Library (for example libocijdbc19.so on Linux or UNIX and ocijdbc19.dll on Windows). Place all libraries in the Instant Client directory.

On hybrid platforms, such as Sparc64, to operate the JDBC OCI driver in the Instant Client mode, copy the libociei.so library from the ORACLE_HOME/instantclient32 directory to the Instant Client directory. Copy all other Sparc64 libraries needed for the JDBC OCI Instant Client from the ORACLE_HOME/lib32 directory to the Instant Client directory.

Environment Variables for Oracle Instant Client

The ORACLE_HOME environment variable no longer determines the location of NLS, CORE, and error message files.

An OCI-only application should not require ORACLE_HOME to be set. However, if it is set, it does not affect OCI. OCI always obtains its data from the Data Shared Library. If the Data Shared Library is not available, only then is ORACLE_HOME used and a full client installation is assumed. Though ORACLE_HOME is not required to be set, if it is set, then it must be set to a valid operating system path name that identifies a directory.

If Dynamic User callback libraries are to be loaded, then as this guide specifies, the callback package must reside in ORACLE_HOME/lib ( ORACLE_HOME\bin on Windows). Set ORACLE_HOME in this case.

Environment variables ORA_NLS10 and ORA_NLS_PROFILE33 are ignored in the Instant Client mode.

Beginning with Oracle Database 12 c Release 2 (12.2), when using Instant Client libraries, the Instant Client can use the ORA_TZFILE environment variable to read the time zone file from the file system when this environment variable is set. Otherwise, if the ORA_TZFILE variable is not set, then the larger, default, timezlrg_ n .dat file from the Data Shared Library is used. If the smaller timezone_ n .dat file is to be used from the Data Shared Library, then set the ORA_TZFILE environment variable to the name of the file without any absolute or relative path names. The file must be copied to subdirectory oracore/zoneinfo for (UNIX/LINUX) or oracore\zoneinfo for (Microsoft Windows) in the instant client directory. You can use the genezi utility with the -v option to verify that the time zone file and location is valid or run SQL*Plus.

On Linux or UNIX:

In these examples, n is the time zone data file version number.

Be sure to create subdirectory oracore/zoneinfo for (UNIX/LINUX) or subdirectory oracore\zoneinfo for (Microsoft Windows) where oracoei or oraociicus DLL’s are located (typically in the instantclient_12_2 directory) and copy the timezone_ n .dat file to this directory.

To determine the versions of small and large time zone files that are packaged in the Instant Client Data Shared Library, enter the following command to run the genezi utility:

If OCI is not operating in the Instant Client mode (because the Data Shared Library is not available), then ORA_TZFILE variable, if set, names a complete path name as it does in previous Oracle Database releases.

If TNSNAMES local naming parameters are used, then, as mentioned earlier, TNS_ADMIN directory must contain the TNSNAMES configuration files. If TNS_ADMIN is not set, then the ORACLE_HOME/network/admin directory must contain Oracle Net Services configuration files.

Database Connection Strings for Oracle Instant Client

All Oracle Net naming methods that do not require use of ORACLE_BASE_HOME , or ORACLE_HOME (to locate configuration files such as tnsnames.ora , sqlnet.ora , or oraaccess.xml ) work with the Instant Client mode.

You can use the network/admin to co-locate optional Oracle configuration files such as tnsnames.ora , sqlnet.ora , ldap.ora , or oraaccess.xml with Instant Client. Prior to release 18.1, the users had to create the network/admin directory manually.

See Database Connection Strings for complete information about database connection strings.

Oracle Database Net Services Administrator’s Guide chapter on «Configuring Naming Methods» for more about connect descriptors

SDK for Oracle Instant Client

The software development kit (SDK) is a set of development tools that allows the creation of applications can be downloaded from the Instant Client link URL on the Oracle Technology Network website:

The Instant Client SDK package has both C and C++ header files and a makefile for developing OCI and OCCI applications while in an Instant Client environment. Developed applications can be deployed in any client environment.

The SDK contains C and C++ demonstration programs.

On Windows, libraries required to link the OCI or OCCI applications are also included. Make.bat is provided to build the demos.

On UNIX or Linux, the makefile demo.mk is provided to build the demos. The instantclient_19 directory must be in the runtime library search path, for example LD_LIBRARY_PATH before linking the application. The OCI and OCCI programs require the presence of libclntsh.so and libocci.so symbolic links in the instantclient_19 directory. Beginning with Oracle Database 18c, version 18.1, Instant Client Basic and Basic Light ZIP files on Linux, Unix, and macOS now have the libclntsh and libocci symbolic links precreated.

The SDK also contains the Object Type Translator (OTT) utility and its classes to generate the application header files.

About Oracle Instant Client Light

The Instant Client Light version of Instant Client further reduces the disk space requirements of the client installation.

The size of the library has been reduced by removing error message files for languages other than English and leaving only a few supported character set definitions out of around 250.

This Instant Client Light version is geared toward applications that use either US7ASCII, WE8DEC, WE8ISO8859P1, WE8MSWIN1252, or a Unicode character set. There is no restriction on the LANGUAGE and the TERRITORY fields of the NLS_LANG setting, so the Instant Client Light operates with any language and territory settings. Because only English error messages are provided with the Instant Client Light, error messages generated on the client side, such as Net connection errors, are always reported in English, even if NLS_LANG is set to a language other than AMERICAN . Error messages generated by the database side, such as syntax errors in SQL statements, are in the selected language provided the appropriate translated message files are installed in the Oracle home of the database instance.

Источник

Читайте также:  Драйвер для epson stylus tx410 для windows 10
Оцените статью
Microsoft Windows Description for Microsoft Windows