日期:2014-05-16  浏览次数:20729 次

linux下Oracle11g的安装

检查系统中是否存在如下包? 如不存在要按顺序安装如下包:
rpm -qa|grep compat-db-4*
rpm -qa|grep libaio-0*
rpm -qa|grep compat-libstdc++-33-3*
rpm -qa|grep glibc-headers-2*
rpm -qa|grep glibc-devel-2*
rpm -qa|grep compat-gcc-34-3*
rpm -qa|grep compat-gcc-34-c++-3*
rpm -qa|grep libXp-1*
rpm -qa|grep openmotif-2*
rpm -qa|grep gcc-4*
rpm -qa|grep glibc-2*
rpm -qa|grep libgomp-4*
rpm -qa|grep gcc-4*


安装Oracle前提 检查安装包是否存在??????????????? 版本要求
rpm -qa|grep binutils-*????????????????????????? binutils-2.15.92.0.2-18
rpm -qa|grep compat-libstdc++-*??????? (缺失)??? compat-libstdc++-33.2.3-47.3
rpm -qa|grep elfutils-libelf-*?????????????????? elfutils-libelf-0.97-5
rpm -qa|grep elfutils-libelf-devel-*?? (缺失)??? elfutils-libelf-devel-0.97-5
rpm -qa|grep glibc-*???????????????????????????? glibc-2.3.9.4-2.19
rpm -qa|grep glibc-common-*????????????????????? glibc-common-2.3.9.4-2.19
rpm -qa|grep glibc-devel-*?????????????????????? glibc-devel-2.3.9.4-2.19
rpm -qa|grep gcc-*?????????????????????????????? gcc-3.4.5-2
rpm -qa|grep gcc-c++-*?????????????????????????? gcc-c++-3.4.5-2
rpm -qa|grep libaio-devel-*??????????? (缺失)??? libaio-devel-0.3.105-2
rpm -qa|grep libaio-*??????????????????????????? libaio-0.3.105-2
rpm -qa|grep libgcc-*??????????????????????????? libgcc-3.4.5
rpm -qa|grep libstdc++-*???????????????????????? libstdc++-3.4.5-2
rpm -qa|grep libstdc++-devel-*?????????????????? libstdc++-devel-3.4.5-2
rpm -qa|grep make-*????????????????????????????? make-3.80-5
rpm -qa|grep sysstat-*???????????????? (缺失)??? sysstat-5.0.5
rpm -qa|grep unixODBC-*??????????????? (缺失)??? unixODBC-2.2.11
rpm -qa|grep unixODBC-devel-*????????? (缺失)??? unixODBC-devel-2.2.11

如果缺失软件包 请手动安装软件包
rpm -ivh 缺失软件包

一.创建Oracle用户
# /usr/sbin/groupadd oinstall?????????????????????? //创建用户组oinstall
# /usr/sbin/groupadd dba??????????????????????????? //创建用户组dba
# /usr/sbin/useradd -m -g oinstall -G dba oracle??? //创建用户oracle
# id oracle???????????????????????????????????????? //查看用户oracle的属性

二.设置Oracle用户口令
# passwd oracle???????????????????????????????????? //设置oracle用户的口令

三.创建Oracle的安装目录
# mkdir -p /home/u01/app/oracle????????????????? //创建/u01/app/oracle目录
# chown -R oracle:oinstall /home/u01/app???? //更改目录的所有者和属组
# chmod -R 775 /home/u01/app???????????????????? //更改目录的权限
????????????????
四.更改系统的核心参数,以满足Oracle 11g的安装要求
cat >> /etc/sysctl.conf <<EOF //修改/etc/sysctl.conf文件中的核心参数
kernel.shmmni = 4096????????????? //设置kernel.shmmni参数值为4096
kernel.sem = 250 32000 100 128??? //设置kernel.sem参数值为250 32000 100 128
fs.file-max = 65536?????????????? //设置fs.file-max参数值为65536
net.ipv4.ip_local_port_range = 1024 65000 //设置net.ipv4.ip_local_port_range参数值102465000
net.core.rmem_default=4194304?? //设置net.core.rmem_default参数值为4194304
net.core.wmem_default=262144? //设置net.core.wmem_default参数值为262144
net.core.rmem_max=4194304???? //设置net.core.rmem_max参数值为4194304
net.core.wmem_max=262144????? //设置net.core.wmem_max参数值为262144
EOF
重启内核
/sbin/sysctl –p???????????????? //使更改后的内核参数生效
该命令会打印如下参数:
net.ipv4.ip_forward = 0
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.default.accept_source_route = 0
kernel.sysrq = 0
kernel.core_uses_pid = 1
net.ipv4.tcp_syncookies = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 4294967295
kernel.shmall = 268435456
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 4194304
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 262144

五:为oracle用户设置可使用的文件和进程数限制
cat >> /etc/security/limits.conf <<EOF
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
EOF
更改/etc/pam.d/login文件
cat >> /