Install the oracle client in linux and the linuxoracle Client

Source: Internet
Author: User

Install the oracle client in linux and the linuxoracle Client

1. Prepare the required installation package.

Oracle-instantclient-basic-10.2.0.5-1.i386.rpm
Oracle-instantclient-devel-10.2.0.5-1.i386.rpm
Oracle-instantclient-jdbc-10.2.0.5-1.i386.rpm
Oracle-instantclient-sqlplus-10.2.0.5-1.i386.rpm

Install oracle-instantclient-basic-10.2.0.5-1.i386.rpm first, install other

2. Create users, groups, and directories

[Root @ wxcs-2 oracle] # groupadd oinstall
[Root @ wxcs-2 oracle] # groupadd dba
[Root @ wxcs-2 oracle] # useradd-g oinstall-G dba oracle
[Root @ wxcs-2 oracle] # passwd oracle
Changing password for user oracle.
New UNIX password:
Bad password: it is based on a dictionary word
Retype new UNIX password:
Passwd: all authentication tokens updated successfully.
[Root @ wxcs-2 oracle] # mkdir-p/home/oracle/network/admin
[Root @ wxcs-2 oracle] # chown-R oracle: oinstall/home/oracle
[Root @ wxcs-2 oracle] # chmod-R 755/home/oracle

3. Copy tnsnames. ora from the oracle server and put it under the/home/oracle/network/admin directory.
4. Modify Environment Variables

[Oracle @ wxcs-2 ~] $ Vi. bash_profile

Export ORACLE_HOME =/home/oracle
Export SQLPATH =/home/oracle/network/admin
Export TNS_ADMIN =/home/oracle/network/admin
Export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
Export LD_LIBRARY_PATH =/usr/lib/oracle/10.2.0.5/client/lib/:/usr/lib/oracle/10.2.0.5/client/lib: $ LD_LIBRARY_PA
TH
Export PATH = $ PATH: $ ORACLE_HOME: $ LD_LIBRARY_PATH

[Oracle @ wxcs-2 ~] $ Source. bash_profile environment variables take effect immediately

5. You can connect to the oracle server normally.

[Oracle @ wxcs-2 ~] $ Sqlplus zhgy/zhgy@192.168.4.36/orcl

 


After installing the oracle server in linux, you can also install the client

You have installed the corresponding client tool by default when installing the server, but it is also possible to install the client again.

How to install the Oracle client in linux

Install as root user
Rpm-ivh oracle-instantclient-basic-11.1.0.1-1.x86_64.rpm
Rpm-ivh oracle-instantclient-sqlplus-11.1.0.1-1.x86_64.rpm Configuration
Add vim/etc/profile
Export ORACLE_HOME =/usr/lib/oracle/11.1.0.1/client64
Export ORACLE_BASE =/usr/lib/oracle/11.1.0.1
Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib: $ LD_LIBRARY_PATH
Export NLS_LANG = AMERICAN_AMERICA.AL32UTF8
To set environment variables, restart the machine!
Create a configuration file
Create the following network/admin directory in the ORACLE_HOME directory and create the tnsnames. ora file. The content is as follows:
Vim/usr/lib/oracle/11.1.0.1/client64/network/admin/tnsnames. ora
# Tnsnames. ora Network Configuration File:/opt/oracle10g/u01/network/admin/tnsnames. ora
# Generated by Oracle configuration tools.111 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.15.111) (PORT = 1521 )))
(CONNECT_DATA =
(SERVICE_NAME = dmsdb) test
Go to the ORACLE_HOME/bin directory and run the following command:
[Yleesun @ centos bin] $./sqlplus zxd/zxd @ 111
Copyright (c) 1982,201 1, Oracle. All rights reserved.
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL test successful! Note:
If the following error occurs:
The environment variable does not take effect!

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.