操作系统版本:rhel5.5
Oracle客户端版本:10g64位
客户端下载地址:http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html
1、找到相应的版本,下载下面文件,并安装。
先安装basic这个,再安装其他。
安装方法:
[root@szapp01 ~]# rpm -Uvh oracle*
2、建立一个oracle用户,创建目录
[root@szapp01 ~]# groupadd oinstall
[root@szapp01 ~]# groupadd dba
[root@szapp01 ~]# groupadd oper
[root@szapp01 ~]# useradd -g oinstall -G dba,oper oracle
[root@szapp01 ~]# passwd oracle
[root@szapp01 ~]#mkdir -p /home/oracle/network/admin
[root@szapp01 ~]#chown -R oracle:oinstall /home/oracle
[root@szapp01 ~]#chmod -R 755 /home/oracle
4、将oracle服务器上面的tnsnames.ora拷贝出来,放到/home/oracle/network/admin目录下面。
[oracle@szapp01 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: #/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
ORACATT =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.27.254.4)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = oracatt)
)
)
host这里,如果没有在/etc/hosts文件里面设置别名,则将这里修改为oracle数据库服务器的ip地址
3、增加环境变量
export ORACLE_HOME=/home/oracle
export SQLPATH=/home/oracle/network/admin
#寻找tnsnames.ora路径
export TNS_ADMIN=/home/oracle/network/admin
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
export LD_LIBRARY_PATH=/usr/lib/oracle/10.2.0.4/client64/lib/:/usr/lib/oracle/11.2/client/lib:$LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_HOME:$LD_LIBRARY_PATH
增加完后,执行。
[oracle@szapp01 ~]$ . .bash_profile
4、从客户端连接到服务器。
[oracle@szapp01 ~]$ sqlplus develop/develop@//172.27.254.4/oracatt
SQL*Plus: Release 10.2.0.4.0 - Production on Mon Oct 15 16:13:25 2012
Copyright (c) 1982, 2007, 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 options
SQL>
可以看到服务器端安装的oracle11g