Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install oracle client in CentOS8 system

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to install Oracle client in CentOS8? In response to this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more small partners who want to solve this problem find a simpler and easier way.

Oracle32-bit client installation

First of all uname -a

Linux localhost.localdomain 4.18.0-80.el8.x86_64 #1 SMP Tue Jun 409:19:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/redhat-release

CentOS Linux release 8.0.1905 (Core)

You can see that my computer is 64 bit, the system version is CentOS8, however the server oracle database is 32 bit, so I first thought of installing 32 bit oracle client.

Enter oracle official website to download

oracle-instantclient19.5-basic-19.5.0.0.0-1.i386.rpmoracle-instantclient19.5-sqlplus-19.5.0.0.0-1.i386.rpmoracle-instantclient19.5-devel-19.5.0.0 -1.i386.rpm

rpm format package details

oracle-instantclient19.5-basic-19.5.0.0 -1.i386.rpm-basic package, in order to run OCI, OCCI, JDBC-OCI these applications;oracle-instantclient19.5-sqlplus-19.5.0.0 -1.i386.rpm-supplementary package/file, is to run sql*plus instant client; oracle-instantclient19.5-devel-19.5.0.0 -1.i386.rpm-Contains header files and sample files for developing instant clients for Oracle applications;oracle-instantclient19.5-odbc-19.5.0.0 -1.i386.rpm-Supplemental packages/files for additional libraries for running ODBC environments; oracle-instantclient19.5-jdbc-19.5.0.0.0-1.i386.rpm-Supplements XA, international standards, rowset operations under JDBC;

sequentially mounted

rpm -ivh oracle-instantclient19.5-basic-19.5.0.0.0-1.i386.rpmrpm -ivh oracle-instantclient19.5-sqlplus-19.5.0.0.0-1.i386.rpmrpm -ivh oracle-instantclient19.5-devel-19.5.0.0.0-1.i386.rpm

By default, installed files are placed in two locations:

Header file: /usr/include/oracle/19.5/client/, if you can't find the header file when you use it, remember to see if the path is this.

Package file: under/usr/lib/oracle/19.5/client/, containing {bin, lib} two folders;

Create listening files and add content

vim /usr/lib/oracle/19.5/client/lib/network/admin/tnsnames.oraORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = *IP*)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = *SID*) ) )

Here I want to connect the company's oracle server, so it is directly copied under the server tnsname.ora file into admin can be

Configure the environment variable vim /etc/profile, add

#oracle19.5export ORACLE_BASE=/usr/lib/oracle/19.5export ORACLE_VERSION=19.5export ORACLE_HOME=/usr/lib/oracle/$ORACLE_VERSION/clientexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATHexport SQLPATH=$ORACLE_HOME/lib/network/adminexport TNS_ADMIN=$ORACLE_HOME/lib/network/adminexport NLS_LANG=AMERICAN_AMERICA.AL32UTF8#export NLS_LANG="Simplified Chinese_china".ZHS16GBKexport PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

After configuration is saved

source /etc/profile

The configuration takes effect immediately

Then connect to the database test

sqlplus /nolog

Embarrassed, prompt:

bash: /bin/sqlplus: No such file or directory

Ubuntu 14.04 Oracle 11g 64-bit database installation tutorial

honestly uninstall and reload 64 bit ow T_T

Oracle64 bit client installation

Let's see what's installed first.

rpm -qa | grep oracle

Found three lambs to be slaughtered.

oracle-instantclient19.5-sqlplus-19.5.0.0.0-1.i386oracle-instantclient19.5-basic-19.5.0.0.0-1.i386oracle-instantclient19.5-devel-19.5.0.0.0-1.i386

Considering that there may be a dependency relationship between the three, rpm -e is not strong enough, so directly add-nodeps, simple and rude

rpm -e --nodeps oracle-instantclient19.5-sqlplus-19.5.0.0.0-1.i386rpm -e --nodeps oracle-instantclient19.5-basic-19.5.0.0.0-1.i386rpm -e --nodeps oracle-instantclient19.5-devel-19.5.0.0.0-1.i386

Then the old routine, download 64-bit package: oracle official website download

oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpmoracle-instantclient19.5-sqlplus-19.5.0.0.0-1.x86_64.rpmoracle-instantclient19.5-devel-19.5.0.0.0-1.x86_64.rpm

installation

rpm -ivh oracle-instantclient19.5-basic-19.5.0.0.0-1.x86_64.rpmrpm -ivh oracle-instantclient19.5-sqlplus-19.5.0.0.0-1.x86_64.rpmrpm -ivh oracle-instantclient19.5-devel-19.5.0.0.0-1.x86_64.rpm

Create a listening file and add content. There are 64~ more clients after 19.5 here.

vim /usr/lib/oracle/19.5/client64/lib/network/admin/tnsnames.ora Add ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = *IP*)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = *SID*) )

Here I want to connect the company's oracle server, so it is directly copied under the server tnsname.ora file to use it

Configure the environment variable vim /etc/profile, add

#oracle19.5export ORACLE_BASE=/usr/lib/oracle/19.5export ORACLE_VERSION=19.5export ORACLE_HOME=/usr/lib/oracle/$ORACLE_VERSION/client64export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATHexport SQLPATH=$ORACLE_HOME/lib/network/adminexport TNS_ADMIN=$ORACLE_HOME/lib/network/adminexport NLS_LANG=AMERICAN_AMERICA.AL32UTF8#export NLS_LANG="Simplified Chinese_china".ZHS16GBKexport PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin

After configuration is saved

source /etc/profile

The configuration takes effect immediately

Then connect to the database test

sqlplus /nologsqlplus: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory

Why did you report it wrong again? Is it easy for me? 555~

You can see that the wrong keyword is libnsl.so.1, biying ~

It turned out to be a missing library file

Install library packages here

dnf install libnsl

re-input

sqlplus /nologSQL*Plus: Release 19.0.0.0.0 - Production on Sat Dec 28 14:21:33 2019Version 19.5.0.0.0Copyright (c) 1982, 2019, Oracle. All rights reserved.SQL>

To prove that the installation has been successful, remote connections can be made in the following forms:

sqlplus scott/123456:192.168.111.111:1521/orcl

Logically speaking, I can now connect to Oracle database, but it is not that simple... Prompt after entering the connection command:

ERROR:

ORA-12170: TNS:Connect timeout occurred

As usual, biying ~

ORA-12170:TNS connect timeout occurred

Sure enough, ping did not work on the server.

The following is to contact the network management to fight a meal

~-------------------------------------

After ping the network, connect as follows

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

About how to install oracle client in CentOS8 system, the answer to the problem is shared here, I hope the above content can be of some help to everyone, if you still have a lot of doubts, you can pay attention to the industry information channel to learn more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report