Linux环境下oracle client安装和配置
作者:网络转载 发布时间:[ 2014/1/15 14:03:28 ] 推荐标签:Linux oracle
oracle客户端的安装是非常简单的,关键在tns配置,我这里使用的rpm安装包,oracle本身不是开源,那使用rpm安装时简单的。
1.要远程使用oracle,先下载下面三个文件,注意版本好一致。
oracle-instantclient-basic-10.2.0.4-1.i386.rpm
oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm
oracle-instantclient-devel-10.2.0.4-1.i386.rpm
2.PM安装
oracle-instantclient-basic-10.2.0.4-1.i386.rpm是基本的动态库、jar包,默认安装路径是:/usr/lib/oracle/10.2.0.4/client
oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm是客户端sqlplus安装包, 默认安装路径是:/usr/lib/oracle/10.2.0.4/client
oracle-instantclient-devel-10.2.0.4-1.i386.rpm是api接口文件,默认安装路径是:/usr/include/oracle/10.2.0.4/client
这里不需要修改默认路径,直接安装即可:
sudo rpm-avi oracle-instantclient-basic-10.2.0.4-1.i386.rpm
sudo rpm-avi oracle-instantclient-sqlplus-10.2.0.4-1.i386.rpm
sudo rpm-avi oracle-instantclient-devel-10.2.0.4-1.i386.rpm
3.配置环境变量
vi /etc/profile
export ORACLE_HOME=/usr/lib/oracle/10.2.0.4
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
exportLD_LIBRARY_PATH=$ORACLE_HOME/client/lib:$LD_LIBRARY_PATH
exportOCI_HEADERS_HOME=/usr/include/oracle/10.2.0.4/client
export OCI_LIBS_HOME=$ORACLE_HOME/client/lib
后面两项是为了我们的程序程序编译时使用方便,编译时直接加入选项:
-I$( OCI_HEADERS_HOME) –L$( OCI_LIBS_HOME) –l occi
4.配置监听器和网络环境
[huangxw@ubuntu admin]$
cat/usr/lib/oracle/10.2.0.4/network/admin/tnsnames.ora
test_base=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = *.*.*.*)(PORT = ****))
)
(CONNECT_DATA =
(SERVICE_NAME = tt4adol)
)
)
5.测试连接
[huangxw@ubuntu bin]$./sqlplus USERNAME/PASSWD@test_base
SQL*Plus: Release 10.2.0.4.0 - Production onMon Jan 13 10:09:31 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining andReal Application Testing options
SQL> select * from USERNAME.TABLENAME where accountid = 8401428;
ACCOUNTID INVTA SNDA RAINA INSB SPEN REMN
---------- ---------- ---------- -------------------- ---------- ----------
INVTC SPDC REIN
---------- ---------- ----------
8401428 0 0 100000 0 0 0
0 0 0
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11