1、安装必要的rpm
yum install binutils compat-libstdc++ elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel glibc-headers gcc gcc-c++ libaio libaio-devel libgcc libstdc++ libstdc++-devel make numactl-devel sysstat
2、修改内核参数 limits
vim /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
3、修改内核参数 sysctl
vim /etc/sysctl.conf
kernel.shmmax = 4294967295
kernel.shmmni = 4096
kernel.shmall = 268435456
kernel.sem = 250 32000 100 128
fs.file-max = 6815744
net.ipv4.ip_local_port_range = 1024 65500
net.core.rmem_default = 4194304
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
4、让内核生效
/sbin/sysctl -p
5、添加用户和组
groupadd dba
groupadd oinstall
useradd -g oinstall -G dba oracle
6、修改profile
vim /etc/profile
在尾部加入
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
7、建目录
mkdir -p /u01/app/oracle /u01/tmp
chown -R oracle:oinstall /u01/app/oracle /u01/tmp
chmod -R 775 /u01/app
chmod -R 777 /u01/tmp
8、编辑oracle用户配置文件
vim /home/oracle/.bash_profile
umask 022
TMP=/u01/tmp
TMPDIR=/u01/tmp
export TMP TMPDIR
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export LANG=en_US
9、解压缩安装文件
tar zxvf oracle11gr2.tar.gz
chown -R oracle:oinstall database
10、开始安装
xhost +
su - oracle
./runInstaller
11、安装完毕执行
在root用户下执行
/u01/app/oracle/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/dbhome_1/root.sh