• ORACLE 11.2.0.4 RAC安装在rhel6上


    1. 关闭ipv4防火墙(两个节点):
    [root@RAC01 ~]# service iptables stop
    [root@RAC01 ~]# service iptables status
    iptables: Firewall is not running.
    
    2. 关闭ipv6防火墙(两个节点)
    [root@RAC01 ~]# service ip6tables stop
    [root@RAC01 ~]# service ip6tables status
    ip6tables: Firewall is not running.
    
    3. 将防火禁用,开启禁止启动(两个节点)
    [root@RAC01 ~]# chkconfig iptables off
    [root@RAC01 ~]# chkconfig iptables --list
    iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off
    [root@RAC01 ~]# chkconfig ip6tables off   
    [root@RAC01 ~]# chkconfig ip6tables --list
    ip6tables       0:off   1:off   2:off   3:off   4:off   5:off   6:off
    
    4. 关闭seLinux(两个节点)
    [root@RAC01 ~]# setenforce 0
    [root@RAC01 ~]# getenforce
    Permissive
    
    5. 修改/etc/selinux/config文件中如下参数,改为disabled,防止开启启动seLinux(两个节点)
    [root@RAC01 ~]# vim /etc/selinux/config
    SELINUX=disabled
    
    6. 配置yum源(两个节点)
    [root@RAC01 ~]# mkdir /mnt/rhel6
    [root@RAC01 ~]# mount /dev/cdrom /mnt/rhel6/
    mount: block device /dev/sr0 is write-protected, mounting read-only
    [root@RAC01 ~]# vi /etc/yum.repos.d/rhel-source.repo 
    [rhel-source]
    name=Rhel-Source
    baseurl=file:///mnt/rhel6
    enabled=1
    gpgcheck=0
    
    7. 添加用户和组(两个节点)两个节点用户和组的id必须相同
    [root@RAC01 ~]# groupadd -g 201 oinstall
    [root@RAC01 ~]# groupadd -g 202 dba
    [root@RAC01 ~]# useradd -m -u 203 -g oinstall -G dba -d /home/grid -s /bin/bash grid      
    [root@RAC01 ~]# useradd -m -u 202 -g oinstall -G dba -d /home/oracle -s /bin/bash oracle
    [root@RAC01 ~]# id oracle
    uid=202(oracle) gid=201(oinstall) groups=201(oinstall),202(dba)
    [root@RAC01 ~]# id grid
    uid=203(grid) gid=201(oinstall) groups=201(oinstall),202(dba)
    [root@RAC01 ~]# passwd oracle
    [root@RAC01 ~]# passwd grid
    [root@RAC01 ~]# id nobody
    uid=99(nobody) gid=99(nobody) groups=99(nobody)
    
    8. 配置/etc/scsi_id.config文件,如果没有,添加该文件(两个节点)
    [root@RAC01 ~]# vi /etc/scsi_id.config
    options=--whitelisted --replace-whitespace
    
    9. 查看磁盘挂载情况(两个节点)
    [root@RAC01 ~]# fdisk -l
    
    10. 查看磁盘uuid(两个节点)
    [root@RAC01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdb
    1ATA_VBOX_HARDDISK_VB9c35185d-71839d24
    [root@RAC01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdc
    1ATA_VBOX_HARDDISK_VB877f7039-af2e1093
    [root@RAC01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdd
    1ATA_VBOX_HARDDISK_VBb7f2953b-98c4b5b0
    [root@RAC01 ~]# scsi_id --whitelisted --replace-whitespace --device=/dev/sde
    1ATA_VBOX_HARDDISK_VB14675203-e79b1889
    
    11. 添加配置文件,使用udev进行绑定
    [root@RAC01 ~]# vi /etc/udev/rules.d/99-oracle-asmdevices.rules
    KERNEL=="sd*",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB9c35185d-71839d24",NAME="asm-disk1",OWNER="oracle",GROUP="oinstall",MODE="0660"
    KERNEL=="sd*",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB877f7039-af2e1093",NAME="asm-disk2",OWNER="oracle",GROUP="oinstall",MODE="0660"
    KERNEL=="sd*",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VBb7f2953b-98c4b5b0",NAME="asm-disk3",OWNER="oracle",GROUP="oinstall",MODE="0660"
    KERNEL=="sd*",SUBSYSTEM=="block",PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name",RESULT=="1ATA_VBOX_HARDDISK_VB14675203-e79b1889",NAME="asm-disk4",OWNER="oracle",GROUP="oinstall",MODE="0660"
    
    12. 将该配置文件拷贝到节点2
    [root@RAC01 ~]# scp /etc/udev/rules.d/99-oracle-asmdevices.rules 192.168.56.11:/etc/udev/rules.d/99-oracle-asmdevices.rules 
    
    13. 开启udev,查看是否生效,并查看磁盘的权限(两个节点)
    [root@RAC01 ~]# start_udev(两个节点)
    Starting udev:                                             [  OK  ]
    
    [root@RAC01 ~]# ls -l /dev/asm*
    brw-rw----. 1 oracle oinstall 8, 64 Feb  6 00:54 /dev/asm-disk1
    brw-rw----. 1 oracle oinstall 8, 32 Feb  6 01:08 /dev/asm-disk2
    brw-rw----. 1 oracle oinstall 8, 48 Feb  6 01:08 /dev/asm-disk3
    brw-rw----. 1 oracle oinstall 8, 16 Feb  6 01:08 /dev/asm-disk4
    
    14. 配置时间同步(两个节点)
    [root@RAC01 etc]# service ntpd stop
    Shutting down ntpd:                                        [  OK  ]
    [root@RAC01 etc]# service ntpd status
    ntpd is stopped
    [root@RAC01 etc]# chkconfig ntpd off
    [root@RAC01 etc]# chkconfig ntpd --list
    ntpd            0:off   1:off   2:off   3:off   4:off   5:off   6:off
    [root@RAC01 etc]# mv /etc/ntp.conf /etc/ntp.conf.bak
    [root@RAC01 etc]# rm /var/run/ntpd.pid
    
    15. 创建安装目录(两个节点)
    [root@RAC01 etc]# mkdir -p /u01/app/grid
    [root@RAC01 etc]# mkdir -p /u01/app/11.2.0/grid
    [root@RAC01 etc]# chown -R grid:oinstall /u01
    [root@RAC01 etc]# mkdir -p /u01/app/oracle
    [root@RAC01 etc]# chown oracle:oinstall /u01/app/oracle
    [root@RAC01 etc]# chmod -R 775 /u01
    
    16. 修改环境变量文件,添加如下几行(两个节点)
    [root@RAC01 etc]# su - grid
    [grid@RAC01 ~]$ vi .bash_profile 
    export ORACLE_SID=+ASM1
    export ORACLE_BASE=/u01/app/grid
    export ORACLE_HOME=/u01/app/11.2.0/grid
    export PATH=$ORACLE_HOME/bin:$PATH:/usr/local/bin/:.
    export TEMP=/tmp
    export TMP=/tmp
    export TMPDIR=/tmp
    
    17. 查看grid用户的环境变量是否生效(两个节点)
    [grid@RAC01 ~]$    exit
    [root@RAC01 etc]# su - grid
    [grid@RAC01 ~]$ echo $PATH
    /u01/app/11.2.0/grid/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/grid/bin:/usr/local/bin/:.
    
    18. 修改oracle用户的环境变量,添加如下几行(两个节点)
    [root@RAC01 etc]# su - oracle
    [oracle@RAC01 ~]$ vi .bash_profile 
    export ORACLE_SID=orcl1
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
    export ORACLE_UNQNAME=orcl
    export PATH=$ORACLE_HOME/bin:$PATH
    
    19. 查看oracle用户环境变量是否生效(两个节点)
    [oracle@RAC01 ~]$ exit
    [root@RAC01 etc]# su - oracle
    [oracle@RAC01 ~]$ echo $PATH
    /u01/app/oracle/product/11.2.0/db_1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
    
    20. 修改hosts记录,如下(两个节点)
    [root@RAC01 etc]# vi /etc/hosts
    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    192.168.56.10   RAC01
    192.168.56.11   RAC02
    192.168.56.13   RAC01-vip
    192.168.56.14   RAC02-vip
    192.168.56.15   RAC-scan
    10.0.0.10       RAC01-priv
    10.0.0.11       RAC02-priv
    
    21. 修改/etc/security/limits.conf,添加如下几行(两个节点)
    [root@RAC01 etc]# vi /etc/security/limits.conf 
    grid    soft    nproc   2047
    grid    hard    nproc   16384
    grid    soft    nofile  1024
    grid    hard    nofile  65536
    oracle  soft    nproc   2047
    oracle  hard    nproc   16384
    oracle  soft    nofile  1024
    oracle  hard    nofile  65536
    
    22. 修改/etc/pam.d/login ,添加下面一行(两个节点)
    [root@RAC01 etc]# vi /etc/pam.d/login 
    session    required     pam_limits.so
    
    23. 修改/etc/sysctl,添加下面几行(两个节点)
    [root@RAC01 etc]# vi /etc/sysctl.conf 
    fs.aio-max-nr = 1048576
    fs.file-max = 6815744
    kernel.msgmni = 4096
    kernel.msgmax = 65536
    kernel.msgmnb = 84000
    kernel.shmall = 4194304    1073741824
    kernel.shmmax = 4398046511104
    kernel.shmmni = 4096
    kernel.sem = 250 32000 100 128
    net.ipv4.ip_local_port_range = 9000 65500
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048586
    net.ipv4.tcp_wmem = 262144 262144 262144
    net.ipv4.tcp_rmem = 4194304 4194304 4194304
    
    24. 使修改生效(两个节点)
    [root@RAC01 etc]# sysctl -p
    
    25. 创建临时路径,上传安装包(单节点)
    [root@RAC01 tmp]# mkdir -p /tmp/orasoft
    
    26. 将安装包进行解压(单节点)
    [root@RAC01 tmp]# cd orasoft/
    [root@RAC01 orasoft]# ls
    p13390677_112040_Linux-x86-64_1of7.zip  p13390677_112040_Linux-x86-64_3of7.zip    p13390677_112040_Linux-x86-64_2of7.zip  pdksh-5.2.14-37.el5_8.1.i386.rpm
    [root@RAC01 orasoft]# unzip p13390677_112040_Linux-x86-64_1of7.zip 
    [root@RAC01 orasoft]# unzip p13390677_112040_Linux-x86-64_2of7.zip
    [root@RAC01 orasoft]# unzip p13390677_112040_Linux-x86-64_3of7.zip
    
    27. 安装依赖包(两个节点)
    [root@RAC01 tmp]# yum install -y binutils compat-libcap1 compat-libstdc++ gcc gcc-c++ glibc glibc-devel ksh libgcc libstdc++ libstdc++-devel libaio libaio-devel sysstat make elfutils-libelf-devel compat-libstdc++-33-3.2.3
    Complete!
    
    28. 解压完成之后,可以看到生成grid的database文件(单节点)
    [root@RAC01 orasoft]# ls
    database  grid  pdksh-5.2.14-37.el5_8.1.i386.rpm
    
    29. 安装pdksh包,首先卸载ksh包,在进行安装(两个节点)
    [root@RAC01 ~]#    rpm -e ksh
    [root@RAC01 ~]# rpm -ivh pdksh-5.2.14-37.el5_8.1.i386.rpm --nodeps
    
    30. 安装GI(单节点)
    [root@RAC01 orasoft]# export DISPLAY=192.168.56.1:0.0
    [root@RAC01 orasoft]# xhost +
    [root@RAC01 orasoft]# su - grid
    [grid@RAC01 ~]$ cd /tmp/orasoft/grid/
    [grid@RAC01 grid]$ ./runInstaller 
    [grid@RAC01 grid]$ exit
    
    
    31. 安装ORACLE(单节点)
    [root@RAC01 orasoft]# su - oracle
    [oracle@RAC01 ~]$ cd /tmp/orasoft/database/
    [oracle@RAC01 database]$ ./runInstaller 
    
    
    32. 添加ASM磁盘(单节点)
    [grid@RAC01 ~]$ asmca
    
    33. 安装数据库(单节点)
    [root@RAC01 orasoft]# su - oracle
    [oracle@RAC01 ~]$ dbca
    
    截图太懒
  • 相关阅读:
    zookeeper.Net
    转码和解码
    Node.js开发Web后台服务
    SQL Server 2012 读写分离设置
    使用C# 和Consul进行分布式系统协调
    http2
    .net core 2.1.3可能引发Could not load file or assembly XXXXX的错误
    jquery on函数和prop与attr区别
    html页面中完成查找功能
    C#匿名参数(转载too)
  • 原文地址:https://www.cnblogs.com/zx3212/p/6378354.html
Copyright © 2020-2023  润新知