本文转自 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>