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

Install database Oracle client under Ubuntu 16.04

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Install the Oracle database client under Ubuntu 16.04 and use the sqlplus tool to connect to the remote Oracle database.

1. Download the oracle client installation package:

Go to the official website https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html to download the three packages required below.

Oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm Oracle client base package

Oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm Oracle Development Kit

Oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm Oracle client tool sqlplus

two。 Install using alien

Download alien (alien can convert rpm format to dev format for rpm package installation):

Sudo apt-get install alien

Carry out installation

Sudo alien-I oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm

Sudo alien-I oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm

Sudo alien-I oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm

Install the required libraries:

Sudo apt-get install libaio1

3. Configure the environment

① Open / etc/ld.so.conf File

Sudo gedit / etc/ld.so.conf

Add content: / usr/lib/oracle/11.2/client64/lib/

Execute the / sbin/ldconfig command to make it effective

Sudo / sbin/ldconfig

Open the / etc/profile file

Sudo gedit / etc/profile

② adds the following environment variables

Export ORACLE_HOME=/usr/lib/oracle/11.2/client64

Export ORACLE_BASE=/usr/lib/oracle/11.2

Export LD_LIBRARY_PATH=$ {LD_LIBRARY_PATH}: $ORACLE_HOME/lib

Export PATH=$PATH:$ORACLE_HOME/bin

Execute the command source / etc/profile to make it effective

Tnsnames.ora is a configuration file that defines the various addresses needed to establish a connection to a database. If you have installed the full oracle client, the configuration file should be located in the $ORACLE_HOME\ NETWORK\ ADMIN directory. It takes the following form:

=

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (Host =) (Port =))

)

(CONNECT_DATA =

(SERVICE_NAME =)

)

)

A complete example of tnsnames.ora is as follows:

ORA11 =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = 127.0.0.1) (PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = ORA11)

)

)

Of course, if you install instant client, this file does not exist, but you can create your own tnsnames.ora and put it in a specific directory.

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