Linux下Oracleclient(sqlplus)安装和配置1、下载rpm包
[root@node1 ~]# ls
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
...
2、安装
[root@node1 ~]# rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
<                          >>>>>>### [100%]
Updating /
linux安装数据库oracle
1:oracle-instantclient11.2-basic-11>>>>>>### [100%]
[root@node1 ~]# rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
<                          >>>>>>### [100%]
Updating /
1:oracle-instantclient11.2-sqlplus->>>>>>### [100%]
[root@node1 ~]# rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
<                          >>>>>>### [100%]
Updating /
1:oracle-instantclient11.2-devel-11>>>>>>### [100%]
[root@node1 ~]#
3、配置
[root@node1 ~]# mkdir -p /usr/lib/oracle/11.2/client64/network/admin
[root@node1 ~]# vim /usr/lib/oracle/11.2/client64/network/a
[root@node1 ~]# cat /usr/lib/oracle/11.2/client64/network/a
TPADCTEST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.81)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = TPADC)
)
)
[root@node1 ~]#
[root@node1 ~]# vi ~/.bashrc
增加⼏⾏
export  ORACLE_HOME=/usr/lib/oracle/11.2/client64
export  TNS_ADMIN=$ORACLE_HOME/network/admin
export  LD_LIBRARY_PATH=$ORACLE_HOME/lib
export  PATH=$ORACLE_HOME/bin:$PATH
export  NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
[root@node1 ~]# source ~/.bashrc
4、运⾏SQLPlus
[root@node1 ~]# sqlplus
SQL*Plus: Release11.2.0.4.0 Production on Tue May 2214:45:502018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Enter user-name:
[root@node1 ~]# sqlplus test/test@//192.168.1.81:1521/TPADC
SQL*Plus: Release11.2.0.4.0 Production on Tue May 2214:46:212018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
5、Linux环境下Oracle SqlPlus中⽅向键问题的解决⽅法
(1)问题
SQL> ^[[A^[[A^[[B
(2)安装readline-devel
[root@node1 ~]# yum install readline-devel
(3)下载rlwrap
[root@node1 ~]# rpm -ivh rlwrap-0.42-1.1.x86_64.rpm
warning: rlwrap-0.42-1.1.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 93680782:                           >>>>>>### [100%]
Updating /
1:rlwrap-0.42-1.1                  >>>>>>### [100%]
[root@node1 ~]#
(4)运⾏sqlplus
[root@node1 ~]# rlwrap sqlplus test/test@//192.168.1.81:1521/TPADC
SQL*Plus: Release11.2.0.4.0 Production on Tue May 2215:00:182018
Copyright (c) 1982, 2013, Oracle.  All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
(5)别名
alias sqlplus=’rlwrap sqlplus’
alias rman=’rlwrap rman

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。

发表评论