“Silent Install” der Oracle Grid Infrastructure

19. Juli 2024 Aus Von Markus Flechtner

Ich sehe es immer wieder bei Kunden, dass die Oracle Software, insbesondere die Grid Infrastructure, über die GUI installiert. X-mal klicken und dann läuft die Installation. In Zeiten von Automatisierung und “Infrastructure as Code” ist das aber nicht mehr so ganz zeitgemäß. Zumal die “Silent Installation” über die Kommandozeile auch recht einfach ist. Schauen wir doch mal, wie das geht.

Unsere (virtuelle) Hardware:

2 virtuelle Maschinen mit Oracle Linux 8.10 (2 vCPU, 16 GB RAM)

  • lucky-luke
  • jolly-jumper
[root@jolly-jumper ~]# cat /etc/oracle-release
Oracle Linux Server release 8.10

[root@jolly-jumper ~]# cat /etc/hosts
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1	localhost
255.255.255.255	broadcasthost

#	#######################################################################
#	Cluster wild-west
#######################################################################
192.168.1.164	lucky-luke.markusdba.internal lucky-luke
192.168.2.164	lucky-luke-priv
192.168.1.165	lucky-luke-vip.markusdba.internal
192.168.1.166  jolly-jumper.markusdba.internal
192.168.2.166  jolly-jumper-priv
192.168.1.167  jolly-jumper-vip.markusdba.internal
#scan 192.168.1.168 wild-west.markusdba.internal
#scan 192.168.1.169 wild-west.markusdba.internal
#scan 192.168.1.170 wild-west.markusdba.internal

Vorbereitungen

Gruppen, Benutzer und Verzeichnisse sind bereits vorbereitet:

[root@jolly-jumper ~]# cat /etc/group
[...]
dba:x:54321:oracle
oinstall:x:54322:
asmdba:x:54323:oracle,grid
asmadmin:x:54324:grid
kmdba:x:54325:oracle
dgdba:x:54326:oracle
backupdba:x:54327:oracle
racdba:x:54328:oracle,grid
oper:x:54329:oracle
asmoper:x:54330:grid

[root@jolly-jumper ~]# cat /etc/passwd
[...]
oracle:x:54331:54322::/home/oracle:/bin/bash
grid:x:54332:54322::/home/grid:/bin/bash

Für beide Benutzer sind auch die ssh-keys generiert und ausgetauscht, so dass passwordfreier Zugang auf den jeweils anderen Rechner möglich ist. In Kurzform:

ssh-keygen
ssh-copy-id <anderer-Rechner>

Verzeichnisse und Zugriffsrechte:

mkdir -p /u00/app/oracle/diag
mkdir -p /u00/app/oracle/stage       # Staging-Verzeichnis
mkdir -p /u00/app/oracle/product/19.24   # ORACLE_HOME fuer Grid Infrastructure
mkdir -p /u00/app/grid/product/19.24     # ORACLE_HOME fuer RDBMS-Software
mkdir -p /u00/app/oraInventory        # zentrales Inventory
mkdir -p /u00/app/oracle/network 2>/dev/null
mkdir -p /u00/app/oracle/admin 2>/dev/null
mkdir -p /u00/app/oracle/audit 2>/dev/null
mkdir -p /u00/app/oracle/diag 2>/dev/null
mkdir -p /u00/app/grid/product 2>/dev/null
mkdir -p /u00/app/oracle/product 2>/dev/null
mkdir -p /u00/app/oracle/stage 2>/dev/null

chown -R oracle:oinstall /u0*
chown -R oracle:oinstall /u00/app/oracle
chown -R oracle:oinstall /u00/app/oracle/*
chown -R grid:oinstall /u00/app/oraInventory
chown -R grid:oinstall /u00/app/grid
chown -R grid:oinstall /u00/app/grid/*

chmod -R g+w /u00/app/oracle
chmod -R g+w /u00/app/oracle/diag
chmod -R g+w /u00/app/oracle/admin
chmod -R g+w /u00/app/oracle/network

Wie man an den Pfadnamen sieht, installieren wir den Versionsstand 19.24 (= Release Update Juli 2024).

Auch die Platten für ASM sind mit passenden udev-Regeln vorbereitet:

[grid@lucky-luke ~]$ cat /etc/udev/rules.d/99-asm-disks.rules
# /dev/sdb1
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="0QEMU_QEMU_HARDDISK_3b3f22de-48b3-4d48-a3da-800736c049b8", SYMLINK+="oracle-asm/asm-disk-1", OWNER="grid", GROUP="asmadmin", MODE="0660"
# /dev/sdc1
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="0QEMU_QEMU_HARDDISK_2cb24fac-3c8b-4a7c-8fd9-9b4de681fe2a", SYMLINK+="oracle-asm/asm-disk-2", OWNER="grid", GROUP="asmadmin", MODE="0660"
# /dev/sdd1
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="0QEMU_QEMU_HARDDISK_d3dd430a-73fd-4745-80ee-679eab4487bc", SYMLINK+="oracle-asm/asm-disk-3", OWNER="grid", GROUP="asmadmin", MODE="0660"
# /dev/sde1
KERNEL=="sd?1", SUBSYSTEM=="block", PROGRAM=="/usr/lib/udev/scsi_id -g -u -d /dev/$parent", RESULT=="0QEMU_QEMU_HARDDISK_36d89334-11cb-4033-afdf-6b50963cc6a5", SYMLINK+="oracle-asm/asm-disk-4", OWNER="grid", GROUP="asmadmin", MODE="0660"
[grid@lucky-luke ~]$
[grid@lucky-luke ~]$ cd /dev/oracle-asm
[grid@lucky-luke oracle-asm]$ ls -l
total 0
lrwxrwxrwx. 1 root root 7 Jul 19 21:05 asm-disk-1 -> ../sdc1
lrwxrwxrwx. 1 root root 7 Jul 19 21:05 asm-disk-2 -> ../sdb1
lrwxrwxrwx. 1 root root 7 Jul 19 21:05 asm-disk-3 -> ../sdd1
lrwxrwxrwx. 1 root root 7 Jul 19 21:05 asm-disk-4 -> ../sde1

Auspacken der Software

Die Software liegt bei mir in einem Verzeichnis, das ich im Folgenden über die Variable SW_DIR ansprechen werde; analog der Patch über die Variable PATCH_DIR:

[grid@lucky-luke ~]$ export SW_DIR=/mnt/software/oracle-software/RDBMS/19c/19.3-linux-x86-64
[grid@lucky-luke ~]$ export PATCH_DIR=/mnt/software/oracle-software/patches/2024/2024-07-linux-x86-64-19.24
[grid@lucky-luke ~]$ export ORACLE_HOME=/u00/app/grid/product/19.24
[grid@lucky-luke ~]$ mkdir -p $ORACLE_HOME

[grid@lucky-luke ~]$ cd $ORACLE_HOME
[grid@lucky-luke 19.24]$ unzip -q $SW_DIR/LINUX.X64_193000_grid_home.zip 

OPatch aktualisieren

[grid@lucky-luke 19.24]$ rm -rf $ORACLE_HOME/OPatch
[grid@lucky-luke 19.24]$ unzip -q $PATCH_DIR/p6880880_190000_Linux-x86-64.zip

Release Update auspacken

[grid@lucky-luke ~]$ cd /u00/app/oracle/stage/
[grid@lucky-luke stage]$ unzip -q $PATCH_DIR/p36582629_190000_Linux-x86-64-gi-2024-07-19.24.zip

Release Update installieren

[grid@lucky-luke stage]$ cd $ORACLE_HOME
[grid@lucky-luke 19.24]$ ./gridSetup.sh -silent -applyRU /u00/app/oracle/stage/36582629
Preparing the home to patch...
Applying the patch /u00/app/oracle/stage/36582629...
Successfully applied the patch.
The log can be found at: /tmp/GridSetupActions2024-07-18_09-47-45PM/installerPatchActions_2024-07-18_09-47-45PM.log
Launching Oracle Grid Infrastructure Setup Wizard...

[FATAL] [INS-40426] Grid installation option has not been specified.
   ACTION: Specify the valid installation option.

Paket cvuqdisk installieren

Damit die preinstall-Checks nicht fehlschlagen, müssen wir auf beiden Clusterknoten das Paket cvuqdisk installieren:

[root@lucky-luke 19.24]# rpm -ivh $ORACLE_HOME/cv/rpm/cvuqdisk-1.0.10-1.rpm
Verifying...                   ################################# [100%]
Preparing...                   ################################# [100%]
Using default group oinstall to install package
Updating / installing...
   1:cvuqdisk-1.0.10-1         ################################# [100%]

[root@lucky-luke 19.24]# scp /u00/app/grid/product/19.24/cv/rpm/cvuqdisk-1.0.10-1.rpm jolly-jumper:/tmp/.
root@jolly-jumper's password:
cvuqdisk-1.0.10-1.rpm                      100%   11KB  10.4MB/s   00:00
[root@lucky-luke 19.24]# ssh jolly-jumper	
root@jolly-jumper's password:

[root@jolly-jumper ~]# rpm -ivh /tmp/cvuqdisk-1.0.10-1.rpm
Verifying...                    ################################# [100%]
Preparing...                    ################################# [100%]
Using default group oinstall to install package
Updating / installing...
   1:cvuqdisk-1.0.10-1          ################################# [100%]

Preinstall-Checks mit cluvfy

Jetzt können wir die Preinstall-Checks ausführen. Hätten wir das gemacht, bevor wir den RU 19.24 installiert haben, hätte das Cluster Verification Utility (cluvfy) gemeldet, dass es zu alt ist.

grid@lucky-luke 19.24]$ ./runcluvfy.sh stage -pre crsinst -r 19 -n lucky-luke,jolly-jumper
Performing following verification checks ...
[...]
Pre-check for cluster services setup was successful.
RPM Package Manager database ...INFORMATION
PRVG-11250 : The check "RPM Package Manager database" was not performed because
it needs 'root' user privileges.

Refer to My Oracle Support notes "2548970.1" for more details regarding errors
PRVG-11250".

ORAchk checks ...INFORMATION
PRVH-1507 : ORAchk/EXAchk checks are skipped.


CVU operation performed:      stage -pre crsinst
Date:                         Jul 18, 2024 10:25:12 PM
CVU version:                  19.24.0.0.0 (062024x8664)
CVU home:                     /u00/app/grid/product/19.24
User:                         grid
Operating system:             Linux5.15.0-208.159.3.el8uek.x86_64

Installation der Grid Infrastructure Software

Jetzt installieren wir die Grid Infrastructure Software. Die dafür notwendigen Parameter können wir über ein Response-File spezifizieren oder direkt an der Kommandozeile angeben. Die Muster-Response-Datei $GRID_HOME/install/response/gridsetup.rsp enthält die Parameter inklusive Dokumentation.

[grid@lucky-luke 19.24]$ $ORACLE_HOME/gridSetup.sh -silent \
>   INVENTORY_LOCATION=/u00/app/oraInventory \
>   oracle.install.option=CRS_CONFIG \
>   ORACLE_BASE=/u00/app/oracle \
>   oracle.install.asm.OSDBA=asmdba \
>   oracle.install.asm.OSOPER=asmoper \
>   oracle.install.asm.OSASM=asmadmin \
>   oracle.install.crs.config.scanType=LOCAL_SCAN \
>   oracle.install.crs.config.gpnp.scanName=wild-west.markusdba.internal \
>   oracle.install.crs.config.gpnp.scanPort=1521 \
>   oracle.install.crs.config.ClusterConfiguration=STANDALONE \
>   oracle.install.crs.config.configureAsExtendedCluster=false \
>   oracle.install.crs.config.clusterName=muppetshow \
>   racle.install.crs.config.gpnp.configureGNS=false \
>   oracle.install.crs.config.clusterNodes=lucky-luke:lucky-luke-vip,jolly-jumper:jolly-jumper-vip \
>   oracle.install.crs.config.networkInterfaceList=ens3:192.168.1.0:1,ens4:192.168.2.0:5 \
>   oracle.install.crs.configureGIMR=false \
>   oracle.install.crs.config.storageOption=FLEX_ASM_STORAGE \
>   oracle.install.crs.config.useIPMI=false \
>   oracle.install.asm.SYSASMPassword=manager \
>   oracle.install.asm.diskGroup.name=GRID \
>   oracle.install.asm.diskGroup.redundancy=EXTERNAL \
>   oracle.install.asm.diskGroup.AUSize=4 \
>   oracle.install.asm.diskGroup.disks=/dev/oracle-asm/asm-disk-1 \
>   oracle.install.asm.diskGroup.diskDiscoveryString=/dev/oracle-asm/* \
>   oracle.install.asm.monitorPassword=manager \
>   oracle.install.asm.configureAFD=false
Launching Oracle Grid Infrastructure Setup Wizard...

[WARNING] [INS-30011] The SYS password entered does not conform to the Oracle recommended standards.
   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
   ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-30011] The ASMSNMP password entered does not conform to the Oracle recommended standards.
   CAUSE: Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
   ACTION: Provide a password that conforms to the Oracle recommended standards.
[WARNING] [INS-40109] The specified Oracle Base location is not empty on this server.
   ACTION: Specify an empty location for Oracle Base.
[WARNING] [INS-32047] The location (/u00/app/oraInventory) specified for the central inventory is not empty.
   ACTION: It is recommended to provide an empty location for the inventory.
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. gridSetupActions2024-07-18_11-07-18PM.log
   ACTION: Identify the list of failed prerequisite checks from the log: gridSetupActions2024-07-18_11-07-18PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
 /u00/app/grid/product/19.24/install/response/grid_2024-07-18_11-07-18PM.rsp

You can find the log of this install session at:
 /tmp/GridSetupActions2024-07-18_11-07-18PM/gridSetupActions2024-07-18_11-07-18PM.log

As a root user, execute the following script(s):
	1. /u00/app/oraInventory/orainstRoot.sh
	2. /u00/app/grid/product/19.24/root.sh

Execute /u00/app/oraInventory/orainstRoot.sh on the following nodes:
[lucky-luke, jolly-jumper]
Execute /u00/app/grid/product/19.24/root.sh on the following nodes:
[lucky-luke, jolly-jumper]

Run the script on the local node first. After successful completion, you can start the script in parallel on all other nodes.

Successfully Setup Software with warning(s).

As install user, execute the following command to complete the configuration.
	/u00/app/grid/product/19.24/gridSetup.sh -executeConfigTools -responseFile /u00/app/grid/product/19.24/install/response/grid_2024-07-18_11-07-18PM.rsp [-silent]
Note: The required passwords need to be included in the response file.


Moved the install session logs to:
 /u00/app/oraInventory/logs/GridSetupActions2024-07-18_11-07-18PM

orainstRoot.sh

[grid@lucky-luke 19.24]$ su
Password:
[root@lucky-luke 19.24]# /u00/app/oraInventory/orainstRoot.sh
Changing permissions of /u00/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u00/app/oraInventory to oinstall.
The execution of the script is complete.
[root@lucky-luke 19.24]# ssh jolly-jumper
root@jolly-jumper's password:
[root@jolly-jumper ~]# /u00/app/oraInventory/orainstRoot.sh
Changing permissions of /u00/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.

Changing groupname of /u00/app/oraInventory to oinstall.
The execution of the script is complete.
[root@jolly-jumper ~]# exit
logout
Connection to jolly-jumper closed.

root.sh auf dem 1.Knoten lucky-luke

[root@lucky-luke 19.24]# /u00/app/grid/product/19.24/root.sh
Check /u00/app/grid/product/19.24/install/root_lucky-luke.markusdba.internal_2024-07-18_23-34-55-544734296.log for the output of root script

Kontrolle der Log-Datei:

[root@lucky-luke 19.24]# tail -5 /u00/app/grid/product/19.24/install/root_lucky-luke.markusdba.internal_2024-07-18_23-34-55-544734296.log
2024/07/18 23:40:11 CLSRSC-594: Executing installation step 17 of 19: 'StartCluster'.
2024/07/18 23:41:13 CLSRSC-343: Successfully started Oracle Clusterware stack
2024/07/18 23:41:13 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2024/07/18 23:42:35 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2024/07/18 23:42:59 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded

root.sh auf dem 2.Knoten jolly-jumper

root@lucky-luke 19.24]# ssh jolly-jumper
root@jolly-jumper's password:

[root@jolly-jumper ~]# /u00/app/grid/product/19.24/root.sh
Check /u00/app/grid/product/19.24/install/root_jolly-jumper.markusdba.internal_2024-07-18_23-45-46-259348497.log for the output of root script


[root@jolly-jumper ~]# tail -5 /u00/app/grid/product/19.24/install/root_jolly-jumper.markusdba.internal_2024-07-18_23-45-46-259348497.log
2024/07/18 23:48:15 CLSRSC-343: Successfully started Oracle Clusterware stack
2024/07/18 23:48:15 CLSRSC-594: Executing installation step 18 of 19: 'ConfigNode'.
2024/07/18 23:48:29 CLSRSC-594: Executing installation step 19 of 19: 'PostConfig'.
2024/07/18 23:48:37 CLSRSC-325: Configure Oracle Grid Infrastructure for a Cluster ... succeeded
2024/07/18 23:49:53 CLSRSC-4002: Successfully installed Oracle Trace File Analyzer (TFA) Collector.

Ausführen der “Configuration Tools”

gridSetup.sh hat für den nächsten Schritt ein Responsefile generiert, in dem allerdings die Passworte fehlen. Da wir aber wie oben die Parameter direkt auf der Kommandozeile angeben, brauchen wir diese Datei nicht:

[grid@lucky-luke 19.24]$ cd $ORACLE_HOME
[grid@lucky-luke 19.24]$ $ORACLE_HOME/gridSetup.sh -silent -executeConfigTools \
>   INVENTORY_LOCATION=/u00/app/oraInventory \
>   oracle.install.option=CRS_CONFIG \
>   ORACLE_BASE=/u00/app/oracle \
>   oracle.install.asm.OSDBA=asmdba \
>   oracle.install.asm.OSOPER=asmoper \
>   oracle.install.asm.OSASM=asmadmin \
>   oracle.install.crs.config.scanType=LOCAL_SCAN \
>   oracle.install.crs.config.gpnp.scanName=wild-west.markusdba.internal \
>   oracle.install.crs.config.gpnp.scanPort=1521 \
>   oracle.install.crs.config.ClusterConfiguration=STANDALONE \
>   oracle.install.crs.config.configureAsExtendedCluster=false \
>   oracle.install.crs.config.clusterName=muppetshow \
>   racle.install.crs.config.gpnp.configureGNS=false \
>   oracle.install.crs.config.clusterNodes=lucky-luke:lucky-luke-vip,jolly-jumper:jolly-jumper-vip \
>   oracle.install.crs.config.networkInterfaceList=ens3:192.168.1.0:1,ens4:192.168.2.0:5 \
>   oracle.install.crs.configureGIMR=false \
>   oracle.install.crs.config.storageOption=FLEX_ASM_STORAGE \
>   oracle.install.crs.config.useIPMI=false \
>   oracle.install.asm.SYSASMPassword=manager \
>   oracle.install.asm.diskGroup.name=GRID \
>   oracle.install.asm.diskGroup.redundancy=EXTERNAL \
>   oracle.install.asm.diskGroup.AUSize=4 \
>   oracle.install.asm.diskGroup.disks=/dev/oracle-asm/asm-disk-1 \
>   oracle.install.asm.diskGroup.diskDiscoveryString=/dev/oracle-asm/* \
>   oracle.install.asm.monitorPassword=manager \
>   oracle.install.asm.configureAFD=false
Launching Oracle Grid Infrastructure Setup Wizard...

You can find the logs of this session at:
/u00/app/oraInventory/logs/GridSetupActions2024-07-18_11-56-00PM

You can find the log of this install session at:
 /u00/app/oraInventory/logs/UpdateNodeList2024-07-18_11-56-00PM.log
 Successfully Configured Software.

Damit ist die Installation fertig.

Ergebnis

Zur Kontrolle gucken wir uns jetzt die installierten Cluster-Ressourcen an:

[grid@lucky-luke 19.24]$ $ORACLE_HOME/bin/crsctl stat res -t
--------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       jolly-jumper             STABLE
               ONLINE  ONLINE       lucky-luke               STABLE
ora.chad
               ONLINE  ONLINE       jolly-jumper             STABLE
               ONLINE  ONLINE       lucky-luke               STABLE
ora.net1.network
               ONLINE  ONLINE       jolly-jumper             STABLE
               ONLINE  ONLINE       lucky-luke               STABLE
ora.ons
               ONLINE  ONLINE       jolly-jumper             STABLE
               ONLINE  ONLINE       lucky-luke               STABLE
ora.proxy_advm
               OFFLINE OFFLINE      jolly-jumper             STABLE
               OFFLINE OFFLINE      lucky-luke               STABLE
--------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       lucky-luke               STABLE
      2        ONLINE  ONLINE       jolly-jumper             STABLE
ora.GRID.dg(ora.asmgroup)
      1        ONLINE  ONLINE       lucky-luke               STABLE
      2        ONLINE  ONLINE       jolly-jumper             STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       jolly-jumper             STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       lucky-luke               STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       lucky-luke               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       lucky-luke               Started,STABLE
      2        ONLINE  ONLINE       jolly-jumper             Started,STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       lucky-luke               STABLE
      2        ONLINE  ONLINE       jolly-jumper             STABLE
ora.cvu
      1        ONLINE  ONLINE       lucky-luke               STABLE
ora.jolly-jumper.vip
      1        ONLINE  ONLINE       jolly-jumper             STABLE
ora.lucky-luke.vip
      1        ONLINE  ONLINE       lucky-luke               STABLE
ora.qosmserver
      1        ONLINE  ONLINE       lucky-luke               STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       jolly-jumper             STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       lucky-luke               STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       lucky-luke               STABLE
--------------------------------------------------------------------------

Zusammenfassung

Die Installation der Oracle Grid Infrastructure über die Kommandozeile ist keine “Raketenwissenschaft”. Die hier dargestellten Schritte lassen sich auch einfach automatisieren, so dass einer standardisierten, automatisch installierten Cluster-Umgebung nichts mehr im Wege steht.

Links und weitere Informationen