centos6.5安装oracle 11

step1:安装依赖包

yum -y install  gcc gcc-c++ make binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel libaio libaio-devel libgcc libstdc++ libstdc++-devel unixODBC unixODBC-devel     # 有的包可能自带的镜像没有,请自行下载安装

step2:创建用户和组

groupadd -g 200 oinstall
groupadd -g 201 dba
useradd -u 440 -g oinstall -G dba oracle
passwd oracle
id oracle

step3:修改主机名

[root@oracledb ~]# sed -i "s/HOSTNAME=localhost.localdomain/HOSTNAME=oracledb/" /etc/sysconfig/network
[root@oracledb ~]# hostname oracledb
[root@oracledb ~]# vim /etc/hosts 
192.168.1.160    oracledb

step4:/etc下的配置文件修改和环境变量

[root@oracledb ~]# vim /etc/sysctl.conf  #追加以下字段 
net.ipv4.ip_local_port_range= 9000 65500 
fs.file-max = 6815744 
kernel.shmall = 10523004 
kernel.shmmax = 6465333657 
kernel.shmmni = 4096 
kernel.sem = 250 32000 100128 
net.core.rmem_default=262144 
net.core.wmem_default=262144 
net.core.rmem_max=4194304 
net.core.wmem_max=1048576 
fs.aio-max-nr = 1048576

[root@mycentos opt]# 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
error: "net.bridge.bridge-nf-call-ip6tables" is an unknown key
error: "net.bridge.bridge-nf-call-iptables" is an unknown key
error: "net.bridge.bridge-nf-call-arptables" is an unknown key
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
error: "pv4.ip_local_port_range" is an unknown key
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100128
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576

[root@oracledb ~]# vim /etc/security/limits.conf #追加内容 
oracle  soft  nproc  2047 
oracle  hard  nproc  16384 
oracle  soft  nofile  1024 
oracle  hard  nofile  65536

[root@oracledb ~]# vim /etc/pam.d/login 
 #追加
session    required    pam_limits.so
[root@oracledb ~]# vim  /etc/bashrc  
if [ $USER == "oracle" ]; then
      if [ $SHELL == "/bin/ksh" ];then
          ulimit -p 16384 
          ulimit -n 65536 
      else
          ulimit -u 16384 -n 65536 
      fi
fi

vim /home/oracle/.bash_profile              #追加
export ORACLE_BASE=/opt/oracle/app
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=orcl

step5:创建安装相关目录

 #mkdir /opt/oracle/app -p
 #mkdir /opt/oracle/oradata
 #chmod 755 /opt/oracle/
 #chmod 755 /opt/oracle/app
 #chown oracle.oinstall -R /opt/oracle

step6:安装

*chkconfig iptables off #同时也请把selinux 永久关闭,免得安装出现问题
init 6#重启下机器,使一些配置重新加载
用root用户执行完 xhost +
再 su - oracle 切换到oracle用户,执行oracle 11 r2的安装程序即可(请去oracle官网下载oracle的包,可能是zip的包,解压完目录下会有执行程序,),因为是图形界面所以非常简单,和windows安装软件类似,注意下目录和密码等关键信息即可*

你可能感兴趣的:(数据库)