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