合 Oracle客户端安装
下载连接
下载连接:
32位:https://www.oracle.com/database/technologies/instant-client/downloads.html
64位:https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
https://www.oracle.com/database/technologies/instant-client.html
安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | wget https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-basic-21.4.0.0.0-1.x86_64.rpm wget https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-tools-21.4.0.0.0-1.x86_64.rpm wget https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-sqlplus-21.4.0.0.0-1.x86_64.rpm wget https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-devel-21.4.0.0.0-1.x86_64.rpm wget https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-jdbc-21.4.0.0.0-1.x86_64.rpm wget https://download.oracle.com/otn_software/linux/instantclient/214000/oracle-instantclient-odbc-21.4.0.0.0-1.x86_64.rpm rpm -ivh *.rpm mkdir -p /usr/lib/oracle/21/client64/network/admin cat >> /root/.bashrc << "EOF" export ORACLE_HOME=/usr/lib/oracle/21/client64 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export PATH=$ORACLE_HOME/bin:$PATH export TNS_ADMIN=$ORACLE_HOME/network/admin EOF source /root/.bashrc cat >> /etc/profile << "EOF" export ORACLE_HOME=/usr/lib/oracle/21/client64 export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH export PATH=$ORACLE_HOME/bin:$PATH export TNS_ADMIN=$ORACLE_HOME/network/admin EOF source /etc/profile |
官方方式
参考 https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html 的末尾,如下:
Instant Client Installation for Linux x86-64 (64-bit)
For general Instant Client information, see the Home Page.
ODBC users should follow the ODBC Installation Instructions.
The "Database Client Installation Guide for Linux" chapter on Installing Oracle Instant Client is here.
Instant Client RPMs are also available without click-through from yum.oracle.com for Oracle Linux 8 and Oracle Linux 7. Older RPM packages are available for Oracle Linux 8, Oracle Linux 7 and Oracle Linux 6.
Client-server version interoperability is detailed in Doc ID 207303.1. For example, Oracle Call Interface 19.3 can connect to Oracle Database 11.2 or later. Some tools may have other restrictions.
Installation of ZIP files:
Download the desired Instant Client ZIP files. All installations require a Basic or Basic Light package.
Unzip the packages into a single directory such as
/opt/oracle/instantclient_19_3
that is accessible to your application. For example:- 12cd /opt/oracleunzip instantclient-basic-linux.x64-19.3.0.0.0dbru.zip
The various packages install into subdirectories of
/usr/lib/oracle
,/usr/include/oracle
, and/usr/share/oracle
.Prior to version 18.3, create the appropriate links for the version of Instant Client. For example:
- 123cd /opt/oracle/instantclient_12_2ln -s libclntsh.so.12.1 libclntsh.soln -s libocci.so.12.1 libocci.so
Install the operating system
libaio
package. This is calledlibaio1
on some Linux distributions. On Oracle Linux 8 prior to Instant Client 21 you also need the libnsl package.For example, on Oracle Linux, run:
sudo yum install libaio
If Instant Client is the only Oracle Software installed on this system then update the runtime link path, for example:
- 123sudo sh -c "echo /opt/oracle/instantclient_19_3 > \/etc/ld.so.conf.d/oracle-instantclient.conf"sudo ldconfig
Alternatively, set the
LD_LIBRARY_PATH
environment variable prior to running applications. For example:export LD_LIBRARY_PATH=/opt/oracle/instantclient_19_3:$LD_LIBRARY_PATH
The variable can optionally be added to configuration files such as
~/.bash_profile
and to application configuration files such as/etc/sysconfig/httpd
.If you intend to co-locate optional Oracle configuration files such as
tnsnames.ora
,sqlnet.ora
,ldap.ora
, ororaaccess.xml
with Instant Client, put them in thenetwork/admin
subdirectory. This needs to be created for 12.2 and earlier, 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_ADMIN
to that directory name.本人提供Oracle(OCP、OCM)、MySQL(OCP)、PostgreSQL(PGCA、PGCE、PGCM)等数据库的培训和考证业务,私聊QQ646634621或微信dbaup66,谢谢!