---
title: "ubuntu 下安装oracle客户端oracle-xe-client"
author: "hhhk"
date: "2012-12-13T16:19:08Z"
tags: []
categories: ["数据库"]
slug: "ubuntu-oracle-oracle-xe-client"
draft: false
lastmod: "2012-12-13T16:19:08Z"
id: 1747227
url: "https://hhhk.iteye.com/blog/1747227"
---

本文转自 http://os.chinaunix.net/a2009/0609/995/000000995172.shtml

 

1.环境

     Linux boisheng-laptop 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

    2.安装软件

     sudo apt-get install oracle-xe-client

     若没有wget http://download.oracle.com/otn/linux/oracle10g/xe/10201/oracle-xe-client\_10.2.0.1-1.0\_i386.deb

     sudo dpkg -i oracle-xe-client\_10.2.0.1-1.0\_i386.deb

    3.配置环境

     在~/.bash\_profile中添加(bash shell)

    export ORACLE\_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/client

    export LD\_LIBRARY\_PATH=$ORACLE\_HOME/lib:$LD\_LIBRARY\_PATH

    export TNS\_ADMIN=/usr/lib/oracle

    export PATH=$PATH:$ORACLE\_HOME:$ORACLE\_HOME/bin

    4.配置TNS

     sudo vi /usr/lib/oracle/tnsnames.ora添加连接内容，例如

    UTFCE =

     (DESCRIPTION =

     (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.42.199)(PORT = 1521))

     (CONNECT\_DATA =

     (SERVER = DEDICATED)

     (SERVICE\_NAME = utfce)

     )

     )

    4.运行sqlplus测试

     boisheng@boisheng-laptop:~$ sqlplus /nolog

    SQL\*Plus: Release 10.2.0.1.0 - Production on Tue Jun 9 16:34:29 2009

    Copyright (c) 1982, 2005, Oracle. All rights reserved.

    SQL&gt;