当前位置:   article > 正文

7.Oracle19c RAC集群安装部署

oracle19c rac

1.Oracle 19c RAC For Linux安装部署 (视频讲解)
https://edu.csdn.net/course/detail/35792

2.Oracle数据库 底层原理解析_解析oracle数据库内部实现(视频讲解)

https://edu.csdn.net/course/detail/35647

3.Oracle11gR2数据库安装
https://edu.csdn.net/course/detail/27750

4.Oracle 12c 数据库安装
https://edu.csdn.net/course/detail/35882

5.Oracle 19c 数据库一键安装
https://edu.csdn.net/course/detail/39198

6.Oracle 19c RAC For Linux安装部署 (视频讲解)
https://edu.csdn.net/course/detail/35792

7.oracle 19c 数据库基础和日常管理
https://edu.csdn.net/course/detail/36112

8.Oracle 11g DataGuard RAC集群到单节点部署
https://edu.csdn.net/course/detail/35959

9.Oracle数据库 底层原理解析_解析oracle数据库内部实现(视频讲解)
https://edu.csdn.net/course/detail/35647

10.MySQL数据库基础实战教程
https://edu.csdn.net/course/detail/26743


本章节详细介绍了Oracle19c RAC集群在Linux系统上的部署步骤。

部署环境信息


 以下安装步骤以节点1为例

1.系统配置

1.1.修改主机名

[root@localhost ~]# hostnamectl set-hostname node1

1.2.修改hosts文件

  1. vim /etc/hosts
  2. 127.0.0.1 localhost
  3. # Public ip
  4. 192.168.1.21 node1
  5. 192.168.1.22 node2
  6. # Private ip
  7. 10.0.60.21 node1-priv
  8. 10.0.60.22 node2-priv
  9. # Virture ip
  10. 192.168.1.23 node1-vip
  11. 192.168.1.24 node2-vip
  12. # Scan ip
  13. 192.168.1.25 scanip

1.3.配置服务器ip地址

  1. cd /etc/sysconfig/network-scripts
  2. [root@node1 network-scripts]# cat ifcfg-ens33
  3. TYPE=Ethernet
  4. BOOTPROTO=static
  5. NAME=ens33
  6. DEVICE=ens33
  7. ONBOOT=yes
  8. IPADDR=192.168.1.21
  9. GATEWAY=192.168.120.2
  10. NETMASK=255.255.255.0
  11. [root@node1 network-scripts]#cat ifcfg-ens34
  12. TYPE=Ethernet
  13. BOOTPROTO=static
  14. NAME=ens34
  15. DEVICE=ens34
  16. ONBOOT=yes
  17. IPADDR=10.0.60.21
  18. NETWORK=10.0.60.1
  19. NETMASK=255.255.255.0

1.4.配置yum

  1. [root@node1 ~]# > /etc/yum.repos.d/my.repo
  2. [root@node1 ~]#cat >> /etc/yum.repos.d/my.repo << EOF
  3. [Oracle]
  4. name=oracle_install
  5. baseurl=file:///mnt/
  6. gpgcheck=0
  7. enabled=1
  8. EOF

1.5.安装相关rpm包

  1. yum install -y binutils \
  2. compat-libcap1 \
  3. compat-libstdc++-33 \
  4. gcc \
  5. gcc-c++ \
  6. elfutils-libelf \
  7. elfutils-libelf-devel \
  8. glibc \
  9. glibc-devel \
  10. ksh \
  11. libaio \
  12. libaio-devel \
  13. libgcc \
  14. libstdc++ \
  15. libstdc++-devel \
  16. libxcb \
  17. libX11 \
  18. libXau \
  19. libXi \
  20. libXtst \
  21. libXrender \
  22. libXrender-devel \
  23. make \
  24. net-tools \
  25. nfs-utils \
  26. smartmontools \
  27. sysstat \
  28. e2fsprogs \
  29. e2fsprogs-libs \
  30. fontconfig-devel \
  31. expect \
  32. unzip \
  33. openssh-clients \
  34. readline* \
  35. bc
  36. yum install -y gnome*
  37. 单独上传compat-libstdc++-33,并安装
  38. rpm -ivh compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
  39. 检查rpm包安装情况
  40. rpm -q bc binutils compat-libcap1 compat-libstdc++-33 gcc gcc-c++ elfutils-libelf elfutils-libelf-devel glibc glibc-devel ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel libxcb libX11 libXau libXi libXtst libXrender libXrender-devel make net-tools nfs-utils smartmontools sysstat e2fsprogs e2fsprogs-libs fontconfig-devel expect unzip openssh-clients readline | grep "not installed"

1.6.关闭防火墙

  1. systemctl stop firewalld.service
  2. systemctl disable firewalld.service
  3. systemctl status firewalld.service
  4. vim /etc/sysconfig/selinux
  5. SELINUX=enforcing¸Ä³ÉSELINUX=disabled

1.7.配置VNC服务

  1. 在NODE1节点配置就可以
  2. yum install -y tigervnc-server tigervnc-server-module
  3. 修改配置文件
  4. cat /etc/sysconfig/vncservers
  5. cat /lib/systemd/system/vncserver\@.service
  6. cp /lib/systemd/system/vncserver\@.service /etc/systemd/system/vncserver\@:1.service
  7. > /etc/systemd/system/vncserver\@:1.service
  8. cat >> /etc/systemd/system/vncserver\@:1.service << EOF
  9. [Unit]
  10. Description=Remote desktop service (VNC)
  11. After=syslog.target network.target
  12. [Service]
  13. Type=forking
  14. User=root
  15. ExecStartPre=-/usr/bin/vncserver -kill %i
  16. ExecStart=/usr/bin/vncserver %i
  17. PIDFile=/root/.vnc/%H%i.pid
  18. ExecStop=-/usr/bin/vncserver -kill %i
  19. [Install]
  20. WantedBy=multi-user.target
  21. EOF
  22. #注:用 root 的话用把/home/root/.vnc/%H%i.pid 改为/root/.vnc/%H%i.pid
  23. 设置vnc登录密码
  24. vncpasswd
  25. 启动vnc服务
  26. systemctl daemon-reload
  27. systemctl restart vncserver@:1.service
  28. systemctl enable vncserver@:1.service
  29. ss -lnt|grep 590
  30. LISTEN 0 5 *:5901 *:*
  31. LISTEN 0 5 :::5901 :::*

1.8.修改系统内核参数

  1. cat >> /etc/sysctl.conf << EOF
  2. fs.aio-max-nr = 1048576
  3. fs.file-max = 6815744
  4. kernel.shmmni = 4096
  5. kernel.sem = 250 32000 100 128
  6. net.ipv4.ip_local_port_range = 9000 65500
  7. net.core.rmem_default = 4194304
  8. net.core.rmem_max = 4194304
  9. net.core.wmem_default = 262144
  10. net.core.wmem_max = 1048586
  11. kernel.shmall = 2359296
  12. kernel.shmmax = 9663676416
  13. EOF
  14. 使设置生效
  15. /sbin/sysctl -p

1.9.添加系统环境变量

  1. cat >> /etc/profile <<EOF
  2. if [ \$USER = "oracle" ] || [ \$USER = "grid" ]; then
  3. if [ \$SHELL = "/bin/ksh" ]; then
  4. ulimit -p 16384
  5. ulimit -n 65536
  6. else
  7. ulimit -u 16384 -n 65536
  8. fi
  9. umask 022
  10. fi
  11. EOF

10.系统资源限制配置

  1. cat >> /etc/security/limits.conf <<EOF
  2. grid soft nofile 1024
  3. grid hard nofile 65536
  4. grid soft stack 10240
  5. grid hard stack 32768
  6. grid soft nproc 2047
  7. grid hard nproc 16384
  8. oracle soft nofile 1024
  9. oracle hard nofile 65536
  10. oracle soft stack 10240
  11. oracle hard stack 32768
  12. oracle soft nproc 2047
  13. oracle hard nproc 16384
  14. oracle hard memlock 134217728
  15. oracle soft memlock 134217728
  16. EOF

1.11.添加组和用户

  1. groupadd -g 14321 oinstall
  2. groupadd -g 14322 dba
  3. groupadd -g 14323 oper
  4. groupadd -g 14324 backupdba
  5. groupadd -g 14325 dgdba
  6. groupadd -g 14326 kmdba
  7. groupadd -g 14327 asmdba
  8. groupadd -g 14328 asmoper
  9. groupadd -g 14329 asmadmin
  10. groupadd -g 14330 racdba
  11. useradd -u 1100 -g oinstall -G asmadmin,asmdba,asmoper,dba,racdba,oper grid
  12. passwd grid
  13. useradd -u 1101 -g oinstall -G asmdba,dba,backupdba,dgdba,kmdba,racdba,oper oracle
  14. passwd oracle

1.12.创建目录、授权

  1. mkdir -p /u01/app/grid
  2. mkdir -p /u01/app/19.3.0/grid
  3. chown -R grid:oinstall /u01
  4. mkdir -p /u01/app/oracle
  5. chown -R oracle:oinstall /u01/app/oracle
  6. chmod -R 775 /u01

13.添加grid用户变量

  1. su - grid
  2. [grid@node1 ~]$ vim .bash_profile
  3. #alias ls="ll -at"
  4. ORACLE_SID=+ASM1; export ORACLE_SID
  5. JAVA_HOME=/usr/local/java;export JAVA_HOME
  6. ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
  7. ORACLE_HOME=/u01/app/19.3.0/grid; export ORACLE_HOME
  8. ORACLE_PATH=/u01/app/oracle/common/oracle/sql; export ORACLE_PATH
  9. ORACLE_TERM=xterm;export ORACLE_TERM
  10. NLS_DATE_FORMAT="YYYY-MM-DD HH24:MI:SS";export NLS_DATE_FORMAT
  11. TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
  12. ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
  13. PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
  14. PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
  15. PATH=${PATH}:/u01/app/common/oracle/bin
  16. export PATH
  17. LD_LIBRARY_PATH=$ORACLE_HOME/lib
  18. LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
  19. LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
  20. export LD_LIBRARY_PATH
  21. CLASSPATH=$ORACLE_HOME/JRE
  22. CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
  23. CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
  24. CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
  25. export CLASSPATH
  26. THREADS_FLAG=native; export THREADS_FLAG
  27. export TEMP=/tmp
  28. export TMPDIR=/tmp
  29. #export NLS_LANG=american_america.ZHS16GBK
  30. #alias sqlplus="rlwrap sqlplus"
  31. umask 022

1.14.添加oracle用户变量

  1. su - oracle
  2. $ vim .bash_profile
  3. #alias ls="ll -at"
  4. ORACLE_SID=orcl1; export ORACLE_SID
  5. ORACLE_UNQNAME=orcl; export ORACLE_UNQNAME
  6. JAVA_HOME=/usr/local/java; export JAVA_HOME
  7. ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
  8. ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1; export ORACLE_HOME
  9. ORACLE_PATH=/u01/app/common/oracle/sql; export ORACLE_PATH
  10. ORACLE_TERM=xterm; export ORACLE_TERM
  11. NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"; export NLS_DATE_FORMAT
  12. TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
  13. ORA_NLS11=$ORACLE_HOME/nls/data; export ORA_NLS11
  14. PATH=.:${JAVA_HOME}/bin:${PATH}:$HOME/bin:$ORACLE_HOME/bin
  15. PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
  16. PATH=${PATH}:/u01/app/common/oracle/bin
  17. export PATH
  18. LD_LIBRARY_PATH=$ORACLE_HOME/lib
  19. LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
  20. LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
  21. export LD_LIBRARY_PATH
  22. CLASSPATH=$ORACLE_HOME/JRE
  23. CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
  24. CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
  25. CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
  26. export CLASSPATH
  27. THREADS_FLAG=native; export THREADS_FLAG
  28. export TEMP=/tmp
  29. export TMPDIR=/tmp
  30. #export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
  31. umask 022
  32. #alias sqlplus="rlwrap sqlplus"
  33. #alias rman="rlwrap rman"

1.15.禁用NTP服务

  1. 使用root用户
  2. service ntpd stop
  3. chkconfig ntpd off
  4. mv /etc/ntp.conf /etc/ntp.conf.bak

1.16.配置 RAC 节点以便可以使用 SSH 进行远程访问

  1. 验证已安装 SSH 软件
  2. [root@node1 ~]# rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n"| grep ssh
  3. openssh-askpass-4.3p2-41.el5 (x86_64)
  4. openssh-clients-4.3p2-41.el5 (x86_64)
  5. openssh-4.3p2-41.el5 (x86_64)
  6. openssh-server-4.3p2-41.el5 (x86_64)

17.配置节点互信

  1. ./sshUserSetup.sh -user grid -hosts "node1 node2" -advanced -exverify -confirm -noPromptPassphrase
  2. ./sshUserSetup.sh -user oracle -hosts "node1 node2" -advanced -exverify -confirm -noPromptPassphrase
  3. 验证节点互信
  4. su - grid
  5. ssh node1 "date;hostname"
  6. ssh node2 "date;hostname"
  7. su - oracle
  8. ssh node1 "date;hostname"
  9. ssh node2 "date;hostname"

1.18.关闭透明大页和numa

  1. sed -i 's/quiet/quiet transparent_hugepage=never numa=off/' /etc/default/grub
  2. grub2-mkconfig -o /boot/grub2/grub.cfg
  3. 重启后检查是否生效
  4. cat /sys/kernel/mm/transparent_hugepage/enabled
  5. cat /proc/cmdline

1.19.关闭avahi-daemon服务

  1. yum install -y avahi*
  2. systemctl stop avahi-daemon.socket
  3. systemctl stop avahi-daemon.service
  4. pgrep -f avahi-daemon | awk '{print "kill -9 "$2}'
  5. systemctl disable avahi-daemon.socket
  6. systemctl disable avahi-daemon.service

1.20.配置 nozeroconf

  1. cat <<EOF>>/etc/sysconfig/network
  2. NOZEROCONF=yes
  3. EOF

2.集群和数据库安装

2.1.安装 xdpyinfo 软件

yum install xdpyinfo -y

2.2.上传集群软件并解压,解压到grid的home目录

  1. [root@node1 ~]$ cd /opt
  2. [root@node1 ~]$ chown grid.oinstall sw/
  3. [root@node1 ~]$ su - grid -c "unzip -q /opt/sw/LINUX.X64_19.3.0_193000_grid_home.zip -d /u01/app/19.3.0/grid"

2.3.集群安装前环境检查

  1. 使用root用户安装
  2. cd /u01/app/19.3.0/grid/cv/rpm/
  3. CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
  4. rpm -ivh cvuqdisk-1.0.10-1.rpm
  5. 将cvuqdisk拷贝到其他节点
  6. scp cvuqdisk-1.0.10-1.rpm node2:/opt/sw
  7. CVUQDISK_GRP=oinstall; export CVUQDISK_GRP
  8. rpm -ivh cvuqdisk-1.0.10-1.rpm

2.4.安装前环境检查

  1. su - grid
  2. [grid@node1 ~]$ cd $ORACLE_HOME
  3. [grid@node1 grid]$ ./runcluvfy.sh stage -post hwos -n node1,node2 -verbose

2.5.安装集群软件

  1. 调取图形界面
  2. [root@node1 ~]# xhost +
  3. access control disabled, clients can connect from any host
  4. [root@node1 ~]# su - grid
  5. [grid@node1 ~]$ export DISPLAY=192.168.1.21:1
  6. [grid@node1 ~]$ xhost +
  7. access control disabled, clients can connect from any host
  8. [grid@node1 ~]$ cd /u01/app/19.3.0/grid
  9. [grid@node1 grid]#./gridSetup.sh

2.6.创建磁盘组

asmca

2.7.上传和解压数据库软件

  1. 上传数据库软件并解压,解压到grid的home目录
  2. [root@node1 ~]$ cd /opt
  3. [root@node1 ~]$ chown oracle.oinstall sw/ -R
  4. [root@node1 ~]$ su - oracle -c "unzip -q /opt/sw/LINUX.X64_19.3.0_193000_db_home.zip -d /u01/app/oracle/product/19.3.0/dbhome_1"

2.8.安装数据库软件

  1. su - oracle
  2. [oracle@node1 ~]$ export DISPLAY=192.168.1.21:1
  3. [oracle@node1 ~]$ cd /u01/app/oracle/product/19.3.0/dbhome_1
  4. [oracle@node1 dbhome_1]$ ./runInstaller

2.9.创建数据库

dbca

总结

以上是Oracle19c RAC集群linux平台上安装的详细步骤。以上部署是在节点1的配置步骤,节点2第1部分系统配置和第2部分存储配置配置步骤一样;第3部分集群和数据库的安装,只需要在节点1执行即可。

1.Oracle数据库 底层原理解析_解析oracle数据库内部实现(视频讲解)

详细讲解了Oracle数据库内部是如何实现的,以及Oracle数据库的设计思路;

以此举一反三,可以轻松掌握MySQL与PostgreSQL数据库的设计思想与不同之处。
https://edu.csdn.net/course/detail/35647

2.Oracle 19c RAC For Linux安装部署(视频讲解)
https://edu.csdn.net/course/detail/35792
 


声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/689725
推荐阅读
相关标签
  

闽ICP备14008679号