Install the Oracle client on Ubuntu
There are a lot of graphical tools on the Ubuntu Desktop to connect to the Oracle database, such as DBeaver, but sometimes you still need to connect to the remote database through sqlplus, then you need to install the Oracle client. This document describes how to install the Oracle 12.2.0.5 client in Ubuntu.
-- Download
Http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
Note: Download the client of the corresponding version as needed.
-- Download the following rpm package
Bkjia @ bkjia :~ /Downloads $ ll *. rpm
-Rw-r -- 1 bkjia 34 M August 26 09: 40 oracle-instantclient-basic-10.2.0.5-1.x86_64.rpm
-Rw-r -- 1 bkjia 284 K August 26 09: 58 oracle-instantclient-devel-10.2.0.5-1.x86_64.rpm
-Rw-r -- 1 bkjia 776 K August 26 09: 57 oracle-instantclient-sqlplus-10.2.0.5-1.x86_64.rpm
-- Installation: alien
Bkjia @ bkjia :~ /Downloads $ sudo alien-I *. rpm
Dpkg -- no-force-overwrite-I oracle-instantclient-basic_10.2.0.5-2_amd64.deb
Selecting previusly unselected package oracle-instantclient-basic.
(Reading the database... the system currently has 309521 files and directories installed .)
Preparing to unpack oracle-instantclient-basic_10.2.0.5-2_amd64.deb...
Unpacking oracle-instantclient-basic (10.2.0.5-2 )...
Setting oracle-instantclient-basic (10.2.0.5-2 )...
Processing triggers for libc-bin (2.19-0ubuntu6. 1 )...
Dpkg -- no-force-overwrite-I oracle-instantclient-devel_10.2.0.5-2_amd64.deb
Selecting previusly unselected package oracle-instantclient-devel.
(Reading the database... the system currently has 309536 files and directories installed .)
Preparing to unpack oracle-instantclient-devel_10.2.0.5-2_amd64.deb...
Unpacking oracle-instantclient-devel (10.2.0.5-2 )...
Setting oracle-instantclient-devel (10.2.0.5-2 )...
Dpkg -- no-force-overwrite-I oracle-instantclient-sqlplus_10.2.0.5-2_amd64.deb
Selecting previusly unselected package oracle-instantclient-sqlplus.
(Reading the database... the system currently has 309579 files and directories installed .)
Preparing to unpack oracle-instantclient-sqlplus_10.2.0.5-2_amd64.deb...
Unpacking oracle-instantclient-sqlplus (10.2.0.5-2 )...
Setting oracle-instantclient-sqlplus (10.2.0.5-2 )...
Note: the installation is complete.
-- Run sqlplus
Bkjia @ bkjia:/usr/lib/oracle/10.2.0.5/client64/bin $./sqlplus
./Sqlplus: error while loading shared libraries: libsqlplus. so: cannot open shared object file: No such file or directory
Note: The lib environment variable is not added.
-- Add the following environment variables
Bkjia @ bkjia :~ $ Vim ~ /. Bashrc
# Env
Export ORACLE_HOME =/usr/lib/oracle/10.2.0.5/client64
Export PATH = $ ORACLE_HOME/bin: $ PATH
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib: $ LD_LIBRARY_PATH
-- Test again
Bkjia @ bkjia :~ $ Source. bashrc
Bkjia @ bkjia :~ $ Which sqlplus
/Usr/lib/oracle/10.2.0.5/client64/bin/sqlplus
Sqlplus username/password @ // dbhost: 1521/SID
Note: sqlplus is successfully connected to the remote oracle database. If the libaio. so.1 file is missing in this step, run the "sudo apt-get install libaio1" command.
This article permanently updates link: http://www.bkjia.com/Linux/2016-04/130447tm