如何在linux下以RPM安装Oracle 客户端
1个回答
2017-06-06
展开全部
以root用户安装
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配置
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
设置好环境变量需要重启机器!
创建配置文件
在ORACLE_HOME目录下创建以下目录network/admin,并创建文件tnsnames.ora,内容如下:
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)))测试
到ORACLE_HOME/bin目录下,执行命令:
[yleesun@centos bin]$ ./sqlplus zxd/zxd@111
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL测试成功!注:
如果出现以下错误:
说明环境变量没有生效!
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配置
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
设置好环境变量需要重启机器!
创建配置文件
在ORACLE_HOME目录下创建以下目录network/admin,并创建文件tnsnames.ora,内容如下:
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)))测试
到ORACLE_HOME/bin目录下,执行命令:
[yleesun@centos bin]$ ./sqlplus zxd/zxd@111
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL测试成功!注:
如果出现以下错误:
说明环境变量没有生效!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询