Connect to the Oracle database without installing the Oracle client in Linux

Source: Internet
Author: User

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 --------------------------------------

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.