• Welcome to the world's largest Chinese hacker forum

    Welcome to the world's largest Chinese hacker forum, our forum registration is open! You can now register for technical communication with us, this is a free and open to the world of the BBS, we founded the purpose for the study of network security, please don't release business of black/grey, or on the BBS posts, to seek help hacker if violations, we will permanently frozen your IP and account, thank you for your cooperation. Hacker attack and defense cracking or network Security

    business please click here: Creation Security  From CNHACKTEAM

Recommended Posts

CentOS7.6搭建RAC

1.系统环境配置

1.1概述

搭建两个节点的英国皇家飞行俱乐部(Club)皇家航空公司英国皇家汽车俱乐部(Club)皇家汽车公司美国研究分析公司(研究分析Corporation)加拿大铁路协会(Canada)铁路协会雷达进场控制(雷达进场控制)集群,其每个节点均有两个网卡,公共网卡和私人的网卡。两个节点的主机名分别为rac1和rac2

1.2 参数设置(RAC1RAC2)

编辑/etc/hosts文件

vim /etc/hosts

注释掉以下内容,

#127.0.0.1本地主机rac1本地主机四本地主机4 .本地域四

#:1本地主机rac1本地主机6本地主机6 .本地域名6

注:如果没有注释上述内容,在安装英国皇家飞行俱乐部(Club)皇家航空公司英国皇家汽车俱乐部(Club)皇家汽车公司美国研究分析公司(研究分析Corporation)加拿大铁路协会(Canada)铁路协会雷达进场控制(雷达进场控制)的先决条件检查时,会报PRVG-13632错误。

追加以下内容

# RAC-公共-IP

192.168.100.101 rac1

192

#RAC专用互联网协议(Internet Protocol)

rac1-priv

rac2-priv

#RAC-VIP

192.168.100.201 rac1-vip

rac2-vip

#RAC-SCAN-IP

192.168扫描

1.3 关闭防火墙

关闭防火墙服务

启动脚本禁用防火墙

防火墙配置

vi /etc/selinux/config

把执行更改为有缺陷的

#该文件控制系统上防火墙的状态。

# SELINUX=可以取这三个值之一:

#强制执行-强制执行防火墙安全策略。

#许可- SELinux打印警告而不是强制。

#已禁用-没有加载防火墙策略。

SELINUX=禁用

# SELINUXTYPE=可以取三个值之一:

#目标-目标流程受到保护,

#最小-目标政策的修改。只有选定的进程受到保护。

# mls -多级安全保护。

SELINUXTYPE=有针对性

挂载系统光盘

配置本地妙的源

mkdir /yums

CD/run/media/root/CentOS 7 x86 _ 64/包

cp * /yums

转速-IVH德尔塔转速-3.6-3。el7。x86 _ 64。每分钟转数

rpm-IVH python-delta rpm-3.6-3。el7。x86 _ 64。每分钟转数

IVH创建回购-0。9 .9-28 .el7。没有拱门。每分钟转数

cd /yums

创建报告。

VI/etc/yum。回购。d/yum。本地的。被卖方收回的汽车

[本地]

name=yum本地回购

baseurl=file:///yums

gpgcheck=0

启用=1

安装依赖包

yum install -y bc

yum install -y compat-libcap1*

百胜学院

all -y compat-libcap* yum install -y binutils yum install -y compat-libstdc++-33 yum install -y elfutils-libelf yum install -y elfutils-libelf-devel yum install -y gcc yum install -y gcc-c++ yum install -y glibc-2.5 yum install -y glibc-common yum install -y glibc-devel yum install -y glibc-headers yum install -y ksh libaio yum install -y libaio-devel yum install -y libgcc yum install -y libstdc++ yum install -y libstdc++-devel yum install -y make yum install -y sysstat yum install -y unixODBC yum install -y unixODBC-devel yum install -y binutils* yum install -y compat-libstdc* yum install -y elfutils-libelf* yum install -y gcc* yum install -y glibc* yum install -y ksh* yum install -y libaio* yum install -y libgcc* yum install -y libstdc* yum install -y make* yum install -y sysstat* yum install -y libXp* yum install -y glibc-kernheaders yum install -y net-tools-* yum install -y iscsi-initiator-utils yum install -y udev yum install -y xclock*

手动上传以下依赖包并安装

rpm -ivh cvuqdisk-1.0.10-1.rpm
rpm -ivh rlwrap-0.37-1.el6.x86_64.rpm
yum install -y compat-libstdc++-33-3.2.3-72.el7.x86_64.rpm
yum install -y kmod-20-21.el7.x86_64.rpm
yum install -y kmod-libs-20-21.el7.x86_64.rpm

关闭透明大页

cp /etc/default/grub /etc/default/grub.bak
vi /etc/default/grub

追加一行

GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never"

GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never"
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet transparent_hugepage=never"

内核参数配置

vi /etc/sysctl.conf
kernel.shmmax = 2126008812
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
fs.file-max = 6815744
kernel.shmall = 393216
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.ip_local_port_range = 9000 65500
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_tw_reuse = 1
#net.core.somaxconn = 262144
net.core.netdev_max_backlog = 262144
net.ipv4.tcp_max_orphans = 262144
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_synack_retries = 2
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_fin_timeout = 1
net.ipv4.tcp_keepalive_time = 30
net.ipv4.tcp_keepalive_probes = 6
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_timestamps = 0
fs.aio-max-nr = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2

生成系统参数

sysctl -p 

注:

kernel.shmmax

用于定义单个共享内存段的最大值。设置应该足够大,能在一个共享内存段下容纳下整个的 SGA。32 位 linux 系统:可取最大值为 4GB ( 4294967296bytes ) -1byte;64 位 linux 系统:可取的最大值为物理内存值 -1byte.

建议值为多于物理内存的一半,一般取值大于 SGA_MAX_SIZE 即可,可以取物理内存 -1byte

kernel.shmall :

可以使用的共享内存的总页数, Linux 共享内存页大小为 4KB

  • 修改pam.d/login

    vim /etc/pam.d/login
    
    session required /lib/security/pam_limits.so
    session required pam_limits.so
    
  • 系统资源限制配置

    vim /etc/security/limits.conf
    
    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   hard   memlock    134217728
    grid   soft   memlock    134217728
    
  • 配置环境变量

    vim /etc/profile
    
    if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
       if [ $SHELL = "/bin/ksh" ]; then
          ulimit -p 16384
          ulimit -n 65536
          else
          ulimit -u 16384 -n 65536
       fi
    fi
    

    生成环境变量

    source /etc/profile
    
  • 添加用户和用户组、创建目录

    groupadd -g 601 oinstall
    groupadd -g 602 dba
    groupadd -g 603 oper
    groupadd -g 604 backupdba
    groupadd -g 605 dgdba
    groupadd -g 606 kmdba
    groupadd -g 607 asmdba
    groupadd -g 608 asmoper
    groupadd -g 609 asmadmin
    useradd -u 601 -g oinstall -G asmadmin,asmdba,dba,asmoper grid
    useradd -u 602 -g oinstall -G dba,backupdba,dgdba,kmdba,asmadmin,oper,asmdba oracle
    

    创建用户密码

    passwd grid
    passwd oracle
    

    创建Oracle Inventory目录

    mkdir -p /u01/app/oraInventory
    chown -R grid:oinstall /u01/app/oraInventory
    chmod -R 775 /u01/app/oraInventory
    

    创建GI HOME目录

    mkdir -p /u01/app/grid
    mkdir -p /u01/app/19c/grid
    chown -R grid:oinstall /u01/app/grid
    chmod -R 775 /u01/app/grid
    chown -R grid:oinstall /u01/app/19c
    chmod -R 775 /u01/app/19c/
    

    创建Oracle Base目录

    mkdir -p /u01/app/oracle
    mkdir /u01/app/oracle/cfgtoollogs 
    chown -R oracle:oinstall /u01/app/oracle
    chmod -R 775 /u01/app/oracle
    

    创建Oracle RDBMS Home目录

    mkdir -p /u01/app/oracle/product/19c/db_1
    chown -R oracle:oinstall /u01/app/oracle/product/19c/db_1
    chmod -R 775 /u01/app/oracle/product/19c/db_1
    
  • 给grid用户配置环境变量

    切换到grid用户

    su - grid
    

    编辑bash_profile配置文件

    vim ~/.bash_profile
    
    PS1="[`whoami`@`hostname`:"'$PWD]$'
    export PS1
    umask 022
    export TMP=/tmp
    export TMPDIR=$TMP
    export ORACLE_SID=+ASM1
    export ORACLE_TERM=xterm;
    export ORACLE_BASE=/u01/app/grid
    export ORACLE_HOME=/u01/app/19c/grid
    export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
    export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib  
    export PATH=.:$PATH:$HOME/bin:$ORACLE_HOME/bin
    export THREADS_FLAG=native
    if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
            if [ $SHELL = "/bin/ksh" ];then
                ulimit -p 16384
                ulimit -n 65536
            else
                ulimit -u 16384 -n 65536
            fi
        umask 022
    fi
    alias sqlplus='rlwrap sqlplus'
    alias rman='rlwrap asmcmd'		
    

注:以下参数RAC1和RAC2的需设置不同参数

RAC1&RAC2:ORACLE_SID=+ASM1 / ASM2

生成环境变量

source ~/.bash_profile
  • 给oracle配置环境变量

    切换用户

    su - oracle
    

    配置bash_profile文件

    vim ~/.bash_profile
    
    PS1="[`whoami`@`hostname`:"'$PWD]$'
    export PS1
    export TMP=/tmp
    export TMPDIR=$TMP
    export ORACLE_HOSTNAME=rac1
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/19c/db_1
    export ORACLE_SID=orcl1
    export NLS_LANG="AMERICAN_AMERICA.AL32UTF8"
    export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"
    export TNS_ADMIN=$ORACLE_HOME/network/admin
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib  
    export PATH=.:$PATH:$HOME/bin:$ORACLE_BASE/product/19c/db_1/bin:$ORACLE_HOME/bin
    export THREADS_FLAG=native;export THREADS_FLAG
    if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
            if [ $SHELL = "/bin/ksh" ];then
                ulimit -p 16384
                ulimit -n 65536
            else
                ulimit -u 16384 -n 65536
            fi
        umask 022
    fi
    alias sqlplus='rlwrap sqlplus'
    alias rman='rlwrap rman'
    

    注:以下参数RAC1和RAC2的需设置不同参数

    ORACLE_HOSTNAME=rac1/rac2
    ORACLE_SID=orcl1/orcl2
    

    生成环境变量

    source ~/.bash_profile
    
  • 配置ISCSI挂载外部存储

    切换到root用户

    su - root
    

    安装ISCSI客户端软件

    yum -y install iscsi-initiator-utils
    

    设置开机自动启动

    chkconfig iscsid on
    

    查找target

    iscsiadm -m discovery -t sendtargets -p 192.168.100.103
    

    手动登录target

    iscsiadm -m node -T iqn.2022.04.com.rac:iscsi.disk -p 192.168.100.103 -l
    

    设置开机自动登录target

    iscsiadm -m node -T iqn.2022.04.com.rac:iscsi.disk --op update -n node.startup -v automatic
    

    查看共享磁盘

    cd /dev/disk/by-path
    ls -l /dev/disk/by-path/*iscsi* | awk '{FS=" "; print $9 " " $10 " " $11}'
    
    /dev/disk/by-path/ip-192.168.100.103:3260-iscsi-iqn.2022.04.com.rac:iscsi.disk-lun-1 -> ../../sdb
    /dev/disk/by-path/ip-192.168.100.103:3260-iscsi-iqn.2022.04.com.rac:iscsi.disk-lun-2 -> ../../sdc
    /dev/disk/by-path/ip-192.168.100.103:3260-iscsi-iqn.2022.04.com.rac:iscsi.disk-lun-3 -> ../../sdd
    /dev/disk/by-path/ip-192.168.100.103:3260-iscsi-iqn.2022.04.com.rac:iscsi.disk-lun-4 -> ../../sde
    /dev/disk/by-path/ip-192.168.100.103:3260-iscsi-iqn.2022.04.com.rac:iscsi.disk-lun-5 -> ../../sdf
    /dev/disk/by-path/ip-192.168.100.103:3260-iscsi-iqn.2022.04.com.rac:iscsi.disk-lun-6 -> ../../sdg
    

    查看磁盘wwid

    [[email protected] by-path]# for i in $(ls /dev/sd*|grep -v [0-9]|grep -v sda)
    > do  
    > echo -ne "$(fdisk -l ${i}|grep ^Disk|grep ${i}|awk '{print $1,$2,$3,$4}') WWID:"  
    > /lib/udev/scsi_id -g -u -d "${i}"
    > done|sort -nk3 -k5|column -t
    Disk  /dev/sdb:  21.5  GB,  WWID:360000000000000000e00000000010001
    Disk  /dev/sdc:  21.5  GB,  WWID:360000000000000000e00000000010002
    Disk  /dev/sdd:  21.5  GB,  WWID:360000000000000000e00000000010003
    Disk  /dev/sde:  21.5  GB,  WWID:360000000000000000e00000000010004
    Disk  /dev/sdf:  21.5  GB,  WWID:360000000000000000e00000000010005
    Disk  /dev/sdg:  21.5  GB,  WWID:360000000000000000e00000000010006
    [[email protected] by-path]# 
    
    vi /etc/udev/rules.d/99-oracle-asmdevices.rules
    # 打开文件后填入以下内容
    KERNEL=="sd*", ENV{ID_SERIAL}=="360000000000000000e00000000010001", SYMLINK+="asm_data",  OWNER="grid",  GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", ENV{ID_SERIAL}=="360000000000000000e00000000010002", SYMLINK+="asm_bak",  OWNER="grid",  GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", ENV{ID_SERIAL}=="360000000000000000e00000000010003", SYMLINK+="asm_fra",  OWNER="grid",  GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", ENV{ID_SERIAL}=="360000000000000000e00000000010004", SYMLINK+="asm_ocr_1",  OWNER="grid",  GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", ENV{ID_SERIAL}=="360000000000000000e00000000010005", SYMLINK+="asm_ocr_2",  OWNER="grid",  GROUP="asmadmin", MODE="0660"
    KERNEL=="sd*", ENV{ID_SERIAL}=="360000000000000000e00000000010006", SYMLINK+="asm_ocr_3",  OWNER="grid",  GROUP="asmadmin", MODE="0660"
    

    使udev生效

    udevadm control --reload-rules
    udevadm trigger
    
  • avahi-daemon 配置

    yum install -y avahi*
    systemctl stop avahi-daemon.socket
    systemctl stop avahi-daemon.service
    pgrep -f avahi-daemon | awk '{print "kill -9 "$2}'
    systemctl disable avahi-daemon.socket
    systemctl disable avahi-daemon.service
    cat <<EOF>>/etc/sysconfig/network
    NOZEROCONF=yes
    EOF
    
  • 时间同步配置

    禁用chronyd

    yum install -y chrony
    timedatectl set-timezone Asia/Shanghai
    systemctl stop chronyd.service
    systemctl disable chronyd.service
    

    配置时间同步定时任务

    yum install -y ntpdate
    ##192.168.100.150为时间服务器IP,每天12点同步系统时间
    vim /var/spool/cron/root
    
    00 12 * * * /usr/sbin/ntpdate -u 192.168.100.150 && /usr/sbin/hwclock -w
    
    ##手动执行
    /usr/sbin/ntpdate -u 192.168.100.150 && /usr/sbin/hwclock -w
    

2.RAC安装(RAC1)

2.1节点互信

  • 节点互信

    上传sshUserSetup.sh脚本到/root

    注:这个脚本是Oracle提供的,可以解压Oracle压缩包或者Grid压缩包,查找该脚本上传到rac1即可

    sh sshUserSetup.sh -user root -hosts "rac1 rac2" -advanced -noPromptPassphrase
    sh sshUserSetup.sh -user grid -hosts "rac1 rac2" -advanced -noPromptPassphrase
    sh sshUserSetup.sh -user oracle -hosts "rac1 rac2" -advanced -noPromptPassphrase
    

2.2 Grid安装

  • 上传Grid文件

    把LINUX.X64_193000_grid_home.zip上传到/u01/app/19c/grid

    cd /u01/app/19c/grid
    chown -R grid:oinstall LINUX.X64_193000_grid_home.zip
    
  • 切换grid用户解压

    su - grid
    cd $ORACLE_HOME
    unzip LINUX.X64_193000_grid_home.zip
    

    等待解压完毕

  • 配置DISPLAY变量

    export DISPLAY=192.168.100.103:0.0
    ./gridSetup.sh
    

    注:IP写自己宿主机的IP地址

  • 安装过程

fek3z1r3lpf3990.png
g25tkyzgyfo3991.png
r53kw4ywpmx3992.png

这里的SCAN NAME一定要和你/etc/hosts文件里的那个RAC-SCAN-IP的名称保持一致而不是和IP保持一致。
czrwntroupp3993.png
点击Add
kxj4lsp2ufk3994.png
astthl10pny3995.png

igtrtqxeqwa3996.png
5gdgdkqt25n3997.png

lm5npp4hh5g3998.png
qk2hacmptqc3999.png

hs5wbqyl13s4000.png

y3eyzfmzhuw4001.png
如果密码设置过于简单,会警告密码设置过于简单,点击Yes,继续
e0pnr0rgke14002.png
htwjnwrsvxm4003.png

是否注册EMCC,不使用,不配置

i2cux5gviua4004.png
23wbov1sjfk4005.png
gpuwrg1ygxu4006.png
ibzqobd2kj44007.png
efw04z2ntjw4008.png
3f4ppx1nu054009.png
有两个检查状态是失败的,主要是由于没有使用到DNS服务,所以报错,可以忽略。
1yhrq2h1esn4010.png
2030oszmjcw4011.png
点击“Yes”
1ecjvqsqhdc4012.png
3fdjngcli334013.png
anyr0sef42s4014.png
注:以root用户,按rac1,rac2的顺序先后执行这两个脚本,例如orainstRoot在rac1执行完毕后,然后在rac2执行

[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
[[email protected] ~]# /u01/app/19c/grid/root.sh
Performing root user operation.
The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/19c/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
\Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Relinking oracle with rac_on option
Using configuration parameter file: /u01/app/19c/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/rac1/crsconfig/rootcrs_rac1_2022-04-22_10-50-07PM.log
2022/04/22 22:50:30 CLSRSC-594: Executing installation step 1 of 19: 'SetupTFA'.
2022/04/22 22:50:31 CLSRSC-594: Executing installation step 2 of 19: 'ValidateEnv'.
2022/04/22 22:50:31 CLSRSC-363: User ignored prerequisites during installation
2022/04/22 22:50:31 CLSRSC-594: Executing installation step 3 of 19: 'CheckFirstNode'.
2022/04/22 22:50:34 CLSRSC-594: Executing installation step 4 of 19: 'GenSiteGUIDs'.
2022/04/22 22:50:35 CLSRSC-594: Executing installation step 5 of 19: 'SetupOSD'.
2022/04/22 22:50:35 CLSRSC-594: Executing installation step 6 of 19: 'CheckCRSConfig'.
2022/04/22 22:50:35 CLSRSC-594: Executing installation step 7 of 19: 'SetupLocalGPNP'.
2022/04/22 22:51:14 CLSRSC-594: Executing installation step 8 of 19: 'CreateRootCert'.
2022/04/22 22:51:19 CLSRSC-594: Executing installation step 9 of 19: 'ConfigOLR'.
2022/04/22 22:51:31 CLSRSC-594: Executing installation step 10 of 19: 'ConfigCHMOS'.
2022/04/22 22:51:31 CLSRSC-594: Executing installation step 11 of 19: 'CreateOHASD'.
2022/04/22 22:52:01 CLSRSC-594: Executing installation step 12 of 19: 'ConfigOHASD'.
2022/04/22 22:52:13 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2022/04/22 22:52:17 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.
2022/04/22 22:53:09 CLSRSC-594: Executing installation step 13 of 19: 'InstallAFD'.
2022/04/22 22:53:13 CLSRSC-594: Executing installation step 14 of 19: 'InstallACFS'.
2022/04/22 22:53:18 CLSRSC-594: Executing installation step 15 of 19: 'InstallKA'.
2022/04/22 22:53:23 CLSRSC-594: Executing installation step 16 of 19: 'InitConfig'.
ASM has been created and started successfully.
[DBT-30001] Disk groups created successfully. Check /u01/app/grid/cfgtoollogs/asmca/asmca-220422PM105407.log for details.
2022/04/22 22:55:46 CLSRSC-482: Running command: '/u01/app/19c/grid/bin/ocrconfig -upgrade grid oinstall'
CRS-4256: Updating the profile
Successful addition of voting disk b1f361bac9144f9cbfa05a20dc3e1a67.
Successfully replaced voting disk group with +CSDG.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   b1f361bac9144f9cbfa05a20dc3e1a67 (/dev/sde) [CSDG]
Located 1 voting disk(s).
2022/04/22 22:57:46 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2022/04/22 22:59:37 CLSRSC-343: Successfully started Oracle Clusterware stack
2022/04/22 22:59:38 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2022/04/22 23:02:49 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2022/04/22 23:04:30 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
[[email protected] ~]#

点击“OK”
dc2xtaroocu4015.png
spjtsakvsrk4016.png
报错,主要还是DNS问题,因为我们不使用DNS,所以可以忽略,点击OK
xhrpsogmmxj4017.png
点击“next”,安装完毕
342tnxlxmr24018.png
点击“Yes”
hej5gpzkmw04019.png
点击“close”,安装完毕

  • 查看集群状态

    [[email protected]:/home/grid]$crsctl stat res -t
    --------------------------------------------------------------------------------
    Name           Target  State        Server                   State details
    --------------------------------------------------------------------------------
    Local Resources
    --------------------------------------------------------------------------------
    ora.LISTENER.lsnr
                   ONLINE  ONLINE       rac1                     STABLE
                   ONLINE  ONLINE       rac2                     STABLE
    ora.chad
                   ONLINE  ONLINE       rac1                     STABLE
                   ONLINE  ONLINE       rac2                     STABLE
    ora.net1.network
                   ONLINE  ONLINE       rac1                     STABLE
                   ONLINE  ONLINE       rac2                     STABLE
    ora.ons
                   ONLINE  ONLINE       rac1                     STABLE
                   ONLINE  ONLINE       rac2                     STABLE
    --------------------------------------------------------------------------------
    Cluster Resources
    --------------------------------------------------------------------------------
    ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
          1        ONLINE  ONLINE       rac1                     STABLE
          2        ONLINE  ONLINE       rac2                     STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.CSDG.dg(ora.asmgroup)
          1        ONLINE  ONLINE       rac1                     STABLE
          2        ONLINE  ONLINE       rac2                     STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.LISTENER_SCAN1.lsnr
          1        ONLINE  ONLINE       rac1                     STABLE
    ora.asm(ora.asmgroup)
          1        ONLINE  ONLINE       rac1                     Started,STABLE
          2        ONLINE  ONLINE       rac2                     Started,STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.asmnet1.asmnetwork(ora.asmgroup)
          1        ONLINE  ONLINE       rac1                     STABLE
          2        ONLINE  ONLINE       rac2                     STABLE
          3        OFFLINE OFFLINE                               STABLE
    ora.cvu
          1        ONLINE  ONLINE       rac1                     STABLE
    ora.qosmserver
          1        ONLINE  ONLINE       rac1                     STABLE
    ora.rac1.vip
          1        ONLINE  ONLINE       rac1                     STABLE
    ora.rac2.vip
          1        ONLINE  ONLINE       rac2                     STABLE
    ora.scan1.vip
          1        ONLINE  ONLINE       rac1                     STABLE
    --------------------------------------------------------------------------------
    
    • 查看rac1的IP地址
    [[email protected]:/home/grid]$ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 00:0c:29:6c:2b:40 brd ff:ff:ff:ff:ff:ff
        inet 192.168.100.101/24 brd 192.168.100.255 scope global noprefixroute ens33
           valid_lft forever preferred_lft forever
        inet 192.168.100.200/24 brd 192.168.100.255 scope global secondary ens33:1
           valid_lft forever preferred_lft forever
        inet 192.168.100.201/24 brd 192.168.100.255 scope global secondary ens33:2
           valid_lft forever preferred_lft forever
        inet6 fe80::effb:10f8:9580:34e/64 scope link noprefixroute
           valid_lft forever preferred_lft forever
    3: ens36: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
        link/ether 00:0c:29:6c:2b:4a brd ff:ff:ff:ff:ff:ff
        inet 10.10.10.101/24 brd 10.10.10.255 scope global noprefixroute ens36
           valid_lft forever preferred_lft forever
        inet 169.254.6.205/19 brd 169.254.31.255 scope global ens36:1
           valid_lft forever preferred_lft forever
        inet6 fe80::e654:5dde:a383:d4cf/64 scope link noprefixroute
           valid_lft forever preferred_lft forever
    4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
        link/ether 52:54:00:04:9d:96 brd ff:ff:ff:ff:ff:ff
        inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
           valid_lft forever preferred_lft forever
    5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
        link/ether 52:54:00:04:9d:96 brd ff:ff:ff:ff:ff:ff
    

3.数据库安装(RAC1)

3.1上传安装包

  • 以root用户上传LINUX.X64_193000_db_home.zip到/u01/app/oracle/product/19c/db_1下

  • 更改所属用户,所属组

    [[email protected] ~]# cd /u01/app/oracle/product/19c/db_1
    [[email protected] db_1]# chown -R oracle:oinstall LINUX.X64_193000_db_home.zip
    

3.2 解压缩

  • 切换用户

    [[email protected] db_1]# su - oracle
    Last login: Tue Apr 19 09:24:47 CST 2022 on pts/0
    
  • 切换目录

    [[email protected]:/home/oracle]$cd $ORACLE_HOME
    [[email protected]:/u01/app/oracle/product/19c/db_1]$cd /u01/app/oracle/product/19c/db_1
    
  • 解压

    unzip LINUX.X64_193000_db_home.zip
    

3.3 安装数据库

  • 设置DISPLAY变量

    [[email protected]:/u01/app/oracle/product/19c/db_1] export DISPLAY=192.168.100.66:0.0
    
  • 运行安装程序

    [[email protected]:/u01/app/oracle/product/19c/db_1] ./runInstaller
    

    注:

    1.要投影安装界面的主机(192.168.100.66)的防火墙要关闭,否则会报类似以下错误,

    2.如果使用Xshell连接的服务器或者虚拟机的话,投影的机器或者宿主机要安装xMananger。

    [[email protected]:/u01/app/oracle/product/19c/db_1]$./runInstaller
    ERROR: Unable to verify the graphical display setup. This application requires X display. Make sure that xdpyinfo exist under PATH variable.
    Can't connect to X11 window server using '192.168.100.66:0.0' as the value of the DISPLAY variable.
    
  • 安装过程
    bg3buzj23p24020.png
    注:只安装数据库软件,安装数据库软件成功后,再创建实例。
    l32v020gjb04021.png
    424tvgkz0cd4022.png
    13rsmop1mg54023.png
    wtenerbkj0i4024.png
    stiyujr21sa4025.png
    yz2mhfif2db4026.png
    skpzgafya5p4027.png
    vp44u41gq3r4028.png
    主要是DNS的问题, 直接忽略即可。
    3lxnidr0cog4029.png
    1be0e31mcvf4030.png
    点击“Yes”
    nesvc2b0cui4031.png
    tx2g3wurimi4032.png
    hsqya5y1khl4033.png
    分别以root用户在rac1和rac2上运行该脚本
    qgeur03e4ee4034.png
    点击“Close”,安装完成

4.建库(RAC1)

4.1 调取安装界面

切换到grid用户,调取安装界面创建数据库

[[email protected] ~]# su - grid
Last login: Thu Apr 28 20:19:54 CST 2022
[[email protected]:/home/grid]$export DISPLAY=192.168.100.66:0.0
[[email protected]:/home/grid]$asmca

4.2 创建ASM的DG

rjk0pnujbpq4035.png
4d3nmq002pd4036.png
s131mjuboex4037.png
04udhdqkxtf4038.png
4nps3jigpcv4039.png
vpny2523wpt4040.png
关闭对话框

4.2 创建数据库

  • 切换到oracle用户并调用安装界面

    [[email protected]:/home/grid]$su - oracle
    Password:
    Last login: Mon Apr 25 21:42:45 CST 2022
    [[email protected]:/home/oracle]$export DISPLAY=192.168.100.66:0.0
    [[email protected]:/home/oracle]$dbca
    
  • 创建过程
    x2oxmvy25bq4041.png
    3r3v1q0aroc4042.png
    xzcaxsnm5bc4043.png
    ybyclfug3554044.png
    znxt4fofnmn4045.png
    注:可以不创建容器数据库,直接创建数据库,也可以根据需求创建容器数据库后,创建可插拔数据库。
    tomxd150hhp4046.png
    ycb1gahxtvd4047.png
    注:根据需求,决定是否开启归档,也可以在创建数据库后,开启归档,这里暂时不开启归档。
    uhcmsfkdx5p4048.png
    k2nb0loaqjw4049.png
    25qv44al40r4050.png
    t5jjzh2jebu4051.png
    注:选择字符AL32UTF8字符集
    mkwl2r20dwp4052.png
    注:根据需求选择是共享服务器模式还是独占服务器模式
    1tc5i3oyswi4053.png
    wwsmikouzub4054.png

azpd24t35mj4055.png

jtzrzci2hll4056.png

qeci153dr1j4057.png

xnxvqv5cvv54058.png

n4jkmxs5lcg4059.png

直接忽略
alvuhtm3o5o4060.png
cpglwu54koi4061.png
flrguqxu4104062.png
sk5ltmgeoe24063.png
vr415gxruoe4064.png

到此结束

Link to comment
Share on other sites