Oracle's Instant Client

Source: Internet
Author: User

To connect to an Oracle server, the client must have an Oracle client installed, however, the normal Oracle Client installation package is large and takes a long time to-instant client

1. Download the installation package


http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html #选择对应的版本通常下载的包有: [Email Protected] ~]# ls mypackages/instantclient-basic-linux32-11.2.0.1.zip #基本的包instantclient-sdk-linux32-11.2.0.1.zip  #客户端开发程序包, such as the need to compile PHP to connect to Oracle, this is not a required package, but it is best to install it. Instantclient-sqlplus-linux32-11.2.0.1.zip #sqlplus安装包 # Decompression for i in ' ls | Xargs '; Do unzip $i; Done[[email protected] mypackages]# ls-d instantclient_11_2/#解压后生成的目录instantclient_11_2/

2. Create the installation directory

Useradd oinstalluseradd-g oinstall Oracle && echo "123456" | passwd--stdin oraclemkdir-p/opt/oraclemv/root/instantclient_11_2/opt/oraclechown-r oracle.oinstall/opt/oracle

3. Configure Environment variables

Export path= $PATH: $HOME/bin:/opt/oracle/instantclient_11_2export oracle_home=/opt/oracle/instantclient_11_2 # Home Directory Export ld_library_path=/opt/oracle/instantclient_11_2 #库文件目录export tns_admin=/opt/oracle/network/admin/# Configuration files that connect to an Oracle server can be customized [[email protected] admin]$ cat/opt/oracle/network/admin/tnsnames.ora# Tnsnames.ora Network Configuration File:/opt/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora# Generated by Oracle Configuration Tools. Myzabbix =  (DESCRIPTION = (    address_list = (      ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.56.101) (PORT = 1521)) 
   )    (Connect_data =      (service_name = Zabbix)    )  )

The following error occurred while performing the Sqlplus test connection:

[[email protected] oracle]# sqlplussqlplus:error while loading shared Libraries:libaio.so.1:cannot open Shared object file:no such file or directory# missing installation package, the workaround is as follows [[email protected] Orac le]# yum-y Install libaio[[email protected] ~]$ sqlplus zabbix/[email protected] #连接成功SQL *plus:release 11.2.  0.1.0 Production on Thu May 8 17:03:13 2014Copyright (c) 1982, D, Oracle. All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.1.0-productionwith The partitioning, OLAP, Data Minin G and Real Application testing options 
[[email protected] ~]$ sqlplus scott/[email protected]:1521/zabbixsql*plus:release 11.2.0.1.0 Production on Thu May 8 17: 05:18 2014Copyright (c) 1982, Oracle.  All rights reserved. Connected to:oracle Database 11g Enterprise Edition Release 11.2.0.1.0-productionwith The partitioning, OLAP, Data Minin Another connection method for G and Real application testing Options#sqlplus






This article from "Wave Scouring sand" blog, declined reprint!

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.