Oracle 26ai RAC搭建步骤:Linux 10.1双节点保姆级教程

2026-06-27阅读 0热度 0
搭建

一、Oracle Database 26ai 已于1月28日发布,可以在本地安装了。

先说个好消息——Oracle Database 26ai 于1月28日正式发布,现在可以在本地安装了。这对不少正在关注新版本的朋友来说,算是个值得动手尝鲜的信号。

1. 安装环境要求

先看看部署需要哪些条件:

  • 操作系统:Oracle Linux 10.1(下面会介绍)
  • 数据库:Oracle 26ai 23.26.1
  • 集群节点:2个到N个节点,也就是运行Oracle数据库服务器的主机。
  • 私有网络:RAC节点之间需要一个私有网络来处理内部通讯和Cache Fusion。
  • 共享存储:所有节点都需要能访问同一套共享存储设备,数据文件就放在上面。
  • 对外服务网络:客户端和应用通过这个网络来访问数据库。

2. IP规划

IP地址可以按照下面这张表来分配:

主机名称公网IPVIP私网IPSCAN IP
26ai01192.168.10.10192.168.10.1210.10.0.10192.168.10.15
26ai02192.168.10.11192.168.10.1310.10.0.11

配置虚拟机时如果遇到“安全警告”提示,直接点“忽略”就行。

进入虚拟机管理界面后,你会看到类似下面的画面:

二、Oracle Linux 10.1 介绍

Oracle Linux 是Oracle应用程序唯一推荐的Linux发行版,定位很明确——为关键任务工作负载提供最安全、可扩展且可靠的解决方案。搭载Unbreakable Enterprise Kernel之后,既能享受Oracle的深度优化,又能同步主流内核社区的最新功能。

这次发布的10.1版本,有不少值得关注的变化。

重要提示:更新版本是Oracle Linux发行版最新支持软件包的滚动快照,并不是一个独立的版本。所以千万不要把系统固定到某个特定更新版本上,务必始终更新到最新版,否则系统会暴露在安全漏洞和其他软件缺陷的风险中。

安装与启动

  • FIPS启动菜单:ISO安装镜像新增了 fips=1 启动菜单项,开启后系统会用FIPS批准的算法生成密钥并进行持续监控测试,方便符合《联邦信息处理标准》(FIPS)140的要求。
  • 逻辑卷使用UUID:安装后,/etc/fstab 中的逻辑卷设备会以UUID形式写入 fs_spec 字段。好处很明显——重命名或重新配置存储设备时更可靠,不用手动编辑 /etc/fstab,在LUKS重新加密或设备映射器路径变更后也能保持配置正确。

编译器与开发工具

  • dyninst 更新到13.0.0,改进了对AMD GPU二进制文件和x86指令/C++ DWARF解析的支持。
  • SystemTap 升级到5.3,引入了多线程解析功能,初始化速度更快。
  • elfutils 更新到0.193。
  • valgrind 升级到3.25.1,并且拆分为核心、脚本、GDB集成和文档等子包,按需安装即可,减少了占用空间。
  • llvm-toolset 升级到LLVM 20。
  • GCC工具集15 现已可用,能使用最新的编译器技术构建和部署应用。

网络

iproute2 更新到了6.14.0版本。

文件系统与存储

Multipathd 现在支持基于文件的套接字用于容器通信。守护进程监听 /run/multipathd.socket 文件以及抽象命名空间套接字。把这个套接字绑定挂载到容器中,就能轻松从容器内监控和配置多路径设备,无需额外网络配置。

高可用性与集群

  • IPaddr2 资源袋里会检查网络接口链路状态,接口宕机时能正确处理故障转移。默认启用,也可通过 check_link_status=false 关闭。
  • fence_sbd 袋里可以自动从 /etc/sysconfig/sbd 文件中读取SBD设备配置,简化了Pacemaker集群的隔离设置。
  • pcs 在移除最后一个隔离设备前会发出警告,避免集群陷入不支持的状态。如果用了 --force 选项,会显示警告信息。
  • pcs alert config 支持文本、JSON和cmd三种输出格式,方便自动化和复制告警配置。
  • pcs cluster rename 命令可以重命名集群,减少手动操作步骤。
  • pcs node 属性和利用率报告也支持文本、JSON和cmd格式输出。

内核与系统库

  • eBPF子系统 更新到6.14,引入了上游内核v6.14的增强功能。
  • Crash工具 更新到9.0.0,内部gdb数据库升级到16.2,并支持交叉编译。

操作系统的安装

1.1 操作系统安装

1.1.1 资源配置
4核CPU、8GB内存,两块网卡。

1.1.2 最小安装
不需要图形界面,最小化安装即可。安装完成后用下面命令验证一下:

[root@rac01 ~]# yum grouplist |grep -i install
Installed Environment Groups:
 Minimal Install

三、Oracle 26ai 2节点RAC安装步骤

1. 操作系统准备

1.1 安装版本确认

[root@26ai01 ~]# cat /etc/oracle-release
Oracle Linux Server release 10.1

1.2 关闭防火墙

systemctl disable --now firewalld

1.3 关闭SELINUX

grubby --update-kernel ALL --args selinux=0

1.4 关闭透明大页

vim /etc/default/grub
GRUB_CMDLINE_LINUX=… transparent_hugepage=never
grub2-mkconfig -o /boot/grub/grub.cfg

1.5 创建用户及组
先添加用户组:

groupadd -g 4330 oinstall
groupadd -g 4331 dba
groupadd -g 4332 racoper
groupadd -g 4323 asmdba
groupadd -g 4324 asmoper
groupadd -g 4325 asmadmin
groupadd -g 4326 oper
groupadd -g 4327 backupdba
groupadd -g 4328 dgdba
groupadd -g 4329 kmdba

再创建用户:

useradd -u 4330 -g oinstall -G asmoper,asmadmin,asmdba grid
useradd -u 4331 -g oinstall -G dba,asmdba,backupdba,dgdba,kmdba,oper,asmadmin oracle

1.6 配置用户环境变量
注意节点2的 ORACLE_SID 需要修改。下面是grid用户的配置:

cat /home/grid/.bash_profile
export ORACLE_BASE=/u01/app/grid
export ORACLE_HOME=/u01/app/26.1.0/grid
export ORACLE_SID=ASM1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32

oracle用户的配置:

cat /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/26.1.0/dbhome_1
export ORACLE_SID=orcl1
export PATH=$ORACLE_HOME/bin:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32

1.7 创建相关目录

mkdir -p /u01/app/26.1.0/grid
mkdir -p /u01/app/grid
mkdir -p /u01/app/oracle/product/26.1.0/dbhome_1
chown -R grid:oinstall /u01/app
chown -R oracle:oinstall /u01/app/oracle
chmod -R 775 /u01/app

1.8 设置用户limit
编辑 /etc/security/limits.conf

oracle soft nproc 655350
oracle hard nproc 655350
oracle soft nofile 655360
oracle hard nofile 655360
grid soft nproc 655350
grid hard nproc 655350
grid soft nofile 655360
grid hard nofile 655360
oracle soft stack 102400
oracle hard stack 327680
grid soft stack 102400
grid hard stack 327680
oracle soft memlock -1
oracle hard memlock -1
grid soft memlock -1
grid hard memlock -1

1.9 修改内核参数
在9及以上版本,/etc/sysctl.conf 下配置仍然可以生效,但推荐修改 /etc/sysctl.d/99-oracle.conf 文件,然后执行 sysctl -p 使参数生效。
不过,26ai 有个非常实用的特性——Automatic Self Correction,内核参数这里其实可以不设置,系统会自动修复。

1.10 存储设置
创建共享磁盘。如果是验证环境,使用外部冗余,只需要创建一个大小为2GB的磁盘作为集群盘。
整体存储组件规划如下:

存储组件文件系统卷大小ASM卷组名ASM冗余磁盘名
CRS/表决磁盘2GCRSExternalOCR_VOTE01
数据库区10GDATAExternaldata-disk1
数据库区10GDATAExternaldata-disk2
数据库区10GDATAExternaldata-disk3
快速恢复区10GFRAExternalarc-disk1

1.11 设置SSH节点互通性
在Grid Infrastructure和Database安装过程中,Oracle Universal Installer (OUI) 必须能以grid用户身份自动将软件复制到所有RAC节点。所以需要配置SSH免密登录。
首先两个节点之间要能互相ping通。然后在节点1生成密钥:

ssh-keygen -t rsa

1.12 使用udev配置ASM磁盘
编辑 /etc/udev/rules.d/99-oracle-asmdevices.rules

KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29880964c565368339d1ace12bf", RUN+="/bin/sh -c 'mknod /dev/OCR_VOTE01 b $major $minor; chown grid:asmadmin /dev/OCR_VOTE01; chmod 0660 /dev/OCR_VOTE01'"
KERNEL=="sd*", ENV{DEVTYPE}=="disk", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d $devnode", RESULT=="36000c29e5fa178e0c36ae73183ac88f8", RUN+="/bin/sh -c 'mknod /dev/data-disk2 b $major $minor; chown grid:asmadmin /dev/data-disk2; chmod 0660 /dev/data-disk2'"

然后手动加载规则:

/sbin/udevadm trigger --type=devices --action=change
udevadm control --reload-rules

验证结果:

[root@rac01 ~]# ls -ltr /dev/asm*
brw-rw---- 1 grid asmadmin 8, 32 Jan 29 15:46 /dev/data_disk1
brw-rw---- 1 grid asmadmin 8, 48 Jan 29 15:46 /dev/data_disk2
brw-rw---- 1 grid asmadmin 8, 64 Jan 29 15:46 /dev/data_disk3
brw-rw---- 1 grid asmadmin 8, 16 Jan 29 15:46 /dev/OCR_VOTE01
brw-rw---- 1 grid asmadmin 8, 16 Jan 29 15:46 /dev/arc-disk1

1.13 GI安装

解压安装文件:

su – grid
unzip -d $ORACLE_HOME LINUX.X64_2326100_grid_home.zip

启动安装:

cd $ORACLE_HOME
./gridSetup.sh

安装过程中的截图如下:

安装过程中,需要手动在两个节点的root窗口执行对应的脚本。

节点1:

[root@26ai01 grid]# /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.

[root@26ai01 grid]# /u01/app/26.1.0/grid/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/26.1.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" ha ve not changed. No need to overwrite.
The contents of "oraenv" ha ve not changed. No need to overwrite.
The contents of "coraenv" ha ve not changed. No need to overwrite.
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.
RAC option enabled on: Linux
Executing command '/u01/app/26.1.0/grid/perl/bin/perl -I/u01/app/26.1.0/grid/perl/lib -I/u01/app/26.1.0/grid/crs/install /u01/app/26.1.0/grid/crs/install/rootcrs.pl '
Using configuration parameter file: /u01/app/26.1.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
/u01/app/grid/crsdata/26ai01/crsconfig/rootcrs_26ai01_2026-01-30_05-15-27PM.log
2026/02/02 10:15:32 CLSRSC-594: Executing installation step 1 of 18: 'ValidateEnv'.
2026/02/02 10:15:33 CLSRSC-594: Executing installation step 2 of 18: 'CheckRootCert'.
2026/02/02 10:15:33 CLSRSC-594: Executing installation step 3 of 18: 'GenSiteGUIDs'.
2026/02/02 10:15:34 CLSRSC-594: Executing installation step 4 of 18: 'SetupOSD'.
Redirecting to /bin/systemctl restart rsyslog.service
2026/02/02 10:15:35 CLSRSC-594: Executing installation step 5 of 18: 'CheckCRSConfig'.
2026/02/02 10:15:35 CLSRSC-594: Executing installation step 6 of 18: 'SetupLocalGPNP'.
2026/02/02 10:15:39 CLSRSC-594: Executing installation step 7 of 18: 'CreateRootCert'.
2026/02/02 10:15:54 CLSRSC-594: Executing installation step 8 of 18: 'ConfigOLR'.
2026/02/02 10:15:57 CLSRSC-594: Executing installation step 9 of 18: 'ConfigCHMOS'.
2026/02/02 10:15:57 CLSRSC-594: Executing installation step 10 of 18: 'CreateOHASD'.
2026/02/02 10:15:58 CLSRSC-594: Executing installation step 11 of 18: 'ConfigOHASD'.
2026/02/02 10:15:58 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'
2026/02/02 10:16:09 CLSRSC-594: Executing installation step 12 of 18: 'SetupTFA'.
2026/02/02 10:16:09 CLSRSC-594: Executing installation step 13 of 18: 'InstallACFS'.
2026/02/02 10:16:11 CLSRSC-594: Executing installation step 14 of 18: 'CheckFirstNode'.
2026/02/02 10:16:11 CLSRSC-594: Executing installation step 15 of 18: 'InitConfig'.
CRS-4256: Updating the profile
Successful addition of voting disk 437b597e62964f78bf2e4f997f8a3845.
Successfully replaced voting disk group with  crsdg.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 437b597e62964f78bf2e4f997f8a3845 (/dev/asm_ocr01) [CRSDG]
Located 1 voting disk(s).
2026/02/02 10:17:15 CLSRSC-594: Executing installation step 16 of 18: 'StartCluster'.
2026/02/02 10:17:15 CLSRSC-4002: Successfully installed Oracle Autonomous Health Framework (AHF).
2026/02/02 10:17:35 CLSRSC-343: Successfully started Oracle Clusterware stack
2026/02/02 10:17:39 CLSRSC-594: Executing installation step 17 of 18: 'ConfigNode'.
clscfg: EXISTING configuration version 23 detected.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
2026/02/02 10:18:04 CLSRSC-594: Executing installation step 18 of 18: 'PostConfig'.
2026/02/02 10:18:18 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

节点2:

[root@26ai02 grid]# /u01/app/26.1.0/grid/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/26.1.0/grid
Enter the full pathname of the local bin directory: [/usr/local/bin]: 
...(输出内容与节点1类似,此处省略部分日志)
2026/02/02 10:19:41 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
2026/02/02 10:20:17 CLSRSC-4002: Successfully installed Oracle Autonomous Health Framework (AHF).

最后验证一下GI是否安装成功:

1.13 ASM磁盘组创建

用grid用户启动ASMCA:

[root@26ai01 grid]$ asmca &

到此,ASM磁盘组创建完成。

1.14 RAC数据库软件安装

切换到oracle用户,解压安装文件:

su - oracle
unzip -d $ORACLE_HOME LINUX.X64_2326100_db_home.zip

启动安装:

cd $ORACLE_HOME
./runInstaller &

这里和GI安装一样,建议手工配置SSH对等性,否则会报错。

同样不勾选自动执行脚本,手工去执行:

到此,Oracle数据库软件安装完成。

1.15 创建数据库

使用grid用户启动DBCA(注意实际操作用oracle用户也可):

[root@26ai01 grid]$ dbca &

口令不符合标准时,可以暂时忽略:

四、Oracle 26ai 2节点RAC安装完成

至此,整个安装流程就走完了。来看看最终的效果:

免责声明

本网站新闻资讯均来自公开渠道,力求准确但不保证绝对无误,内容观点仅代表作者本人,与本站无关。若涉及侵权,请联系我们处理。本站保留对声明的修改权,最终解释权归本站所有。

相关阅读

更多
欢迎回来 登录或注册后,可保存提示词和历史记录
登录后可同步收藏、历史记录和常用模板
注册即表示同意服务条款与隐私政策