Connect to the Oracle database without installing the Oracle client in Linux
Connect to the Oracle database without installing the Oracle client in Linux
1. mkdir-p/opt/oracle
2. cd/opt/oracle
3. Go to the oracle official website to download the following three packages (preferably the corresponding version of orcale server)
Then upload to the/opt/oracle directory
Oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.zip
Oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.x86_64.zip
Oracle-instantclient11.2-sdk-11.2.0.1.0-1.x86_64.zip
The official address is as follows:
Http://www.oracle.com/technetwork/topics/linuxsoft-082809.html (32 bits)
Http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html (64 bits)
An oracle account is required for downloading. If not, register one for free.
4. copy and paste the following content to install. sh.
#! /Bin/bash
# Author loopeelee
Yum install-y libaio *
# If this package is not installed, the following error will be reported during connection:
#/Opt/oracle/lib/sqlplus: error while loading shared libraries: libaio. so.1: cannot open shared object file: No such file or directory
Cd/opt/oracle
Unzip oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.zip>/dev/null 2> & 1
Unzip oracle-instantclient11.2-sqlplus-11.2.0.1.0-1.x86_64.zip>/dev/null 2> & 1
Mv instantclient_11_2/lib
Unzip oracle-instantclient11.2-sdk-11.2.0.1.0-1.x86_64.zip>/dev/null 2> & 1
Mv instantclient_11_2/sdk
Mkdir-p/opt/oracle/network/admin
Cd/opt/oracle/network/admin
# The following HOST = and SERVICE_NAME = must be modified based on their own values
Echo 'wc sracdb =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.22.8) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = uerdb)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC1 ))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
) '> Tnsnames. ora
Echo 'export ORACLE_HOME =/opt/oracle
Export LD_LIBRARY_PATH =/opt/oracle/lib '>/etc/profile
Echo "Done"
5. chmod u + x install. sh
6../install. sh
7. Make the environment variable take effect immediately
Source/etc/profile
Or it is better to directly execute the following two commands:
Export ORACLE_HOME =/opt/oracle
Export LD_LIBRARY_PATH =/opt/oracle/lib
8. test:
/Opt/oracle/lib/sqlplus
You can also/opt/oracle/lib/sqlplus user/password @ wcsracdb
-------------------------------------- Split line --------------------------------------
Rlwrap
SQLPLUS spool to dynamic Log File Name
Oracle SQLPLUS prompt settings
Accelerate SQL return by setting SQLPLUS ARRAYSIZE (row prefetch)
PL/SQL Developer Practical Skills
-------------------------------------- Split line --------------------------------------