Configure the OCI environment in Linux

Source: Internet
Author: User
Tags automake

Configure the OCI environment in Linux

Oracle Call Interface (OCI) provides a set of Interface subroutines (functions) that can be accessed to Oracle databases) to access the Oracle database.

Required environment and software:

Automake: automake 1.11.1 (link: http://ftp.gnu.org/gnu/automake)
(If automake1.11.1 is missing when oci is compiled in other versions)

OCI: ocilib-4.1.0-gnu.tar.gz (download link: http://sourceforge.net/projects/orclib)

Compiling ocilib requires some oracle libraries and header files. if the system does not install the oracle database, you also need to download and install oracle-instantclient (download link: http://sourceforge.net/projects/orclib)

Download file:
Oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
Oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
Oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm

1. install and configure oracle-instantclient. (If you have installed an oracle database, go to step 1)

Rpm-ivh oracle-instantclient11.2-basic-11.2.0.3.0-1.x86_64.rpm
Rpm-ivh oracle-instantclient11.2-devel-11.2.0.3.0-1.x86_64.rpm
Rpm-ivh oracle-instantclient11.2-sqlplus-11.2.0.3.0-1.x86_64.rpm

(The default installation path is/usr/lib/oracle/11.2/client64. to specify the path, use the -- prefix)

Configure Environment Variables
Chmod +/etc/profile
Export ORACLE_HOME =/usr/lib/oracle/11.2/client64
Export LD_LIBRARY_PATH =/usr/lib/oracle/11.2/client64/lib:/usr/local/lib
Export ORACLE_SID = viot
Export PATH = $ PATH: $ ORACLE_HOME/bin
Source/etc/profile
Cd/usr/lib/oracle/11.2/client64/bin
Sqlplus viot/viot@192.168.1.204: 1521/viot

Show Connect:
......
Indicates that the oracle-instantclient is successfully installed (viot is the database instance on 192.168.1.204 and the user name and password are also viot)

2. Install automake 1.11.1

View automake version information

Automake -- version

If not 1.11.1, continue installation

Tar-xzvf automake 1.11.1.tar.gz
Cd automake 1.11.1
./Configure
Make
Makeinstall

3. install and configure OCI

Tar-xzvf ocilib-4.1.0-gnu.tar.gz
Cd ocilib-4.1.0
. /Configure -- with-oracle-lib-path =/usr/lib/oracle/11.2/client64/lib -- with-oracle-headers-path =/usr/include/oracle/11.2 /client64

If you have installed the oracle database, replace it with the corresponding library file and header file location, for example
. /Configure -- with-oracle-lib-path =/oracle/product/10.2.0/db_1/lib -- with-oracle-headers-path =/oracle/product/10.2.0/db_1/rdbms /public

Make
Make install

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.