Recentemente precisei realizar a instalação do Grid Infrastructure 19c, aplicando o último Release Update 19.19 em adição com alguns patches que eram necessários no ambiente em questão. Para essa demanda, decidi usar as opções -applyRU e -applyOneOffs para criar o novo Grid Home com todos os patches necessários já aplicados no binário, tudo em um único passo.
Abaixo o comando utilizado (tentativa):
export ORACLE_HOME=/u01/app/product/19.0.0.0/grid_home2 $ORACLE_HOME/gridSetup.sh -ignorePrereq -waitforcompletion -silent \ -ApplyRU /u01/RU19.19/35058172/35037840 \ -applyOneOffs /u01/RU19.19/35004974,/u01/RU19.19/35074478 \ -responseFile $ORACLE_HOME/install/response/gridsetup.rsp \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ oracle.install.option=CRS_SWONLY \ ORACLE_BASE=/u01/app/grid \ ORACLE_HOME=$ORACLE_HOME \ oracle.install.asm.OSDBA=oinstall \ oracle.install.asm.OSOPER=oinstall \ oracle.install.asm.OSASM=oinstall \ oracle.install.crs.config.ClusterConfiguration=STANDALONE \ oracle.install.crs.config.autoConfigureClusterNodeVIP=false \ oracle.install.crs.config.clusterNodes=rac01,rac02
Mas a operação falhou:
Preparing the home to patch...
Applying the patch /u01/RU19.19/35004974...
Successfully applied the patch.
Applying the patch /u01/RU19.19/35074478...
OPatch command failed while applying the patch. For details look at the logs from /u01/app/product/19.0.0.0/grid_home2/cfgtoollogs/opatchauto/.
Olhando o arquivo de log, um erro bem claro:
Interim patch 35074478 requires prerequisite patch(es) [ 35042068 ] which are not present in the Oracle Home.
Apply prerequisite patch(es) [ 35042068 ] before applying interim patch 35074478 .]
O precheck do patch 35074478 listado na opção -applyOneOffs está alegando que ele precisa que o patch 35042068 (RU 19.19) esteja aplicado no Oracle Home. Isso é verdade, ele precisa mesmo, mas o patch 35042068 (RU 19.19) está sendo aplicado na mesma execução através da opção -applyRU.
Conteúdo do patches inclusos no System Patch 35037840:
[grid@rac01 ~]$ ls -l /u01/RU19.19/35058172/35037840 total 140 drwxr-x--- 4 grid oinstall 48 Apr 7 13:40 33575402 drwxr-x--- 5 grid oinstall 81 Apr 7 13:40 35042068 <======= drwxr-x--- 5 grid oinstall 62 Apr 7 13:39 35050325 drwxr-x--- 5 grid oinstall 62 Apr 7 13:38 35050331 drwxr-x--- 4 grid oinstall 48 Apr 7 13:40 35107512 drwxr-x--- 2 grid oinstall 4096 Apr 7 13:44 automation -rw-rw-r-- 1 grid oinstall 5824 Apr 7 14:19 bundle.xml -rw-r--r-- 1 grid oinstall 128114 Apr 14 08:34 README.html -rw-r--r-- 1 grid oinstall 0 Apr 7 13:44 README.txt
Aparentemente o gridSetup.sh está tentando executar o -applyOneOffs antes do -applyRU, o que não ocorre com o script runInstaller utilizado na instalação do binário RDBMS, conforme exemplo abaixo onde eu conclui uma instalação com sucesso usando essa mesma abordagem:
export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_4
export ORA_INVENTORY=/u01/app/oraInventory/
export ORACLE_BASE=/u01/app/oracle
export PH=/u01/RU19.19/interim
$ORACLE_HOME/runInstaller -waitforcompletion -force -silent \
-applyRU /u01/RU19.19/35058172/35037840 \
-applyOneOffs /u01/RU19.19/35058172/35050341,$PH/34243634,$PH/34810987,$PH/34975490,$PH/34993018,$PH/35004974,$PH/35074478,$PH/35099674 \
ORACLE_BASE=${ORACLE_BASE} \
-responseFile ${ORACLE_HOME}/install/response/db_install.rsp \
oracle.install.option=INSTALL_DB_SWONLY \
INVENTORY_LOCATION=${ORA_INVENTORY} \
ORACLE_HOME=${ORACLE_HOME} \
oracle.install.db.InstallEdition=EE \
UNIX_GROUP_NAME=oinstall \
oracle.install.db.OSDGDBA_GROUP=dba \
oracle.install.db.OSKMDBA_GROUP=dba \
oracle.install.db.OSDBA_GROUP=dba \
oracle.install.db.OSOPER_GROUP=dba \
oracle.install.db.OSBACKUPDBA_GROUP=dba \
oracle.install.db.OSDGDBA_GROUP=dba \
oracle.install.db.OSKMDBA_GROUP=dba \
oracle.install.db.OSRACDBA_GROUP=dba \
oracle.install.db.CLUSTER_NODES=rac01,rac02 \
DECLINE_SECURITY_UPDATES=true
Resultado:
Preparing the home to patch...
Applying the patch /u01/RU19.19/35058172/35037840...
Successfully applied the patch.
Applying the patch /u01/RU19.19/35058172/35050341...
Successfully applied the patch.
Applying the patch /u01/RU19.19/interim/34243634...
Successfully applied the patch.
Applying the patch /u01/RU19.19/interim/34810987...
Successfully applied the patch.
Applying the patch /u01/RU19.19/interim/34975490...
Successfully applied the patch.
Applying the patch /u01/RU19.19/interim/34993018...
Successfully applied the patch.
Applying the patch /u01/RU19.19/interim/35004974...
Successfully applied the patch.
Applying the patch /u01/RU19.19/interim/35074478...
Successfully applied the patch.
Applying the patch /u01/RU19.19/interim/35099674...
Successfully applied the patch.
The log can be found at: /u01/app/oraInventory/logs/InstallActions2023-06-29_10-27-55AM/installerPatchActions_2023-06-29_10-27-55AM.log
Launching Oracle Database Setup Wizard...
The response file for this session can be found at:
/u01/app/oracle/product/19.0.0.0/dbhome_4/install/response/db_2023-06-29_10-27-55AM.rsp
You can find the log of this install session at:
/u01/app/oraInventory/logs/InstallActions2023-06-29_10-27-55AM/installActions2023-06-29_10-27-55AM.log
As a root user, execute the following script(s):
1. /u01/app/oracle/product/19.0.0.0/dbhome_4/root.sh
Execute /u01/app/oracle/product/19.0.0.0/dbhome_4/root.sh on the following nodes:
[rac01, rac02]
Successfully Setup Software.
Note que além de concluir com sucesso, as primeiras linhas no log indicam que ele começou pelo RU (o que faz mais sentido):
Preparing the home to patch...
Applying the patch /u01/RU19.19/35058172/35037840...
Abordagem Alternativa
Para não desistir de criar o novo Grid Home atualizado em um único passo, eu adaptei a minha estratégia, deixando de usar a opção -applyRU e listando todos os patches individualmente na opção -applyOneOffs.
Como fazer isso ?
Abrindo o README do patch 35037840, temos uma tabela informando a descrição de cada patch contido no mesmo:

Apesar de ser recomendado utilizar o OPatchAuto e ele cuidar de toda a orquestração de quais patches devem ser aplicados na sua devida ordem, essa tabela é útil para o caso de precisarmos aplicar os patches indvidualmente com o OPatch.
Para conseguir realizar a instalação de todos os patches em uma única etapa, eu tirei a opção -applyRU da linha de comando e montei uma lista com os diretórios de cada patch individualmente seguindo essa ordem:
- Primeiro os patches contidos no RU, seguindo a ordem listada no README
- Depois os demais patches que precisam ser aplicados em cima do RU.
Para simplificar a linha de comando, exportei uma variável de ambiente para representar o diretório base do patch 35037840 (GI RU 19.19):
export PH=/u01/RU19.19/35058172/35037840
Todos os patches listados e separados por vírgula na opção applyOneOffs:
-applyOneOffs $PH/35042068,$PH/35050325,$PH/35107512,$PH/33575402,$PH/35050331,/u01/RU19.19/35004974,/u01/RU19.19/35074478
Exemplo:
export PH=/u01/RU19.19/35058172/35037840 export ORACLE_HOME=/u01/app/product/19.0.0.0/grid_home2 $ORACLE_HOME/gridSetup.sh -ignorePrereq -waitforcompletion -silent \ -applyOneOffs $PH/35042068,$PH/35050325,$PH/35107512,$PH/33575402,$PH/35050331,/u01/RU19.19/35004974,/u01/RU19.19/35074478 \ -responseFile $ORACLE_HOME/install/response/gridsetup.rsp \ INVENTORY_LOCATION=/u01/app/oraInventory \ SELECTED_LANGUAGES=en \ oracle.install.option=CRS_SWONLY \ ORACLE_BASE=/u01/app/grid \ ORACLE_HOME=$ORACLE_HOME \ oracle.install.asm.OSDBA=oinstall \ oracle.install.asm.OSOPER=oinstall \ oracle.install.asm.OSASM=oinstall \ oracle.install.crs.config.ClusterConfiguration=STANDALONE \ oracle.install.crs.config.autoConfigureClusterNodeVIP=false \ oracle.install.crs.config.clusterNodes=rac01,rac02
Note que agora não uso mais a opção -applyRU, mas ao invés disso, listei todos os patches na opção -applyOneOffs. Essa abordagem funcionou com sucesso:
Preparing the home to patch...
Applying the patch /u01/RU19.19/35058172/35037840/35042068...
Successfully applied the patch.
Applying the patch /u01/RU19.19/35058172/35037840/35050325...
Successfully applied the patch.
Applying the patch /u01/RU19.19/35058172/35037840/35107512...
Successfully applied the patch.
Applying the patch /u01/RU19.19/35058172/35037840/33575402...
Successfully applied the patch.
Applying the patch /u01/RU19.19/35058172/35037840/35050331...
Successfully applied the patch.
Applying the patch /u01/RU19.19/35004974...
Successfully applied the patch.
Applying the patch /u01/RU19.19/35074478...
Successfully applied the patch.
The log can be found at: /u01/app/oraInventory/logs/GridSetupActions2023-06-28_11-55-56AM/installerPatchActions_2023-06-28_11-55-56AM.log
Launching Oracle Grid Infrastructure Setup Wizard...
[WARNING] [INS-41813] OSDBA for ASM, OSOPER for ASM, and OSASM are the same OS group.
CAUSE: The group you selected for granting the OSDBA for ASM group for database access, and the OSOPER for ASM group for startup and shutdown of Oracle ASM, is the same group as the OSASM group, whose members have SYSASM privileges on Oracle ASM.
ACTION: Choose different groups as the OSASM, OSDBA for ASM, and OSOPER for ASM groups.
[WARNING] [INS-41874] Oracle ASM Administrator (OSASM) Group specified is same as the inventory group.
CAUSE: Operating system group oinstall specified for OSASM Group is same as the inventory group.
ACTION: It is not recommended to have OSASM group same as inventory group. Select any of the group other than the inventory group to avoid incorrect configuration.
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oraInventory/logs/GridSetupActions2023-06-28_11-55-56AM/gridSetupActions2023-06-28_11-55-56AM.log
ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oraInventory/logs/GridSetupActions2023-06-28_11-55-56AM/gridSetupActions2023-06-28_11-55-56AM.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:
/u01/app/product/19.0.0.0/grid_home2/install/response/grid_2023-06-28_11-55-56AM.rsp
You can find the log of this install session at:
/u01/app/oraInventory/logs/GridSetupActions2023-06-28_11-55-56AM/gridSetupActions2023-06-28_11-55-56AM.log
As a root user, execute the following script(s):
1. /u01/app/product/19.0.0.0/grid_home2/root.sh
Execute /u01/app/product/19.0.0.0/grid_home2/root.sh on the following nodes:
[rac01, rac02]
Successfully Setup Software with warning(s).
Eu usei essa abordagem algumas vezes em ambientes diferentes e obtive sucesso em todas elas, e devo continuar usando até o script gridSetup se comportar de forma similar ao runInstaller.
[…] Se você tiver algum erro de OneOff patch que não pode ser aplicado porque depende do RU que já está sendo aplicado neste mesmo comando na opção -applyRU, teste uma sintaxe alternativa demonstrada neste post:Script gridSetup.sh Falha Se Um Patch Listado em “applyOneOffs” Depender do RU Listado em “app… […]