作業系統版本: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