在当今企业级应用中,Oracle RAC(Real Application Clusters)因其高可用性和可伸缩性而备受青睐。CentOS作为一个免费且功能丰富的Linux发行版,常被用作Oracle RAC的部署平台。本文将详细介绍如何在CentOS上自动化部署Oracle RAC,以构建一个高效稳定的集群系统。
一、准备工作
在开始自动化部署之前,我们需要做好以下准备工作:
- 硬件环境:确保所有节点硬件配置一致,包括CPU、内存、硬盘等。
- 软件环境:安装必要的软件包,如Oracle Database、Oracle Grid Infrastructure等。
- 网络环境:配置好集群内部网络,确保节点间通信无阻。
- 用户权限:创建Oracle用户,并赋予相应的权限。
二、自动化部署脚本
以下是自动化部署Oracle RAC的脚本示例,该脚本基于bash编写:
”`bash #!/bin/bash
定义变量
ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1 GRID_HOME=/u01/app/oracle/product/19.3.0/grid ORACLE_BASE=/u01/app/oracle CLUSTER_NAME=rac1 NODE_NAME=node1 HOSTNAME=rac1.example.com GNS_ADMIN=gnsadmin GNS_PASSWD=123456
安装依赖
yum install -y oracle-rdbms-server-19c oracle-xmldb-19c oracle-advanced-security-19c oracle-grid-infrastructure-19c
配置主机名和IP
echo “\(HOSTNAME" > /etc/hostname echo "127.0.0.1 \)HOSTNAME” >> /etc/hosts echo “\(NODE_NAME \)HOSTNAME” >> /etc/hosts
配置Oracle用户
useradd -m -d \(ORACLE_BASE/oracle -s /bin/bash oracle echo "oracle:\)GNS_PASSWD” | chpasswd
配置Oracle环境变量
echo “export ORACLE_HOME=\(ORACLE_HOME" >> /home/oracle/.bashrc echo "export PATH=\)PATH:\(ORACLE_HOME/bin" >> /home/oracle/.bashrc echo "export ORACLE_BASE=\)ORACLE_BASE” >> /home/oracle/.bashrc echo “export ORACLE_HOME=\(ORACLE_HOME" >> /home/oracle/.bashrc echo "export ORACLE_SID=\)CLUSTER_NAME” >> /home/oracle/.bashrc source /home/oracle/.bashrc
配置GNS
\(GRID_HOME/bin/configGNS -create -n \)CLUSTER_NAME -a \(GNS_ADMIN -p \)GNS_PASSWD
配置OCR
\(GRID_HOME/bin/crsconfig -createocr -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
\(GRID_HOME/bin/crsconfig -createocrmirror -n \)CLUSTER_NAME -o $ORACLE_BASE/oradata/ocr_mirror
配置OCR镜像
$GRID_HOME/bin/crsconfig -createocrmirror -n
