Linux(CentOS 7.0)安装Oracle 11gR2
// 注释 # root用户 $oracle用户
1. 关闭安全措施
# chkconfig iptables off // 永久关闭防火墙
# serviceiptables stop // 暂时关闭防火墙,重启系统后会自动打开
# sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config // 关闭Selinux
2. 验证硬件
2.1 内存:
要求:内存最小1G,推荐2G或者更高。
查看命令:# grep MemTotal /proc/meminfo
2.2 Swap:
要求:
RAW
1G至2G
1.5倍
2G至16G
同RAW相等
16G以上
16G
查看命令:# grep SwapTotal /proc/meminfo
# free
3. 验证软件
3.1 操作系统
CentOS7本文按照Red Hat Enterprise Linux 6来配置。
# cat /proc/version // 查看版本
3.2 内核
On Oracle Linux 4 and Red Hat Enterprise Linux 4 2.6.9 or later
On Oracle Linux 5 Update 2 with Red Hat Compatible Kernel 2.6.18 or later
On Oracle Linux 5 Update 5 with Red Hat Compatible Kernel 2.6.18 or later
On Oracle Linux 5 Update 5 with Unbreakable Enterprise Kernel 2.6.32-100.0.19 or later
On Oracle Linux 6 2.6.32-100.28.5.el6.x86_64 or later
On Oracle Linux 6 with Red Hat Compatible Kernel 2.6.32-71.el6.x86_64 or later
On Red Hat Enterprise Linux 5 Update 2 2.6.18 or later
On Red Hat Enterprise Linux 5 Update 5 2.6.18 or later
On Red Hat Enterprise Linux 5 Update 5 with Unbreakable Enterprise Kernel 2.6.32 or later
On Red Hat Enterprise Linux 6 2.6.32-71.el6.x86_64 or later
On Red Hat Enterprise Linux 6 with Unbreakable Enterprise Kernel 2.6.32-100.28.5.el6.x86_64 or later
On Asianux Server 3 2.6.18 or later
On SUSE Linux Enterprise Server 10 2.6.16.21 or later
On SUSE Linux Enterprise Server 11 2.6.27.19 or later
# uname-r
3.3 验证需要的包:
# rpm -qa binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel elfutils-libelf-devel-static gcc gcc-c++ glibc glibc-common glibc-devel glibc-headers glibc-static kernel-headers pdksh libaio libaio-devel libgcc libgomp libstdc++ libstdc++-devel libstdc++-static make numactl-devel sysstat unixODBC unixODBC-devel // 验证命令26个包
kernel-headers-3.10.0-123.el7.x86_64
gcc-c++-4.8.2-16.el7.x86_64
numactl-devel-2.0.9-2.el7.x86_64
glibc-headers-2.17-55.el7.x86_64
glibc-common-2.17-55.el7.x86_64
binutils-2.23.52.0.1-16.el7.x86_64
unixODBC-devel-2.3.1-10.el7.x86_64
libaio-0.3.109-12.el7.x86_64
make-3.82-21.el7.x86_64
elfutils-libelf-0.158-3.el7.x86_64
elfutils-libelf-devel-0.158-3.el7.x86_64
sysstat-10.1.5-4.el7.x86_64
glibc-static-2.17-55.el7.x86_64
glibc-devel-2.17-55.el7.x86_64
glibc-2.17-55.el7.x86_64
elfutils-libelf-devel-static-0.158-3.el7.x86_64
libaio-0.3.109-12.el7.i686
gcc-4.8.2-16.el7.x86_64
libgcc-4.8.2-16.el7.i686
libstdc++-static-4.8.2-16.el7.x86_64
libaio-devel-0.3.109-12.el7.x86_64
libstdc++-4.8.2-16.el7.x86_64
libaio-devel-0.3.109-12.el7.i686
unixODBC-2.3.1-10.el7.x86_64
libstdc++-devel-4.8.2-16.el7.x86_64
compat-libstdc++-33-3.2.3-71.el7.x86_64
libgcc-4.8.2-16.el7.x86_64
libgomp-4.8.2-16.el7.x86_64
#rpm -ivh 安装包名 // 安装程序包
4. 创建组和用户
# groupadd dba
# groupadd oinstall
# useradd -m -g oinstall -G dba oracle
# passwd oracle
// 如果nobody用户不存在(id nobody命令查看),则创建:
# useradd nobody
5. 配置内核
注:配置大于系统数据需要配置更改,否则不需要配置。
要求配置:
参数
最小值
文件
命令
semmsl 50 /proc/sys/kernel/sem # /sbin/sysctl -a | grep sem shmall 2097152 /proc/sys/kernel/shmall shmmax 4294967296 /proc/sys/kernel/shmmax shmmni 4096 /proc/sys/kernel/shmmni file-max 6815744 /proc/sys/fs/file-max ip_local_port_range 9000 65500 /proc/sys/net/ipv4/ip_local_port_range 262144 /proc/sys/net/core/rmem_default 4194304 /proc/sys/net/core/rmem_max 262144 /proc/sys/net/core/wmem_default # /sbin/sysctl -a | grep wmem_default 1048576 /proc/sys/net/core/wmem_max
semmns
semopm
semmni
32000
100
128
// 最大共享内存,官方文档建议是内存的1/2
// 我的服务器是8G内存,所以为4*1024*1024*1024
// 最小值为536870912(1G内存/2)
rmem_default
rmem_max
wmem_default
wmem_max