rac 节点规划

    节点 主机名 pulic ip vip private ip scan ip
    rac1 rac1 192.168.5.111 192.168.5.101 10.10.10.11 192.168.5.200
    rac2 rac2 192.168.5.112 192.168.5.102 10.10.10.12

    配置系统环境:
    1.配置主机名
    2.配置IP地址

    1. nmtui

    3.同步系统时间

    1. root@rac2 ~]# ntpdate ntp.aliyun.com
    2. [root@rac1 ~]# ntpdate ntp.aliyun.com
    3. crontal -e
    4. */12 * * * * /usr/sbin/ntpdate -u ntp.aliyun.com >/dev/null ;hwclock -w

    4.添加网卡

    1. 2块网卡

    5.关闭防火墙

    1. [root@rac1 ~]# systemctl disable firewalld.service
    2. Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
    3. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
    4. [root@rac1 ~]# systemctl stop firewalld.service

    6.关闭selinux

    1. vi /etc/selinux/config
    2. SELINUX=disabled

    7.配置/etc/hosts

    1. vi /etc/hosts
    2. #Public
    3. 192.168.5.111 rac1
    4. 192.168.5.112 rac2
    5. #Virtual
    6. 192.168.5.101 rac1-vip
    7. 192.168.5.102 rac2-vip
    8. #Private
    9. 10.10.10.11 rac1-priv
    10. 10.10.10.12 rac2-priv
    11. #Scan-ip
    12. 192.168.5.200 rac-scan

    8.配置资源限制limits.conf
    vi /etc/security/limits.conf
    oracle 预配置编辑 vi /etc/security/limits.d/oracle-database-preinstall-19c.conf

    1. oracle soft nproc 2047
    2. oracle hard nproc 16384
    3. oracle soft nofile 1024
    4. oracle hard nofile 65536
    5. oracle soft stack 3145728
    6. oracle hard stack 3145728
    7. oracle soft memlock 3145728
    8. oracle hard memlock 3145728
    9. grid soft nproc 16384
    10. grid hard nproc 16384
    11. grid soft nofile 1024
    12. grid hard nofile 65536
    13. grid soft stack 10240
    14. grid hard stack 32768

    9.配置/dev/shm
    推荐配置为生产环境ram的80%

    1. df -h
    2. vi /etc/fstab
    3. tmpfs /dev/shm tmpfs defaults,size=6g 0 0
    4. mount -o remount /dev/shm

    10.配置内核参数
    使用oracle 预配置则忽略此步骤

    1. touch /etc/sysctl.d/97-oracledatabase-sysctl.conf
    2. fs.aio-max-nr = 1048576
    3. fs.file-max = 6815744
    4. kernel.shmall = 1572864
    5. kernel.shmmax = 6442450944
    6. kernel.shmmni = 4096
    7. kernel.sem = 250 32000 100 128
    8. net.ipv4.ip_local_port_range = 9000 65500
    9. net.core.rmem_default = 262144
    10. net.core.rmem_max = 4194304
    11. net.core.wmem_default = 262144
    12. net.core.wmem_max = 1048576
    13. sysctl --system(立即生效)
    14. sysctl -a|grep shmmax
    15. sysctl -a|grep shmall

    11.添加账户

    1. /usr/sbin/groupadd -g 54321 oinstall
    2. /usr/sbin/groupadd -g 54322 dba
    3. /usr/sbin/groupadd -g 54323 oper
    4. /usr/sbin/groupadd -g 54324 backupdba
    5. /usr/sbin/groupadd -g 54325 dgdba
    6. /usr/sbin/groupadd -g 54326 kmdba
    7. /usr/sbin/groupadd -g 54330 racdba
    8. /usr/sbin/groupadd -g 54327 asmdba
    9. /usr/sbin/groupadd -g 54328 asmoper
    10. /usr/sbin/groupadd -g 54329 asmadmin
    11. useradd -u 54322 -g oinstall -G dba,asmoper,asmadmin,asmdba grid
    12. useradd -u 54321 -g oinstall -G dba,oper,asmdba,asmadmin oracle
    13. passwd grid
    14. passwd oracle
    15. id oracle
    16. id grid
    17. 2个节点的用户号必须一样
    18. --------------------------------------------
    19. 预配置追加用户
    20. /usr/sbin/groupadd -g 54327 asmdba
    21. /usr/sbin/groupadd -g 54328 asmoper
    22. /usr/sbin/groupadd -g 54329 asmadmin
    23. useradd -u 54322 -g oinstall -G asmadmin,asmdba,racdba,asmoper grid
    24. /usr/sbin/usermod -g oinstall -G asmadmin,asmdba,racdba,asmoper grid
    25. /usr/sbin/usermod -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,racdba,oper oracle
    26. ---------------------------------------------------
    27. /usr/sbin/groupadd -g 54321 oinstall
    28. /usr/sbin/groupadd -g 54322 dba
    29. /usr/sbin/groupadd -g 54323 oper
    30. /usr/sbin/groupadd -g 54324 backupdba
    31. /usr/sbin/groupadd -g 54325 dgdba
    32. /usr/sbin/groupadd -g 54326 kmdba
    33. /usr/sbin/groupadd -g 54330 racdba
    34. /usr/sbin/groupadd -g 54327 asmdba
    35. /usr/sbin/groupadd -g 54328 asmoper
    36. /usr/sbin/groupadd -g 54329 asmadmin

    12.创建目录

    1. mkdir -p /opt/app/grid
    2. mkdir -p /opt/app/12.2.0.1/grid
    3. mkdir -p /opt/app/oracle/product/12.2.0.1/dbhome_1
    4. chown -R oracle:oinstall /opt
    5. chown -R grid:oinstall /opt/app/grid
    6. chown -R oracle:oinstall /opt/app/oracle
    7. chown -R grid:oinstall /opt/app/12.2.0.1
    8. chmod -R 775 /opt

    13.配置环境变量

    1. Grid Infrastructure
    2. .bash_profile
    3. export ORACLE_SID=+ASM1
    4. export ORACLE_BASE=/opt/app/grid
    5. export ORACLE_HOME=/opt/app/12.2.0.1/grid
    6. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    7. export PATH=$ORACLE_HOME/bin:$PATH
    8. export ORACLE_SID=+ASM2
    9. export ORACLE_BASE=/opt/app/grid
    10. export ORACLE_HOME=/opt/app/12.2.0.1/grid
    11. export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
    12. export PATH=$ORACLE_HOME/bin:$PATH
    13. Oracle Database
    14. .bash_profile
    15. export ORACLE_SID=racdb1
    16. export ORACLE_BASE=/opt/app/oracle
    17. export ORACLE_HOME=/opt/app/oracle/product/12.2.0.1/db_1
    18. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
    19. export PATH=$ORACLE_HOME/bin:$PATH
    20. export ORACLE_SID=racdb2
    21. export ORACLE_BASE=/opt/app/oracle
    22. export ORACLE_HOME=/opt/app/oracle/product/12.2.0.1/db_1
    23. export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
    24. export PATH=$ORACLE_HOME/bin:$PATH

    14.修改/etc/nsswitch.conf

    1. 修改行
    2. hosts: files dns myhostname
    3. hosts: files dns nis

    15.关闭透明大页
    https://www.yuque.com/yongle-okrsc/kb/abnl9t#ifioW
    16.网卡名更改

    1. /etc/sysconfig/network-scripts/ 文件夹下
    2. cp ifcfg-ens33 ifcfg-eth0
    3. 删除 uid 修改设备名和网卡名 设置规划的public ip 地址
    4. cp ifcfg-eth0 ifcfg-eth1 设置规划的private ip 地址
    5. vi /etc/sysconfig/grub 下的GRUB_COMLINE_LINUX="" 中添加 net.ifnames=0 biosdevname=0
    6. grub2-mkconfig -o /boot/grub2/grub.cfg
    7. ip addr 查看mac地址
    8. 编辑/etc/udev/rules.d/70-persistent-ipoib.rules 文件,
    9. ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="00:0c:29:0f:93:49", NAME="eth0"
    10. ACTION=="add", SUBSYSTEM=="net", DRIVERS=="?*", ATTR{type}=="32", ATTR{address}=="00:0c:29:0f:93:53", NAME="eth1"
    11. reboot

    17.禁止ntp服务

    1. centos 7
    2. systemctl stop chronyd
    3. systemctl disable chronyd
    4. centos 6 mv /etc/chrony.conf /etc/chrony.conf.bak

    18.禁止avahi-daemon服务
    avahi-daemon 服务会影响 oracle的多波通信,进而导致节点重启

    1. systemctl stop avahi-daemon.service
    2. systemctl disable avahi-daemon.service

    19.配置network文件

    1. vi /etc/sysconfig/network
    2. NOZEROCONF=yes

    20.添加共享磁盘

    21.配置共享磁盘
    vm 虚拟机2 编辑追加 vmx文件

    1. disk.locking="FALSE"
    2. scsi1:0.SharedBus="Virtual"
    3. disk.EnableUUID = "TRUE"
    4. scsi1:1.SharedBus="Virtual"
    5. /lib/udev/scsi_id -g -d /dev/sdc 查看硬盘uuid
    6. 创建99-oracle-asmdevices.rules文件
    7. touch /etc/udev/rules.d/99-oracle-asmdevices.rules
    8. 未分区
    9. 1种方式:
    10. vi /etc/udev/rules.d/99-oracle-asmdevices.rules
    11. KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29f1e44953dc3bf6bde7ff61fd1", RUN+="/bin/sh -c 'mknod /dev/asmdisk1 b $major $minor; chown grid:asmadmin /dev/asmdisk1; chmod 0660 /dev/asmdisk1'"
    12. KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29316b5d859ce2fee1ab6c622f5", RUN+="/bin/sh -c 'mknod /dev/asmdisk2 b $major $minor; chown grid:asmadmin /dev/asmdisk2; chmod 0660 /dev/asmdisk2'"
    13. 2种方式:
    14. KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29f1e44953dc3bf6bde7ff61fd1", SYMLINK+="asmdisk1", OWNER="grid", GROUP="asmadmin", MODE="0660"
    15. KERNEL=="sd*", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="36000c29316b5d859ce2fee1ab6c622f5", SYMLINK+="asmdisk2", OWNER="grid", GROUP="asmadmin", MODE="0660"
    16. emc 多路径
    17. KERNEL=="dm-*",ENV{DM_UUID}=="mpath-368ccf098002b63924885640ab7f028cb",SYMLINK+="oraocr1",OWNER="grid",GROUP="asmadmin",MODE="0660"
    18. KERNEL=="dm-*",ENV{DM_UUID}=="mpath-368ccf09800c53619469a17fd57fa1e8a",SYMLINK+="oraocr2",OWNER="grid",GROUP="asmadmin",MODE="0660"
    19. KERNEL=="dm-*",ENV{DM_UUID}=="mpath-368ccf098008c8042a8c7f47d8c9e7d06",SYMLINK+="oraocr3",OWNER="grid",GROUP="asmadmin",MODE="0660"
    20. KERNEL=="dm-*",ENV{DM_UUID}=="mpath-368ccf09800038785466f37877d4ff1f3",SYMLINK+="oraocr4",OWNER="grid",GROUP="asmadmin",MODE="0660"
    21. KERNEL=="dm-*",ENV{DM_UUID}=="mpath-368ccf098004a1e52ca193b167d7ab352",SYMLINK+="oraocr5",OWNER="grid",GROUP="asmadmin",MODE="0660"
    22. KERNEL=="dm-*",ENV{DM_UUID}=="mpath-368ccf098009bdc2a2adedd77dd1fef9e",SYMLINK+="oraarch",OWNER="grid",GROUP="asmadmin",MODE="0660"
    23. KERNEL=="dm-*",ENV{DM_UUID}=="mpath-368ccf09800b3ee2ffef4ce980c7ff1de",SYMLINK+="oradata",OWNER="grid",GROUP="asmadmin",MODE="0660"
    24. KERNEL=="dm-*",ENV{DM_UUID}=="mpath-368ccf0980034683d967bbc832279d91f",SYMLINK+="oramgmt",OWNER="grid",GROUP="asmadmin",MODE="0660"
    25. 重启UDEV:
    26. systemctl restart systemd-udevd.service
    27. udevadm control --reload-rules
    28. /sbin/udevadm trigger --type=devices --action=add
    29. /sbin/udevadm trigger --type=devices --action=change
    30. 重新安装rac 格式化硬盘
    31. mkfs -t /dev/sdb
    32. mkfs -t /dev/sdc
    33. dd if=/dev/zero of=/dev/sdc bs=1024 count=512
    34. dd if=/dev/zero of=/dev/sdb bs=1024 count=512
    35. ls /dev 查看新添加的磁盘

    22.安装cvuqdisk

    1. rpm -ivh /opt/app/12.2.0.1/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm