zoukankan      html  css  js  c++  java
  • Oracle笔记(2)19c RAC安装

    一 、版本及规划

    1.版本选择

    oracle 19.3.0 + centos7.6_64
    操作系统: CentOS-7-x86_64-DVD-1908.iso
    集群:     Oracle Database Grid Infrastructure 19.3.0.0.0 for Linux x86-64.zip
    数据库:   Oracle Database 19.3.0.0.0 for Linux x86-64.zip
    
    

    2.主机IP规划

            主机名           public ip        Virtual ip       private ip         scan ip
    节点1:    rac1        192.168.1.141    192.168.1.142    192.168.10.1      192.168.1.147、148、149
    节点2:    rac2        192.168.1.143    192.168.1.144    192.168.10.3      192.168.1.147、148、149
    #节点3:   rac3        192.168.1.145    192.168.1.146    192.168.10.5      192.168.1.147、148、149    #  预留 
    #DG       dg         192.168.1.150                                                                 #  预留
    存储      openfiler   192.168.1.140、192.168.10.140
    
    备注:Private用于心跳,Scanip用于集群对外服务。
    

    3.ASM磁盘组规划

    ASM磁盘组 	    用途 	                    大小             冗余
    CRS 	    ocr、voting file、19c grid管理库 	100G+100G+100G    NORMAL
    DATA 	            数据文件 	                  200G+200G 	  NORMAL
    RECO                RECO                             150G         extn
    
    #备注:共享磁盘使用使用openfiler提供,过程省略。
          openfiler: openfileresa-2.99.1-x86_64-disc1.iso
          虚拟机:     选择rh5_64,配置为2双网卡、1cpu、512M内存、20G系统盘+500G数据盘*3
          安装参考:   https://jingyan.baidu.com/article/046a7b3ebe6818f9c27fa9ef.html
          安装后登录: https://192.168.1.140:446/  用户名:openfiler   口令:password 
    

    二、环境准备

    2.1.主机环境配置

    1.修改主机名
    ### rac1 
    [root@server ~]# hostnamectl --static set-hostname rac1
    ### rac2 
    [root@server ~]# hostnamectl --static set-hostname rac2
    
    1.关闭防火墙
    ### rac1 rac2
    [root@server ~]# systemctl stop firewalld.service
    [root@server ~]# systemctl disable firewalld.service
    [root@server ~]# systemctl status firewalld.service
    
    2.关闭selinux
    ### rac1 rac2###
    [root@server ~]# setenforce 0                  #临时设置SELinux 成为permissive模式, 1为enforcing模式
    #[root@server ~]# setenforce Permissive        #或者
    [root@server ~]# sed -i "s/^SELINUX=.*/SELINUX=Permissive/" /etc/selinux/config    #重启生效
    
    3.修改hosts文件
    ### rac1 rac2###
    [root@server ~]# cat >> /etc/hosts <<'EOF'
    
    # add for rac 19c
    # Public
    192.168.1.141   rac1
    192.168.1.143  rac2
    
    # Virtual
    192.168.1.142   rac1-vip
    192.168.1.144   rac2-vip
    
    # Private
    192.168.10.141   rac1-priv
    192.168.10.143   rac2-priv
    # SCAN
    192.168.1.147   rac-scan
    #192.168.1.148  rac-scan  # do not use dns
    #192.168.1.149  rac-scan  # do not use dns
    EOF
    
    4.修改内核参数,添加配置内容至 "/etc/sysctl.conf" .
    ### rac1 rac2###
    [root@server ~]# cat >>/etc/sysctl.conf <<'EOF'
    
    # add for oracle by me
    fs.file-max = 6815744
    kernel.sem = 250 32000 100 128
    kernel.shmmni = 4096
    kernel.shmall = 1073741824
    kernel.shmmax = 4398046511104
    kernel.panic_on_oops = 1
    net.core.rmem_default = 262144
    net.core.rmem_max = 4194304
    net.core.wmem_default = 262144
    net.core.wmem_max = 1048576
    net.ipv4.conf.all.rp_filter = 2
    net.ipv4.conf.default.rp_filter = 2
    fs.aio-max-nr = 1048576
    net.ipv4.ip_local_port_range = 9000 65500
    EOF
    [root@server ~]# /sbin/sysctl -p     #重启生效
    
    5.修改 /etc/security/limits.conf,在最后添加配置内容
    [root@server ~]# cat >>/etc/security/limits.conf <<'EOF'
    
    #add for oracle by me
    oracle   soft   nofile    1024
    oracle   hard   nofile    65536
    oracle   soft   nproc    16384
    oracle   hard   nproc    16384
    oracle   soft   stack    10240
    oracle   hard   stack    32768
    oracle   hard   memlock    134217728
    oracle   soft   memlock    134217728
    grid	soft	nofile	1024
    grid	hard	nofile	65536
    grid	soft	nproc	16384
    grid	hard	nproc	16384
    grid	soft	stack	10240
    grid	hard	stack	32768
    grid	soft	memlock	134217728
    grid	hard	memlock	134217728
    EOF
    
    6.安装必要包
    # From Public Yum or ULN
    [root@server ~]# yum install -y 
    binutils                  
    compat-libstdc++-33       
    compat-libstdc++-33.i686  
    gcc                       
    gcc-c++                   
    glibc                     
    glibc.i686                
    glibc-devel               
    glibc-devel.i686          
    ksh                       
    libgcc                    
    libgcc.i686               
    libstdc++                 
    libstdc++.i686            
    libstdc++-devel           
    libstdc++-devel.i686      
    libaio                    
    libaio.i686               
    libaio-devel              
    libaio-devel.i686         
    libXext                   
    libXext.i686              
    libXtst                   
    libXtst.i686              
    libX11                    
    libX11.i686               
    libXau                    
    libXau.i686               
    libxcb                    
    libxcb.i686               
    libXi                     
    libXi.i686                
    make                      
    sysstat                   
    unixODBC                  
    unixODBC-devel            
    zlib-devel                
    zlib-devel.i686           
    compat-libcap1  # add after check
    
    9。其他
    # 1)NTP配置
        使用RAC自带ctssd时间同步进程,这里关闭系统NTP
    ### rac1 rac2
    [root@server ~]# systemctl stop chronyd
    systemctl disable chronyd
    mv /etc/chrony.conf /etc/chrony.conf.bak
    
    # 2) 关闭avahi
    [root@server ~]# systemctl stop avahi-dnsconfd
    systemctl stop avahi-daemon
    systemctl disable avahi-dnsconfd
    systemctl disable avahi-daemon
    
    # 3) 关闭THP
    [root@server ~]# cat >>/etc/rc.d/rc.local <<'EOF'
    
    # add for rac to disable THP
    if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
    echo never > /sys/kernel/mm/transparent_hugepage/enabled
    fi
    if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
    echo never > /sys/kernel/mm/transparent_hugepage/defrag
    fi
    EOF
    [root@server ~]# chmod +x /etc/rc.d/rc.local
    [root@server ~]# reboot
    
    #安装grid检查报错后添加
    mv /etc/ntp.conf /etc/ntp.conf.orig
    
    

    2.2 用户环境配置

    1.创建用户和组
    [root@server ~]# groupadd -g 54321 oinstall
    groupadd -g 54322 dba
    groupadd -g 54323 oper
    
    groupadd -g 54324 backupdba
    groupadd -g 54325 dgdba
    groupadd -g 54326 kmdba
    groupadd -g 54327 asmdba
    groupadd -g 54328 asmoper
    groupadd -g 54329 asmadmin
    groupadd -g 54330 racdba
    [root@server ~]# useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba oracle
    [root@server ~]# useradd -u 54322 -g oinstall -G dba,asmdba,asmoper,asmadmin,racdba grid
    [root@server ~]# passwd oracle
    [root@server ~]# passwd grid
    
    
    备注:常见用户组说明
    ------------------------------------------------------------------------------------------
    组 	    角色 	            权限
    oinstall 	                安装和升级oracle软件
    dba 	    sysdba 	        创建、删除、修改、启动、关闭数据库,切换日志归档模式,备份恢复数据库
    oper 	    sysoper 	        启动、关闭、修改、备份、恢复数据库,修改归档模式
    asmdba 	    sysdba自动存储管理 	管理ASM实例
    asmoper     sysoper自动存储管理 	启动、停止ASM实例
    asmadmin    sysasm 	        挂载、卸载磁盘组,管理其他存储设备
    backupdba   sysbackup 	        启动关闭和执行备份恢复(12c)
    dgdba 	    sysdg 	        管理Data Guard(12c)
    kmdba 	    syskm 	        加密管理相关操作
    racdba                          rac管理
    ------------------------------------------------------------------------------------------
    参考:https://blog.csdn.net/luis_ora/article/details/90054248
    
    2.创建安装目录
    
    [root@server ~]# 
    mkdir -p /u01/app/grid
    mkdir -p /u01/app/19.3.0.0/grid
    mkdir -p /u01/app/oracle/product/19.3.0.0/db_1
    chown -R oracle:oinstall /u01/
    chown -R grid:oinstall /u01/app/19.3.0.0/grid
    chown -R grid:oinstall /u01/app/grid
    chmod -R 775 /u01/
    
    3.编辑profile
    # 3.1 grid用户
    ### 1) rac1
    [root@rac1~]# cat >>/home/grid/.bash_profile<<'EOF'
    # grid Settings
    export TMP=/tmp
    export TMPDIR=$TMP
    
    export ORACLE_HOSTNAME=$HOSTNAME
    export ORACLE_BASE=/u01/app/grid
    export GRID_HOME=/u01/app/19.3.0.0/grid
    export DB_HOME=$ORACLE_BASE/product/19.3.0.0/db_1
    
    export ORACLE_HOME=$GRID_HOME
    export ORACLE_SID=+ASM1
    export ORACLE_TERM=xterm
    export BASE_PATH=/usr/sbin:$PATH
    export PATH=$ORACLE_HOME/bin:$BASE_PATH
    
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    EOF
    
    ### 2) rac2
    [root@rac2~]# cat >>/home/grid/.bash_profile<<'EOF'
    # grid Settings
    export TMP=/tmp
    export TMPDIR=$TMP
    
    export ORACLE_HOSTNAME=$HOSTNAME
    export ORACLE_BASE=/u01/app/grid
    export GRID_HOME=/u01/app/19.3.0.0/grid
    export DB_HOME=$ORACLE_BASE/product/19.3.0.0/db_1
    
    export ORACLE_HOME=$GRID_HOME
    export ORACLE_SID=+ASM2
    export ORACLE_TERM=xterm
    export BASE_PATH=/usr/sbin:$PATH
    export PATH=$ORACLE_HOME/bin:$BASE_PATH
    
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    EOF
    
    # 3.2 oracle用户
    ### 1) rac1
    [root@rac1~]# cat >> /home/oracle/.bash_profile <<'EOF'
    
    # oracle Settings
    export TMP=/tmp
    export TMPDIR=$TMP
    
    export ORACLE_HOSTNAME=$HOSTNAME
    export ORACLE_UNQNAME=racdb
    export ORACLE_BASE=/u01/app/oracle
    export GRID_HOME=/u01/app/19.3.0.0/grid
    
    export DB_HOME=$ORACLE_BASE/product/19.3.0.0/db_1
    export ORACLE_HOME=$DB_HOME
    export ORACLE_SID=racdb1
    export ORACLE_TERM=xterm
    export BASE_PATH=/usr/sbin:$PATH
    export PATH=$ORACLE_HOME/bin:$BASE_PATH
    
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    EOF
    
    ### 2) rac2
    [root@rac2~]# cat >> /home/oracle/.bash_profile <<'EOF'
    
    # oracle Settings
    export TMP=/tmp
    export TMPDIR=$TMP
    
    export ORACLE_HOSTNAME=$HOSTNAME
    export ORACLE_UNQNAME=racdb
    export ORACLE_BASE=/u01/app/oracle
    export GRID_HOME=/u01/app/19.3.0.0/grid
    
    export DB_HOME=$ORACLE_BASE/product/19.3.0.0/db_1
    export ORACLE_HOME=$DB_HOME
    export ORACLE_SID=racdb2
    export ORACLE_TERM=xterm
    export BASE_PATH=/usr/sbin:$PATH
    export PATH=$ORACLE_HOME/bin:$BASE_PATH
    
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
    export CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
    EOF
    
    # 3.3 配置互信
    ssh-keygen
    ssh-copy-id grid@rac2
    
    ssh rac1 "hostname;date"
    ssh rac1-priv "hostname;date"
    ssh rac2 "hostname;date"
    ssh rac2-priv "hostname;date"
    

    2.3 配置共享存储

    1.配置iscsi
    # rac1 rac2 启动iscsi
    [root@rac1 ~]# rm -qa|grep iscsi
    iscsi-initiator-utils-iscsiuio-6.2.0.874-11.el7.x86_64
    libvirt-daemon-driver-storage-iscsi-4.5.0-23.el7_7.6.x86_64
    libiscsi-1.9.0-7.el7.x86_64
    iscsi-initiator-utils-6.2.0.874-11.el7.x86_64
    [root@rac1 ~]# chkconfig iscsid on
    [root@rac1 ~]# systemctl start iscsid.service
    [root@rac1 ~]# systemctl status iscsid.service
    
    # rac1 rac2 配置连接
    [root@rac1 ~]# iscsiadm -m discovery -t sendtargets -p 192.168.10.140                              #发现
    [root@rac1 ~]# iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.crs1 -p 192.168.10.140 -l           #自动登录
    iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.crs2 -p 192.168.10.140 -l  
    iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.crs3 -p 192.168.10.140 -l  
    iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.data1 -p 192.168.10.140 -l  
    iscsiadm -m node -T  iqn.2006-01.com.openfiler:tsn.data2 -p 192.168.10.140 -l  
    
    #备注:
          iscsiadm -m node -T iqn.2006-01.com.openfiler:tsn.data2 -p 192.168.10.140:3260 -u           #先取消
          iscsiadm -m node -o delete -T iqn.2006-01.com.openfiler:tsn.data2 -p 192.168.10.140:3260     #再删除
          iscsiadm -m node --loginall=all   #全部添加
          iscsiadm -m node --logoutall=all  #全部取消并删除
    
    2.配置多路径
    [root@rac1 ~]# cp /usr/share/doc/device-mapper-multipath-0.4.9/multipath.conf /etc/
    [root@rac1 ~]# systemctl enable multipathd.service
    [root@rac1 ~]# systemctl start multipathd.service
    [root@rac1 ~]# systemctl stop multipathd.service
    
    #----------------
    [root@rac1 by-id]# ll /dev/disk/by-id/
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c45524575336f547a2d775956462d73554946 -> ../../sdd
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c45524647383354652d747439792d4b634952 -> ../../sdf
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c4552494e643353642d706569522d31375a53 -> ../../sdb
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c4552584e4c65474b2d786374442d4f786d48 -> ../../sde
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 scsi-14f504e46494c455258654d4845702d4d357a442d585a5370 -> ../../sdc
    
    [root@rac1 by-id]# ll /dev/disk/by-path/
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.crs1-lun-0 -> ../../sdb
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.crs2-lun-0 -> ../../sdc
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.crs3-lun-0 -> ../../sdd
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.data1-lun-0 -> ../../sde
    lrwxrwxrwx. 1 root root  9 Mar 28 12:45 ip-192.168.10.140:3260-iscsi-iqn.2006-01.com.openfiler:tsn.data2-lun-0 -> ../../sdf
    
    #----------------
    
    #建议用vim修改
    [root@rac1 ~]# cat >> /etc/multipath.conf <<'EOF'
    multipaths {
    	multipath {
    		wwid	14f504e46494c4552494e643353642d706569522d31375a53
    		alias	crs1
    		uid	54322
    		gid	54321
    	}
    	multipath {
    		wwid	14f504e46494c455258654d4845702d4d357a442d585a5370
    		alias	crs2
    		uid	54322
    		gid	54321
    	}
    	multipath {
    		wwid	14f504e46494c45524575336f547a2d775956462d73554946
    		alias	crs3
    		uid	54322
    		gid	54321
    	}
    	multipath {
    		wwid	14f504e46494c4552584e4c65474b2d786374442d4f786d48
    		alias	data1
    		uid	54322
    		gid	54321
    	}
    	multipath {
    		wwid	14f504e46494c45524647383354652d747439792d4b634952
    		alias	data2
    		uid	54322
    		gid	54321
    	}
    }
    EOF
    [root@rac1 ~]# systemctl restart multipathd.service
    
    # 备注:重启观察磁盘情况
    ---------------------------------------------------------------------------
    [root@rac1 ~]# fdisk -l
    [root@rac1 ~]# ll /dev/mapper/
    total 0
    lrwxrwxrwx. 1 root root       7 Mar 28 13:19 centos_server-root -> ../dm-0
    lrwxrwxrwx. 1 root root       7 Mar 28 13:19 centos_server-swap -> ../dm-1
    crw-------. 1 root root 10, 236 Mar 28 13:19 control
    lrwxrwxrwx. 1 root root       7 Mar 28 13:27 crs1 -> ../dm-2
    lrwxrwxrwx. 1 root root       7 Mar 28 13:27 crs2 -> ../dm-6
    lrwxrwxrwx. 1 root root       7 Mar 28 13:27 crs3 -> ../dm-5
    lrwxrwxrwx. 1 root root       7 Mar 28 13:27 data1 -> ../dm-4
    lrwxrwxrwx. 1 root root       7 Mar 28 13:27 data2 -> ../dm-3
    [root@rac1 ~]# reboot
    Connection closing...Socket close.
    
    Connection closed by foreign host.
    
    Disconnected from remote host(192.168.1.141:22) at 13:28:45.
    
    Type `help' to learn how to use Xshell prompt.
    [D:~]$ reconnect
    
    
    [D:~]$ Connecting to 192.168.1.141:22...
    Connection established.
    To escape to local shell, press 'Ctrl+Alt+]'.
    
    Last login: Sat Mar 28 13:19:26 2020 from 192.168.1.10
    [root@rac1 ~]# ll /dev/mapper/
    total 0
    lrwxrwxrwx. 1 root root       7 Mar 28 13:28 centos_server-root -> ../dm-0
    lrwxrwxrwx. 1 root root       7 Mar 28 13:28 centos_server-swap -> ../dm-1
    crw-------. 1 root root 10, 236 Mar 28 13:28 control
    lrwxrwxrwx. 1 root root       7 Mar 28 13:29 crs1 -> ../dm-6
    lrwxrwxrwx. 1 root root       7 Mar 28 13:29 crs2 -> ../dm-5
    lrwxrwxrwx. 1 root root       7 Mar 28 13:29 crs3 -> ../dm-4
    lrwxrwxrwx. 1 root root       7 Mar 28 13:29 data1 -> ../dm-3
    lrwxrwxrwx. 1 root root       7 Mar 28 13:29 data2 -> ../dm-2
    [root@rac1 ~]# fdisk -l
    Disk /dev/sda: 536.9 GB, 536870912000 bytes, 1048576000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk label type: dos
    Disk identifier: 0x000a2ce8
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *        2048     2099199     1048576   83  Linux
    /dev/sda2         2099200  1048575999   523238400   8e  Linux LVM
    
    Disk /dev/mapper/centos_server-root: 531.6 GB, 531628032000 bytes, 1038336000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/mapper/centos_server-swap: 4160 MB, 4160749568 bytes, 8126464 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/sdb: 165.0 GB, 164987142144 bytes, 322240512 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/sdc: 536.9 GB, 536870912000 bytes, 1048576000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/sdd: 107.4 GB, 107374182400 bytes, 209715200 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/sde: 107.4 GB, 107374182400 bytes, 209715200 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/mapper/data2: 165.0 GB, 164987142144 bytes, 322240512 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/sdf: 107.4 GB, 107374182400 bytes, 209715200 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/mapper/data1: 536.9 GB, 536870912000 bytes, 1048576000 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/mapper/crs3: 107.4 GB, 107374182400 bytes, 209715200 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/mapper/crs2: 107.4 GB, 107374182400 bytes, 209715200 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    
    Disk /dev/mapper/crs1: 107.4 GB, 107374182400 bytes, 209715200 sectors
    Units = sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    
    ---------------------------------------------------------------------------
    
    
    修改:99-oracle-asmdevices.rules
    [root@rac1 ~]# vim /etc/udev/rules.d/99-oracle-asmdevices.rules
    KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c4552494e643353642d706569522d31375a53",OWNER="grid",GROUP="asmadmin",MODE="0660"
    KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c455258654d4845702d4d357a442d585a5370",OWNER="grid",GROUP="asmadmin",MODE="0660"
    KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c45524575336f547a2d775956462d73554946",OWNER="grid",GROUP="asmadmin",MODE="0660"
    KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c4552584e4c65474b2d786374442d4f786d48",OWNER="grid",GROUP="asmadmin",MODE="0775"
    KERNEL=="dm-*",ENV{DM_UUID}=="mpath-14f504e46494c45524647383354652d747439792d4b634952",OWNER="grid",GROUP="asmadmin",MODE="0775"
    [root@rac1 ~]# reboot                   #粗暴的重启生效
    [root@rac2 ~]# ll /dev/ |grep dm-*      #检查是否生效
    

    三、GRID 软件安装

    在节点1上安装Oracle Grid Infrastructure软件,安装过程中会自动把软件拷贝至节点2,因此节点2上不用安装操作.
    
    [root@rac1 ~]# su - grid
    [grid@rac1 ~]$ unzip LINUX.X64_193000_grid_home.zip  -d $ORACLE_HOME
    [grid@rac1 ~]$ $ORACLE_HOME/oui/prov/resources/scripts/sshUserSetup.sh -user grid  -hosts "rac1 rac2"  -advanced -noPromptPassphrase
    [grid@rac1 ~]$ exit
    
    [root@rac1 ~]# yum localinstall /u01/app/19.3.0.0/grid/cv/rpm/cvuqdisk-1.0.10-1.rpm
    [root@rac1 ~]# /u01/app/19.3.0.0/grid/runcluvfy.sh  stage -pre crsinst -n "rac1,rac2" -verbose
    
     
    # Make sure both virtual machines are started. Install the following package from the Oracle grid media as the "root" user.
    [root@rac1 ~]# cd /media/sf_12.1.0.2/grid/rpm
    [root@rac1 ~]# rpm -Uvh cvuqdisk*
    
    [root@rac1 ~]# su - grid
    [grid@rac1 ~]$ cd $ORACLE_HOME
    # [grid@rac1 ~]$ORACLE_HOME/runcluvfy.sh  stage -pre crsinst -n "ydb01,ydb02"  -verbose   #图形化界面,安装前检查跳过
    [grid@rac1 ~]$ $ ./runInstaller
    

    四、Database 安装

    1.ASM新建 DATA RECO磁盘组
    [grid@rac1 ~]$asmca      #进入图形化 创建
    # 过程省略,其中CRS存储OCR和Votedisk,DATA用于存放数据。RECO用于存储闪回区和归档.
    
    2.安装 Database 软件。
    注意:对于RAC安装,一定要选择仅设置软件(Set Up Software Only),安装完软件之后再使用DBCA建库,这是与以往 版本不同的地方。不能在软件安装过程中创建数据库了。
    
    [root@rac1 ~]# su - oracle
    [oracle@rac1 db_1]$ unzip Oracle Database 19.3.0.0.0 for Linux x86-64.zip -d $ORACLE_HOME
    
    3.安装 Database 实例。
    [root@rac1 ~]# su - oracle
    [oracle@rac1 db_1]$ dbca
    过程忽略。。。
    
  • 相关阅读:
    redis实时同步工具redis-shake
    elasticsearch单机部署
    ogg从库进程监控
    mha安装部署
    mha自定义路径安装
    gnuplot输出柱状图
    gnuplot输出曲线图
    gnuplot命令行模式不支持中文标题的解决办法
    ogg中logdump使用自动输入执行
    JDK(java se development kit)的构成
  • 原文地址:https://www.cnblogs.com/skyan/p/12584340.html
Copyright © 2011-2022 走看看