2 Ways to install Oracle client on Linux

Source: Internet
Author: User
Tags mkdir install perl oracle database sqlplus

Method One, install Oracle client

Download Instant-client Installer to website

Http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
Take Redhat 32bit For example, where you choose to download instant Client for Linux x86

Then choose the version of the client you want to install, which is more appropriate for Linux under Version 10.2.0.5.
Download and install the two packages of installation basic and Devel

  code is as follows copy code
oracle-instantclien t-basic-10.2.0.5-1.i386.rpm
oracle-instantclient-devel-10.2.0.5-1.i386.rpm
RPM installation command is RPM-IVH xxx.rpm
&NBSP
After installation, execute command Whereis Oracle Echo as follows:
Oracle:/usr/lib/oracle/usr/include/oracle/usr/share/oracle
Indicates that ORACLE client has been installed in the above directory, and then configures the environment variable
 
 
At the end of/etc/profile file, add:
Export oracle_home=/usr/lib/ oracle/10.2.0.5/client/
Export ld_library_path=: $ORACLE _home/lib:/usr/local/lib: $LD _library_path:.
Export tns_admin= $ORACLE _home
Export path= $PATH: $ORACLE _home/bin:.
Execute source/etc/profile to make the configuration effective.


Method Two, install the Oracle client separately (instantclient)

1. To use Oracle remotely, download the following three files first, note that the best version is the same.

The code is as follows Copy Code
Oracle-instantclient-basic-10.2.0.4-1.i386.zip
Oracle-instantclient-devel-10.2.0.4-1.i386.zip//This is the SDK, there is no description on the filename, I hereby note
Oracle-instantclient-sqlplus-10.2.0.4-1.i386.zip

View Oracle's SQL statements, but if you can't go up, you can only ask remote Oracle administrators.
SELECT * from V$version;

Different versions, or different operating systems, please go to the official website to download, there are detailed instructions.
Http://www.oracle.com/technology/tech/oci/instantclient/index.html

2. Create three client installation directories, which can be customized, but need to be consistent when configuring environment variables.

The code is as follows Copy Code
Mkdir-p/opt/oracle/lib
Mkdir-p/OPT/ORACLE/SDK
Mkdir-p/opt/oracle/network/admin//Configure the Listener and network environment.

3. Unzip the three files downloaded above.
Unzip Oracle-instantclient-basic-10.2.0.4-1.i386.zip
Unzip Oracle-instantclient-sqlplus-10.2.0.4-1.i386.zip

Of these, the two files are extracted to the same directory under the current directory: Instantclient_10_2
CD Instantclient_10_2
Move all the files in this directory to/opt/oracle/lib.

Finally decompression Oracle-instantclient-devel-10.2.0.4-1.i386.zip to extract the file/opt/oracle/sdk


4. Configure environment variables.

  code is as follows copy code
  vi/etc/profile                   /Note that this is an environment variable for all users, and if you want to limit a user, you can only configure the user's profile.
  Add
  export oracle_home=/opt/oracle
  export ld_library_path=/opt/oracle/lib
  Security Save and exit.
  [root@localhost tmp]# source/etc/profile              //Make the configuration file take effect immediately
  [root@localhost tmp]# echo $ORACLE _home                //See if the configured environment variables are successful
  /opt/oracle   

5. Configure the Listener and network environment.
Because the Oracle database is not installed locally, you need to get three files from the directory where the Oracle database is installed.

The code is as follows Copy Code

[Root@localhost admin]# pwd
/opt/oracle/network/admin
[Root@localhost admin]# ls
Listener.ora Sqlnet.ora Tnsnames.ora//On these three files, put them in this directory

6. Edit three files

The code is as follows Copy Code

VI tnsnames.ora
  
Bossdata =
  (DESCRIPTION =
    (address = Protoc OL = TCP) (HOST =192.168.1.107) (PORT = 1521))                     //192.168.1.107  IP Address   , port number: 1521
     (Connect_data =
      (SERVER = dedicated)
      ( service_name = bossdata)                                                     // bossdata  Global Data name
   )
 )

Extproc_connection_data =
(DESCRIPTION =
(Address_list =
(address = (PROTOCOL = IPC) (KEY = EXTPROC1))
)
(Connect_data =
(SID = Plsextproc)
(presentation = RO)
)
)

VI Listener.ora
Sid_list_listener =
(Sid_list =
(Sid_desc =
(Sid_name = Plsextproc)
(Oracle_home =\opt\oracle)/Note that this was just configured $oracle_home
(program = Extproc)
)
)

LISTENER =
(Description_list =
(DESCRIPTION =
(address = (PROTOCOL = IPC) (KEY = EXTPROC1))
(address = (PROTOCOL = TCP) (HOST = 192.168.1.107) (PORT = 1521))//This is a description.
)
)


7. Completed. Test.

Cd\opt\oraclelib

[Root@localhost lib]# Sqlplus
Sqlplus:error while loading shared libraries:libsqlplus.so:cannot open Shared object file:no such file or directory

If the above problem arises, the environment variables on your behalf are not set well. Please refer to: 4th.


[Root@localhost lib]# Sqlplus System/javama@bossdata

Sql*plus:release 10.2.0.4.0-production on Sun Aug 1 12:20:08 2010

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0-production
With the partitioning, OLAP and Data Mining options

Sql>


This test client is okay, then install Perl's DBD

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.