oracle basic clientinstall,各平台下oracle-instant-client安装部署

一、linux平台

1.1 方式一:Oracle Instant Client Zip

Download an Oracle 19, 18, 12, or 11.2 “Basic” or “Basic Light” zip file: 64-bitor 32-bit, matching your application 64-bit or 32-bit architecture.

Unzip the package into a directory that is accessible to your application. For example:

mkdir -p /opt/oracle

cd/opt/oracleunzip instantclient-basic-linux.x64-19.3.0.0.0dbru.zip

Install the operating system libaiopackage with sudo or as the root user. For example:

sudo yum install libaio

On some Linux distributions this package is called libaio1instead.

If there is no other Oracle software on the machine that will be impacted, permanently add Instant Client to the runtime link path. For example, with sudo or as the root user:

sudo sh -c "echo /opt/oracle/instantclient_19_3 > /etc/ld.so.conf.d/oracle-instantclient.conf"

sudo ldconfig

Alternatively, set the environment variable LD_LIBRARY_PATHto the appropriate directory for the Instant Client version. For example:

export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_3:$LD_LIBRARY_PATH

If you intend to co-locate optional Oracle configuration files such as tnsnames.ora, sqlnet.oraor oraaccess.xmlwith Instant Client, then create a network/adminsubdirectory, if it does not exist. For example:

mkdir -p /opt/oracle/instantclient_12_2/network/admin

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

Alternatively, Oracle configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMINto that directory name.

1.2 方式二:Oracle Instant Client RPM

Download an Oracle 19, 18, 12, or 11.2 “Basic” or “Basic Light” RPM: 64-bitor 32-bit, matching your application architecture.

Oracle’s yum server has

Install the downloaded RPM with sudo or as the root user. For example:

sudo yum install oracle-instantclient19.3-basic-19.3.0.0.0-1.x86_64.rpm

Yum will automatically install required dependencies, such as libaio.

Oracle Linux users can alternatively automate download and installation. For example:

yum -y install oracle-release-el7yum-config-manager --enable ol7_oracle_instantclientyum -y install oracle-instantclient19.3-basic

For Instant Client 19 RPMs, the system library search path is automatically configured during installation.

For older versions, if there is no other Oracle software on the machine that will be impacted, permanently add Instant Client to the runtime link path. For example, with sudo or as the root user:

sudo sh -c "echo /usr/lib/oracle/18.5/client64/lib > /etc/ld.so.conf.d/oracle-instantclient.conf"

sudo ldconfig

Alternatively, for version 18 and earlier, every shell will need to have the environment variable LD_LIBRARY_PATHset to the appropriate directory for the Instant Client version. For example:

export LD_LIBRARY_PATH=/usr/lib/oracle/18.5/client64/lib:$LD_LIBRARY_PATH

If you intend to co-locate optional Oracle configuration files such as tnsnames.ora, sqlnet.oraor oraaccess.xmlwith Instant Client, then create a network/adminsubdirectory under lib/, if it does not exist. For example:

sudo mkdir -p /usr/lib/oracle/12.2/client64/lib/network/admin

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

Alternatively, Oracle configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMINto that directory name.

1.3 Local Database or Full Oracle Client

ODPI-C applications can use Oracle Client 19, 18, 12, or 11.2 libraries from a local Oracle Database or full Oracle Client installation.

The libraries must be either 32-bit or 64-bit, matching your application and ODPI-C library (if one is created separately).

Set required Oracle environment variables by running the Oracle environment script. For example:

source /usr/local/bin/oraenv

For Oracle Database XE 11.2, run:

source /u01/app/oracle/product/11.2.0/xe/bin/oracle_env.sh

Optional Oracle configuration files such as tnsnames.ora, sqlnet.oraor oraaccess.xmlcan be placed in $ORACLE_HOME/network/admin.

Alternatively, Oracle configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMINto that directory name.

二、windows

ODPI-C requires Oracle Client libraries, which are found in Oracle Instant Client, or an Oracle Database installation, or in a full Oracle Client installation. The libraries must be either 32-bit or 64-bit, matching your application and ODPI-C library (if one is created separately).

On Windows, ODPI-C looks for the Oracle Client library “OCI.dll” first in the directory containing the ODPI-C library (or application), and then searches using the

Oracle Client libraries require the presence of the correct Visual Studio redistributable.

Oracle 19 needs

Oracle 18 and 12.2 need

Oracle 12.1 needs

2.1 Oracle Instant Client Zip

Download an Oracle 19, 18, 12, or 11.2 “Basic” or “Basic Light” zip file: 64-bitor 32-bit, matching your application architecture.

Note that 19c is not supported on Windows 7.

Unzip the package into a directory that is accessible to your application. For example unzip instantclient-basic-windows.x64-19.3.0.0.0dbru.zipto C:\oracle\instantclient_19_3.

Add this directory to the PATHenvironment variable. For example, on Windows 7, update PATHin Control Panel -> System -> Advanced System Settings -> Advanced -> Environment Variables -> System Variables -> PATH. The Instant Client directory must occur in PATHbefore any other Oracle directories.

Restart any open command prompt windows.

To avoid interfering with existing tools that require other Oracle Client versions, instead of updating the system-wide PATHvariable, you may prefer to write a batch file that sets PATH, for example:

REM mywrapper.bat

SET PATH=C:\oracle\instantclient_19_3;%PATH%myapp%*

Invoke this batch file everytime you want to run your application.

Alternatively use SETto change your PATHin each command prompt window before you run python.

Another option is to move the unzipped Instant Client files to the same directory as the ODPIC.DLL (or into the directory of the application’s binary, if ODPI-C is compiled into application). If you do this, then PATHdoes not need to be set.

If you intend to co-locate optional Oracle configuration files such as tnsnames.ora, sqlnet.oraor oraaccess.xmlwith Instant Client, then create a network\adminsubdirectory, if it does not exist, for example C:\oracle\instantclient_19_3\network\admin.

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

Alternatively, Oracle configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMINto that directory name.

If you wish to package Instant Client with your application, you can move the Instant Client libraries to the same directory as the ODPI-C library (or application). Refer to the Instant Client documentationfor the minimal set of Instant Client files required. There is no need to set PATH. This only works on Windows.

2.2 Local Database or Full Oracle Client

The Oracle libraries must be either 32-bit or 64-bit, matching your application and ODPI-C library (if one is created separately).

To run ODPI-C applications using client libraries from a local Oracle Database (or full Oracle Client) 19, 18, 12, or 11.2 installation:

Set the environment variable PATHto include the path that contains OCI.dll, if it is not already set. For example, on Windows 7, update PATHin Control Panel -> System -> Advanced System Settings -> Advanced -> Environment Variables -> System Variables -> PATH.

Restart any open command prompt windows.

Optional Oracle configuration files such as tnsnames.ora, sqlnet.oraor oraaccess.xmlcan be placed in the network/adminsubdirectory of the Oracle software.

Alternatively, Oracle configuration files can be put in another, accessible directory. Then set the environment variable TNS_ADMINto that directory name.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值