Installing the Oracle client under Ubuntu16.04

Source: Internet
Author: User
Tags virtual environment sqlplus

Install the Oracle database client under Ubuntu16.04 to connect the Django project to the Oracle database

1. Download the Oracle Client installation package:

Go to the official website http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html download the three required packages below.

Oracle-instantclient11. 2-basic-11.2. 0.4. 0-1. X86_64.rpmoracle-instantclient11. 2-devel-11.2. 0.4. 0-1. X86_64.rpmoracle-instantclient11. 2-sqlplus-11.2. 0.4. 0-1. x86_64.rpm

2. Install with Alien

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

sudo Install Alien

To install

 sudo  alien-i oracle-instantclient11.< Span style= "color: #800080;" >2 -basic-11.2 . 0.4 . 0 - sudo  alien-i oracle-instantclient11. 2 -devel-11.2 . 0.4 . 0 - sudo  alien-i oracle-instantclient11. 2 -sqlplus-11.2 . 0.4 . 0 -

To install the required libraries:

sudo Install Libaio1

3. Configuring the Environment

① Open/etc/ld.so.conf File

sudo gedit  /etc/ld. so.conf

Added content:/usr/lib/oracle/11.2/client64/lib/
Execute the/sbin/ldconfig command to make it effective

Open/etc/profile File

sudo gedit/etc/profile

② Add the following environment variables

Export oracle_home=/usr/lib/oracle/11.2/client64export oracle_base=/usr/lib/oracle/11.2  export Ld_library_path=${ld_library_path}: $ORACLE _home/libexport PATH= $PATH: $ORACLE _home/ Bin

Execute command source/etc/profile to make it effective

4.Django connects to Oracle and requires library cx_oracle.

In the virtual environment used by the Django project, install the Cx_oracle

Install cx_oracle-5.2. 1

At this point, Django can successfully connect to the Oracle database.

  

Installing the Oracle client under Ubuntu16.04

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.