硬件
(内存与swap分区对应表)
Available RAM Swap Space Required
256MB 3 times the size of RAM
Between 256 MB and 512 MB 2 times the size of RAM
Between 512 MB and 2 GB 1.5 times the size of RAM
Between 2 GB and 16 GB Equal to the size of RAM
More than 16 GB 16 GB
(tmp目录大小与安装模式对应表)
Installation Type Requirement for Software Files
Instant Client 221 MB
Administrator 1.5 GB
Runtime 1.10 GB
系统需要达到的参数
关闭防火墙
#service iptables stop
#chkconfig iptables off
关闭Selinux
#setenforce 0
#vim /etc/Selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
重启
需要安装的包
(在root用户下安装)
binutils-2.20.51.0.2-5.11.el6 (x86_64)
compat-libcap1-1.10-1 (x86_64)
compat-libstdc++-33-3.2.3-69.el6 (x86_64)
compat-libstdc++-33-3.2.3-69.el6.i686
gcc-4.4.4-13.el6 (x86_64)
gcc-c++-4.4.4-13.el6 (x86_64)
glibc-2.12-1.7.el6 (i686)
glibc-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6 (x86_64)
glibc-devel-2.12-1.7.el6.i686
ksh
libgcc-4.4.4-13.el6 (i686)
libgcc-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6 (x86_64)
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6 (x86_64)
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6 (x86_64)
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6 (x86_64)
libaio-devel-0.3.107-10.el6.i686
make-3.81-19.el6
sysstat-9.0.4-11.el6 (x86_64)
unixODBC-2.2.14-11.el6 (x86_64) or later
unixODBC-2.2.14-11.el6.i686 or later
unixODBC-devel-2.2.14-11.el6 (x86_64) or later
unixODBC-devel-2.2.14-11.el6.i686 or later
(如果在系统安装时就把所有的包都默认安装了,仅需要安装以下的包即可)
glibc-devel.i686
libstdc++-4.4.4-13.el6.i686
libstdc++-devel-4.4.4-13.el6.i686
libaio-0.3.107-10.el6.i686
libaio-devel-0.3.107-10.el6.i686
unixODBC-2.2.14-11.el6.i686 or later
unixODBC-devel-2.2.14-11.el6.i686 or later
创建用户和组(用root用户创建)
/usr/sbin/groupadd oinstall
/usr/sbin/groupadd dba
/usr/sbin/useradd -g oinstall -G dba oracle
(给oracle用户添加密码)
#passwd oracle
创建安装oracle客户端软件时所需要的目录
# mkdir -p /u01/app/
# chown -R oracle:oinstall /u01/app/
# chmod -R 775 /u01/app/
编辑/etc/hosts文件
#自己的IP和主机名
192.168.3.62 oraclient
#数据库的IP和实例名
192.168.3.61 orcl
以下环境都在oracle用户下执行
用户环境变量
ORACLE_BASE=/u01/app/oracle
ORACLE_SID=orcl
export ORACLE_BASE $ORACLE_SID
export ORACLE_OWNER=oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/client_1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export LANG=en_US
安装软件
1、将oracle 11.2.0.3客户端的包上传到oracle安目录下并解压
(查看软件包)
[oracle@oraclient ~]$ ls
p10404530_112030_Linux-x86-64_4of7.zip
(解压软件包)
[oracle@oraclient ~]$ unzip p10404530_112030_Linux-x86-64_4of7.zip
(查看解压的包)
[oracle@oraclient ~]$ ll
total 643788
drwxr-xr-x 6 oracle oinstall 4096 Sep 22 2011 client
-rw-r--r-- 1 oracle oinstall 659229728 Feb 5 11:30 p10404530_112030_Linux-x86-64_4of7.zip
2、开始安装软件,进入到"client"目录并执行安装命令
[oracle@oraclient ~]$ chown oracle:oinstall -R client
[oracle@oraclient ~]$ chmod 775 -R client
[oracle@oraclient ~]$ cd client/
[oracle@oraclient client]$ ./runInstaller
(在弹出的界面中选择 “Administrator(1.38GB)”-->"Next")
(在随后弹出界面中选择自己想要的语言,然后"Next")
(接下来一直选择默认就好,直到最后弹出一个界面,让执行一个脚本,到此安装完成)
3、配置Tnsname.ora
切换到oracle启用并执行netca命令
[oracle@oraclient ~]$ netca
(在弹出的界面中选择“Local Net Service Name configuration”进行配置)
(选择“Add”然后选择"Next")
(输入 orcl数据库的实例名后再选择“next”)
(这里默认TCP通信协议,点“Next”)
(输入数据库服务器的IP地址,然后一直点击 “Next”直到配置完成)
4、连接测试
[oracle@oraclient ~]$ sqlplus system/redhat@orcl
#账号 #密码 #数据库实例名
SQL*Plus: Release 11.2.0.3.0 Production on Mon Feb 5 13:04:00 2018
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>