Install UNXIODBC software to connect to Oracle database

Source: Internet
Author: User
Tags driver manager odbc odbc connection oracle database installation

Install unixodbc--the following actions under root user


installation process and error handling I am a reference and reference network resources, but also combined with their own actual installation environment


First, install the UNIXODBC tool

1. Download the UnixODBC compressed package (unixodbc-2.3.4.tar.gz) and upload it to the Linux server using the SSH tool. (:http://www.unixodbc.org/)


2. Enter the following command to install:

#tar-ZXVF unixodbc-2.3.4.tar.gz--Decompression

#cd unixodbc-2.3.4--into the unpacked installation directory

#./configure--prefix=/usr/local/unixodbc-2.3.4--includedir=/usr/include--libdir=/usr/lib--bindir=/usr/bin-- sysconfdir=/etc--Configuring the unixODBC-2.3.4 software

#make--Compiling the unixODBC-2.3.4

#make install--Installation unixODBC-2.3.4

PS: When installing an application under Linux, it is common to run the script configure first, then compile the source program with make, run make install, and then run makes clean to delete some temporary files (not the last step).


Ii. ODBC Driver for Oracle database installation

1. Download, upload and install the following two RPM packages with the same version number

oracle-instantclient11.2-basic-11.2.0.1.0-1.i386.rpm

oracle-instantclient11.2-odbc-11.2.0.1.0-1.i386.rpm

: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html

#rpm-IVH oracle-instantclient11.2-basic-11.2.0.1.0-1.i386.rpm--Installation operation

#rpm-IVH oracle-instantclient11.2-odbc-11.2.0.1.0-1.i386.rpm--Installation operation

PS: Download 32-bit or 63-bit RPM package, determined by the Linux system, with UNAME-A, can view the current system model


2. Copy the/usr/lib/oracle/11.2/client/lib/* to the/usr/lib/directory--Copy the dynamic connection shared library under Oracle to the Linux system default path


3. Execute ldconfig--to load the new Oracle Dynamic Connection shared library of Linux system


4, in/usr/lib/oracle/11.2/NETwork/admin/Under the creation of file Tnsnames.ora, as follows:

ORCL =

(DESCRIPTION =

(Address_list =

(ADDRESS = (PROTOCOL = TCP) (HOST = 10.162.35.137) (PORT = 1521))

)

(Connect_data =

(service_name = ORCL)

)

)

where ORCL is an identity name, the servername entry in the configuration file Odbc.ini corresponds to it , the service_name is followed by the database name to be accessed, the host IP address of the database resides, and port is the port number.

PS: If you already have the Tnsnames.ora file, be careful to look at the configuration details.


5. Add in/etc/profile: Export tns_admin=/usr/lib/oracle/11.2/network/admin/--Configure new environment variable information


6, implementation. /etc/profile (Note the preceding period with a space after the dot) register the environment variable


Third, file configuration

The main is to modify the/etc/under the two configuration files Odbc.ini and Odbcinst.ini.

1, in the /etc/odbcinst.ini for each database driver configuration, the general format such as

[Oraclezy]

Description = ODBC for oracle--description

Driver =/usr/lib/libsqora.so.11.1--Driver

Setup =/usr/lib/liboraodbcs.so--Settings

FileUsage = 1

[ODBC]

trace=1--Tracking

debug=1--Commissioning

Pooling=no

PS: The Driver in the above configuration and Setup followed by the field, may be due to different versions, the configuration will be slightly different, to the local library name or driver name, you can first use the LS command to view.


2. Configure the ODBC interface to be invoked by the application in /etc/odbc.ini in the following format:

[Oracle]

#odbcinst. ini corresponds to the name in brackets

Driver = oraclezy

Server = 192.168.1.167 or localhost

Port = 1521

#tns的名字

ServerName = ORCL

UserID = root

Password = 123456 (based on the user registered when the Oracle database is installed)


Iv. Test Connection

After completing the above operation, execute IQSL Oracle (based on the data source name in Odbc.ini) root (user) 123456 (password)-V

That is: isql Oracle root 123456-V

This interface appears, that is, the installation configuration is successful:

+---------------------------------------+

|                            connected! |

| |

| sql-statement |

| Help [TableName] |

| Quit |

| |

+---------------------------------------+

Sql>


V. ODBC connection Oracle Database error type

1. Ora-12170:tns:connect Timeout occurred: Connection timed out, note servername and Tnsnames.ora are consistent in/etc/odbc.ini configuration file

PS: When I install, I only encounter an error:

[01000] [UnixODBC] [Driver Manager] Can ' t open lib '/usr/lib/oracle/10.2.0.4/client

/libsqora.so.10.1 ': File not Found

[ISQL] Error:could not SQLConnect

Processing method:

The reason is that libsqora.so.11.1-dependent packages are not

Reference Links: http://bbs.csdn.net/topics/390566189

1. Use the following command to view dependencies

# LDD /usr/lib/oracle/11.2/client64/lib/libsqora.so.11.1

Linux-vdso.so.1 = (0x00007fff99b1d000)

libdl.so.2 =/lib64/libdl.so.2 (0x00007fbcb52f1000)

libm.so.6 =/lib64/libm.so.6 (0x00007fbcb506c000)

libpthread.so.0 =/lib64/libpthread.so.0 (0x00007fbcb4e4f000)

Libnsl.so.1 =/lib64/libnsl.so.1 (0x00007fbcb4c36000)

libclntsh.so.11.1 =/usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1 (0x00007fbcb22c6000)

Libodbcinst.so.1 = not Found (0x00007fbcb20b5000)

libc.so.6 =/lib64/libc.so.6 (0x00007fbcb1d23000)

/lib64/ld-linux-x86-64.so.2 (0x000000393aa00000)

libnnz11.so =/usr/lib/oracle/11.2/client64/lib/libnnz11.so (0x00007fbcb1955000)

Libaio.so.1 =/lib64/libaio.so.1 (0x00007fbcb1754000)

libltdl.so.7 =/usr/lib64/libltdl.so.7 (0x00007fbcb154b000)

2, use the following command to find the location of libodbcinst.so.1

#find/-name libodbcinst*

/usr/lib64/libodbcinst.so

/usr/lib64/libodbcinst.so.2

/usr/lib64/libodbcinst.so.2.0.0

/usr/lib/libodbcinst.so

/usr/lib/libodbcinst.so.2

/usr/lib/libodbcinst.so.2.0.0

No libodbcinst.so.1, really.

3, solve the problem is the actual operation

Copy the/usr/lib64/libodbcinst.so.2 and/usr/lib/libodbcinst.so.2 separately

#cp/usr/lib/libodbcinst.so.2/usr/lib/libodbcinst.so.1

#cp/usr/lib64/libodbcinst.so.2/usr/lib64/libodbcinst.so.1

Re-run the validation command


Install UNXIODBC software to connect to Oracle database

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.