暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

第119期:Oracle 26ai Grid Infrastructure Installation and Upgrade Guide for Oracle Linux 9 (OL9)

原创 ByteHouse 2026-01-31
65

摘要:安装Oracle 26ai oraclerestart.

1.环境描述

Oracle 在 2026 年 1 月 27 日发布官方更新,宣布 Oracle AI Database 26ai Enterprise Edition 已作为 2026 年 1 月季度 Release Update(23.26.1),正式支持 Linux x86-64 的本地部署(on-premises)
本文将基于 Oracle 官方文档建议的 Oracle Linux 9(建议使用最新 release level;本文采用 OL 9.6),安装 26ai 企业版本地部署与验证流程。

step 1.下载数据库软件,LINUX.X64_2326100_db_home.zip
https://www.oracle.com/database/technologies/oracle26ai-linux-downloads.html

step 2.下载操作系统,Oracle Linux 9.6
https://yum.oracle.com/oracle-linux-isos.html

2.Oracle Installation Prerequisites

2.1 关闭防火墙

systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state

2.2 关闭selinux

setenforce 0
sed -ri 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
sestatus

2.3 安装依赖包

dnf install -y bc
dnf install -y binutils
dnf install -y compat-openssl11
dnf install -y elfutils-libelf
dnf install -y fontconfig
dnf install -y glibc
dnf install -y glibc-devel
dnf install -y glibc-headers
dnf install -y ksh
dnf install -y libaio
dnf install -y libasan
dnf install -y liblsan
dnf install -y libX11
dnf install -y libXau
dnf install -y libXi
dnf install -y libXrender
dnf install -y libXtst
dnf install -y libxcrypt-compat
dnf install -y libgcc
dnf install -y libibverbs
dnf install -y librdmacm
dnf install -y libstdc++
dnf install -y libxcb
dnf install -y libvirt-libs
dnf install -y make
dnf install -y policycoreutils
dnf install -y policycoreutils-python-utils
dnf install -y smartmontools
dnf install -y sysstat
dnf install -y nfs-utils

# 检查安装包
rpm -q bc binutils compat-openssl11 elfutils-libelf fontconfig glibc glibc-devel glibc-headers ksh libaio libasan libX11 libXau libXi libXrender libXtst libxcrypt-compat libgcc libibverbs librdmacm libstdc++ libxcb libvirt-libs make policycoreutils policycoreutils-python-utils smartmontools sysstat nfs-utils | grep "not installed"

2.4 配置hosts文件

cat >> /etc/hosts << "EOF"

192.168.56.105    bigdata

EOF

2.5.插入式认证模块配置:

使用 root 用户修改以下文件/etc/pam.d/login,增加如下内容:

cat >> /etc/pam.d/login <<EOF
session    required     pam_limits.so
EOF

Note:limits.conf 文件实际是 Linux PAM(插入式认证模块,Pluggable Authentication Modules)中 pam_limits.so 的配置文件,而且只针对于单个会话。

3.Installation

3.1.Automatic Setup

如果您的 Linux 发行版是 Oracle Linux 或 Red Hat Enterprise Linux,并且您是 Oracle Linux 支持客户,那么您可以使用适用于您版本的 Oracle AI 数据库预安装 RPM 完成大多数预安装配置任务。

# 下载到本地进行安装
wget https://yum.oracle.com/repo/OracleLinux/OL9/appstream/x86_64/getPackage/oracle-ai-database-preinstall-26ai-1.0-1.el9.x86_64.rpm

# 安装预安装包
dnf install -y oracle-ai-database-preinstall-26ai-1.0-1.el9.x86_64.rpm

3.2.Manual Setup

step 1.Create the new groups and users.

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

useradd -u 54331 -g oinstall -G asmoper,asmdba,asmadmin,racdba grid

useradd -u 54321 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,asmdba,racdba  oracle

Uncomment the extra groups you require.

$ id grid
uid=54331(grid) gid=54321(oinstall) groups=54321(oinstall),54327(asmdba),54329(asmadmin),54330(racdba)

$ id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba), 
54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54327(asmdba),54330(racdba)

step 2.Add the following lines to the “/etc/sysctl.conf” file, or in a file called “/etc/sysctl.d/99-oracle-ai-database-preinstall-26ai-sysctl.conf”.

# oracle-ai-database-preinstall-26ai setting for fs.file-max is 6815744
fs.file-max = 6815744

# oracle-ai-database-preinstall-26ai setting for kernel.sem is '250 32000 100 128'
kernel.sem = 250 32000 100 128

# oracle-ai-database-preinstall-26ai setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# oracle-ai-database-preinstall-26ai setting for kernel.shmall is 1073741824 on x86_64
kernel.shmall = 1073741824

# oracle-ai-database-preinstall-26ai setting for kernel.shmmax is 4398046511104 on x86_64
kernel.shmmax = 4398046511104

# oracle-ai-database-preinstall-26ai setting for kernel.panic_on_oops is 1 per Orabug 19212317
kernel.panic_on_oops = 1

# oracle-ai-database-preinstall-26ai setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# oracle-ai-database-preinstall-26ai setting for net.core.rmem_max is 4194304
net.core.rmem_max = 4194304

# oracle-ai-database-preinstall-26ai setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# oracle-ai-database-preinstall-26ai setting for net.core.wmem_max is 1048576
net.core.wmem_max = 1048576

# oracle-ai-database-preinstall-26ai setting for net.ipv4.conf.all.rp_filter is 2
net.ipv4.conf.all.rp_filter = 2

# oracle-ai-database-preinstall-26ai setting for net.ipv4.conf.default.rp_filter is 2
net.ipv4.conf.default.rp_filter = 2

# oracle-ai-database-preinstall-26ai setting for fs.aio-max-nr is 1048576
fs.aio-max-nr = 1048576

# oracle-ai-database-preinstall-26ai setting for vm.hugetlb_shm_group is gid of primary group of 'oracle' user
vm.hugetlb_shm_group = 54321

# oracle-ai-database-preinstall-26ai setting special parameters BEGIN
# oracle-ai-database-preinstall-26ai setting for kernel.panic is 10
kernel.panic = 10

# oracle-ai-database-preinstall-26ai setting for net.ipv4.ip_local_port_range is 9000 65535
net.ipv4.ip_local_port_range = 9000 65535

# oracle-ai-database-preinstall-26ai setting special parameters END

Run one of the following commands to change the current kernel parameters, depending on which file you edited.

/sbin/sysctl -p
# Or
/sbin/sysctl -p /etc/sysctl.d/98-oracle.conf

step 3.Add the following lines to a file called “/etc/security/limits.d/oracle-ai-database-preinstall-26ai.conf” file.

gird soft nofile  1024
gird hard nofile  65536
gird soft nproc  16384
gird hard nproc  16384
gird soft stack  10240
gird hard stack  32768
gird hard memlock  134217728
gird soft memlock  134217728
gird soft data  unlimited
gird hard data  unlimited

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
oracle soft data  unlimited
oracle hard data  unlimited

step 4.Add NOZEROCONF

cat >> /etc/sysconfig/network <<EOF

# oracle-ai-database-preinstall-26ai : Add NOZEROCONF=yes
NOZEROCONF=yes
EOF

step 4.If you are not using Oracle Linux and UEK, you will need to manually disable transparent huge pages.

  • grubby 工具自动配置
    若后续检测发现参数丢失,或需要重新配置,推荐使用Oracle 官方工具grubby(安全,自动更新所有内核配置,无需手动编辑 grub 文件,避免语法错误),不建议直接手动改/etc/default/grub(易出错)。
# 1. 为所有内核添加numa=off
grubby --update-kernel=ALL --args="numa=off"
# 2. 为所有内核添加transparent_hugepage=madvise
grubby --update-kernel=ALL --args="transparent_hugepage=madvise"
# 3. 验证配置是否写入(可选,执行后会显示所有内核的参数)
grubby --info=ALL
  • 手动编辑 grub 配置
    若习惯手动编辑,需修改核心配置文件/etc/default/grub,并重新生成 grub 启动配置(OL9 为 grub2):
# 1. 编辑grub核心配置文件
vi /etc/default/grub
# 2. 找到GRUB_CMDLINE_LINUX行,在末尾添加核心参数,修改后如下(适配你的LVM配置):
GRUB_CMDLINE_LINUX="crashkernel=1G-64G:448M,64G-:512M resume=/dev/mapper/ol-swap rd.lvm.lv=ol/root rd.lvm.lv=ol/swap numa=off transparent_hugepage=madvise"

# 3. 保存退出(vi按ESC,输入:wq)
# 4. 重新生成grub2启动配置(OL9 x86_64必执行,否则修改不生效)
grub2-mkconfig -o /boot/efi/EFI/ol/grub.cfg
# 5. 若为BIOS启动的OL9,执行以下生成命令(替代上一步):
# grub2-mkconfig -o /boot/grub2/grub.cfg
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 rhgb quiet transparent_hugepage=madvise"
GRUB_DISABLE_RECOVERY="true"

已执行reboot重启 OL9 系统(参数需重启后永久生效),执行以下命令验证核心参数是否真正生效,确保 Oracle 26ai 安装无隐患:
验证 1:检查所有内核的启动参数(必看)

# 筛选出包含numa=off和transparent_hugepage=madvise的配置
grubby --info=ALL | grep -E 'numa=off|transparent_hugepage=madvise'

预期结果:显示 3 行(对应你的 3 个内核),每行均包含numa=off和transparent_hugepage=madvise,与你的日志末尾的参数一致。

验证 2:检查透明大页运行时参数(即时生效验证)

# 检查透明大页启用模式
cat /sys/kernel/mm/transparent_hugepage/enabled
# 检查透明大页碎片整理模式
cat /sys/kernel/mm/transparent_hugepage/defrag

预期结果:两个命令输出均为[madvise] always never(madvise带中括号,为当前生效模式)。
验证 3:检查 NUMA 是否已关闭

# 检查NUMA状态
numactl --hardware

预期结果:输出node 0 cpus: 0 1 2 3 …(仅一个 node),或提示NUMA support disabled,说明 NUMA 已关闭。

4.配置Oracle环境

step 1.Create the directories in which the Oracle software will be installed.
安装 Oracle 软件,请按照 Oracle 最优灵活架构 (OFA) 建议创建 Oracle 基础目录和 Oracle 清单目录。并为这些目录指定正确的所有者、组和权限。

mkdir -p /u01/app/23.0.0/grid
mkdir -p /u01/app/grid

chown -R grid:oinstall /u01
chmod -R 775 /u01/

step 2.Create a “scripts” directory.

su - grid
cat >> /home/grid/.bash_profile <<EOF

# Oracle 26ai Settings (AI Database)
TMP=/tmp; export TMP
TMPDIR=\$TMP; export TMPDIR

ORACLE_SID=+ASM;export ORACLE_SID
ORACLE_BASE=/u01/app/grid; export ORACLE_BASE
ORACLE_HOME=/u01/app/23.0.0/grid; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM


PATH=/usr/sbin:\$PATH; export PATH
PATH=\$ORACLE_HOME/bin:\$PATH; export PATH
PATH=\$PATH:\$ORACLE_HOME/OPatch; export PATH

export NLS_LANG="AMERICAN_AMERICA.ZHS16GBK"
export NLS_DATE_FORMAT="yyyy-mm-dd hh24:mi:ss"

LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib; export CLASSPATH
EOF

立即生效环境变量

source ~/.bash_profile

step 3.编辑 /etc/profile

cat >> /etc/profile <<EOF
# Setting the appropriate ulimits for oracle and grid user
if [ $USER = "grid" ]; then
     if [ $SHELL = "/bin/ksh" ]; then
        ulimit -u 16384
        ulimit -n 65536
     else
        ulimit -u 16384 -n 65536
     fi
fi
EOF

5.配置存储,初始化OracleASM

安装Oracleasm包

dnf install oracleasmlib-3.1.1-1.el9.x86_64.rpm oracleasm-support-3.1.1-3.el9.x86_64.rpm -y

初始化:

[root@oracle rpm]# oracleasm configure -i
Configuring the Oracle ASM system service.

This will configure the on-boot properties of the Oracle ASM system
service.  The following questions will determine whether the service
is started on boot and what permissions it will have.  The current
values will be shown in brackets ('[]').  Hitting <ENTER> without
typing an answer will keep that current value.  Ctrl-C will abort.

Default user to own the ASM disk devices []: grid
Default group to own the ASM disk devices []: asmadmin
Start Oracle ASM system service on boot (y/n) [y]: y
Scan for Oracle ASM disks when starting the oracleasm service (y/n) [y]: y
Maximum number of ASM disks that can be used on system [2048]: 
Enable iofilter if kernel supports it (y/n) [y]: y
Writing Oracle ASM system service configuration: done

Configuration changes only come into effect after the Oracle ASM
system service is restarted.  Please run 'systemctl restart oracleasm'
after making changes.

WARNING: All of your Oracle and ASM instances must be stopped prior
to restarting the oracleasm service.

[root@oracle rpm]# 

配置修改仅在重启Oracle ASM系统服务后生效,
请在完成配置后执行命令「systemctl restart oracleasm」。
【警告】重启oracleasm服务前,必须停止所有Oracle数据库实例和ASM实例。

完成对ASMLIB的配置后,启用并启动 oracleasm服务

systemctl restart oracleasm

使磁盘对 ASMLIB 可用

[root@localhost Packages]# oracleasm createdisk DATA0 /dev/sda
oracleasm module not loaded or /dev/oracleasm not mounted.
[root@localhost Packages]# 

加载asm库文件:

[root@localhost Packages]# /etc/init.d/oracleasm status
Checking if ASM is loaded: no
Checking if /dev/oracleasm is mounted: no
[root@xxjjzd-jcpt-data Packages]# /etc/init.d/oracleasm start
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]
[root@localhost Packages]#
[root@localhost Packages]# /etc/init.d/oracleasm enable
Writing Oracle ASM library driver configuration: done
Initializing the Oracle ASMLib driver: [ OK ]
Scanning the system for Oracle ASMLib disks: [ OK ]

创建asm磁盘:
[root@localhost ~]# oracleasm createdisk DATA0 /dev/sda1 
Writing disk header: done
Instantiating disk: done
[root@localhost ~]#

6.Installation

6.1.安装前

step 1.Log into the oracle user. If you are using X emulation then set the DISPLAY environmental variable.

DISPLAY=<machine-name>:0.0; export DISPLAY

Unless you are working from the console, or using SSH tunnelling, login as root and issue the following command.

xhost +<machine-name>

step 2.解压软件

# Unzip software.
cd $ORACLE_HOME
unzip -q LINUX.X64_2326100_grid_home.zip -d $ORACLE_HOME

step 3.安装 cvuqdisk

cd  $ORACLE_HOME/cv/rpm/

dnf install cvuqdisk-1.0.10-1.rpm

6.2.安装grid

./gridSetup.sh


You can run the gridSetup.sh command with oracle_install_crs_AHF_InstallLoc=path and oracle_install_crs_AHF_RepositoryLoc=path flags to change Autonomous Health Framework (AHF) install location and repository location respectively.
Run the root scripts when prompted.

[root@oracle dev]# /u01/app/23.0.0/grid/root.sh
Performing root user operation.

The following environment variables are set as:
    ORACLE_OWNER= grid
    ORACLE_HOME=  /u01/app/23.0.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]: 
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

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.
Executing command '/u01/app/23.0.0/grid/perl/bin/perl -I/u01/app/23.0.0/grid/perl/lib -I/u01/app/23.0.0/grid/crs/install /u01/app/23.0.0/grid/crs/install/roothas.pl '
Using configuration parameter file: /u01/app/23.0.0/grid/crs/install/crsconfig_params
The log of current session can be found at:
  /u01/app/grid/crsdata/oracle/crsconfig/roothas_2026-01-31_09-58-47AM.log
Redirecting to /bin/systemctl restart rsyslog.service
LOCAL ADD MODE 
Creating OCR keys for user 'grid', privgrp 'oinstall'..
Operation successful.
2026/01/31 09:59:16 CLSRSC-330: Adding Clusterware entries to file 'oracle-ohasd.service'

oracle     2026/01/31 10:00:41     /u01/app/grid/crsdata/oracle/olr/backup_20260131_100041.olr     2107015493     
2026/01/31 10:00:43 CLSRSC-327: Successfully configured Oracle Restart for a standalone server
[root@oracle dev]# 

执行脚本的日志:

/u01/app/grid/crsdata/oracle/crsconfig/roothas_2026-01-31_02-11-32PM.log

Caution
After installation is complete, do not remove manually or run cron jobs that remove /tmp/.oracle or /var/tmp/.oracle directories or their files while Oracle software is running on the server. If you remove these files, then the Oracle software can encounter intermittent delays. Oracle Clusterware installations can fail with the error:
“CRS-0184: Cannot communicate with the CRS daemon.”

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论