Home > Database > Mysql Tutorial > Linux上如何安装sqlplus客户端

Linux上如何安装sqlplus客户端

WBOY
Release: 2016-06-07 14:59:22
Original
2604 people have browsed it

Linux上如何安装sqlplus客户端 1.首先到Oracle的官方网站下载两个包: oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm o

Linux上如何安装sqlplus客户端

1.首先到Oracle的官方网站下载两个包:

oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm

oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm

2.安装软件包

a)RedHat/CentOS直接rpm安装。

rpm -ivh oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm
 
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm

b)由于是rpm包,在Debian/Ubuntu下先将其转成deb包:

alien oracle-instantclient11.2-basic-11.2.0.2.0.x86_64.rpm

alien oracle-instantclient11.2-sqlplus-11.2.0.2.0.x86_64.rpm

得到

oracle-instantclient11.2-basic-11.2.0.2.0-2_amd64.deb

oracle-instantclient11.2-sqlplus-11.2.0.2.0-2_amd64.deb

然后dpkg安装

dpkg -i oracle-instantclient11.2-basic-11.2.0.2.0-2_amd64.deb

dpkg -i oracle-instantclient11.2-basic-11.2.0.2.0-2_amd64.deb

这样会安装在默认的目录下——/usr/lib/oracle/11.2/client64/

4.安装完成之后,还需要暴露一些环境变量

nano /etc/profile

在最后加上:

export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export TNS_ADMIN=$ORACLE_HOME
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib

5.配置TNS连接文件。

cd /usr/lib/oracle/11.2/client64/
vi tnsnames.ora
 
TEST=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.109)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME=orcl )
    )
  )

6.执行sqlplus,如出现找不到包libaio,到这里下载并安装。

同样的道理Redhat/CentOS直接rpm安装,Debian/Ubuntu转成.deb包后安装。

wget ftp://mirror.switch.ch/pool/3/mirror/centos/4.8/os/x86_64/CentOS/RPMS/libaio-0.3.105-2.x86_64.rpm

6.再执行sqlplus,如果仍然有错,则reboot试试应该就OK了。

sqlplus system/123456@test

Oracle学习笔记:sqlplus用户登录

sqlplus登录Oracle时ORA-01017: invalid username/password; logon denied的错误 

在CentOS 6.4下安装Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虚拟机中安装步骤

Debian 下 安装 Oracle 11g XE R2

本文永久更新链接地址

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template