Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use instantclient to connect to an oracle database

Shulou Source: shulou.com Published: 2022-05-31 18:32:08 10月02日 Update

This article focuses on "how to use instantclient to connect to oracle database", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to connect to an oracle database using instantclient.

Many times when you connect to oracle, you don't want to install the client, so you can connect with instantclient.

Download address. This is for the linux x86 platform.

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

It is subdivided into many packages, as follows:

Instant client Package-Basic all the files needed to run OCI,OCCI and JDBC-OCI applications.

Instant client Package-Basic Lite: contains only English error messages and only supports unicode,ascii, Western European character set.

Instant client Package-JDBC Supplement adds xa, internationalization and RowSet operations to jdbc.

Instant Client Package-SQL * Plus contains sqlplus and required library files.

Instant client Package-SDK uses Instant Client to develop header files and sample makefile for Oracle applications.

Instant client package-the libraries that ODBC needs when using odbc, not available on all platforms.

You must choose between Basic and Basic Lite, and the other packages are optional.

I downloaded Basic, SQL * Plus and put it in a folder, create the file tnsnames.ora in this folder, set the environment variables LD_LIBRARY_PATH and TNS_ADMIN to point to the unzipped directory, and you can use sqlplus.

Examples of environment variables:

[root@demoserver] # more .bash _ profile# .bash _ profile# Get the aliases and functionsif [- f ~ / .bashrc]; then. ~ / .bashrcfi # User specific environment and startup programsPATH=$PATH:$HOME/binexport PATHTNS_ADMIN=/root/instantclient_11_2LD_LIBRARY_PATH=/root/instantclient_11_2export TNS_ADMINexport LD_LIBRARY_PATH

Note:

First, Instant Client does not include tnsping,exp/imp,rman, netca and other tools; if you need these tools, you need to install oracle client.

Second, you don't need oracle users, you can just use root users.

At this point, I believe you have a deeper understanding of "how to use instantclient to connect to an oracle database". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Files data databases content variables tools platforms applications folders environment users programs learning applications practical deeper two examples information interests Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi Redmi Microsoft vpn MySQL