Problema
Os patches 32218454 (RDBMS) e 32067171 (OJVM) foram aplicados com sucesso nos binários do Oracle Home do primeiro nó, mas a tentativa de apply no segundo nó falhou com o seguinte erro:
ApplySession failed in system modification phase... 'ApplySession::apply failed: java.io.IOException: oracle.sysman.oui.patch.PatchException: java.io.FileNotFoundException: /u01/app/oraInventory/ContentsXML/oui-patch.xml (Permission denied)'
Então verifiquei a permissão desse arquivo no node 02 (onde o opatch falhou):
[oracle@sfzrac02]$ stat /u01/app/oraInventory/ContentsXML/oui-patch.xml File: ‘/u01/app/oraInventory/ContentsXML/oui-patch.xml’ Size: 174 Blocks: 8 IO Block: 4096 regular file Device: 811h/2065d Inode: 3015788 Links: 1 Access: (0644/-rw-r--r--) Uid: (54322/ grid) Gid: (54321/oinstall) Access: 2021-04-03 16:46:18.304425316 -0300 Modify: 2021-04-01 00:00:15.721592675 -0300 Change: 2021-04-01 00:00:15.721592675 -0300
O arquivo pertence ao usuário grid, grupo oinstall e com permissão 644 (leitura + escrita, leitura, leitura).
Então verifiquei a permissão desse arquivo no node 01 (onde o patch foi aplicado com sucesso):
[oracle@sfzrac01]$ stat /u01/app/oraInventory/ContentsXML/oui-patch.xml File: ‘/u01/app/oraInventory/ContentsXML/oui-patch.xml’ Size: 174 Blocks: 8 IO Block: 4096 regular file Device: 821h/2081d Inode: 1835618 Links: 1 Access: (0660/-rw-rw----) Uid: (54322/ grid) Gid: (54321/oinstall) Access: 2021-04-02 00:24:28.224898604 -0300 Modify: 2021-04-02 00:24:28.225898624 -0300 Change: 2021-04-02 00:24:28.225898624 -0300
No node 01 o arquivo tinha a permissão 660 (leitura + escrita, leitura + escrita, leitura). Ou seja o inventário central pertente ao usuário grid, mas também ao grupo oinstall, para que o usuário oracle possa alterar esse arquivo. O problema ocorreu porque no node 02, o grupo oinstall tinha permissão somente de leitura.
Aqui eu achei uma nota Doc ID 2582139.1 indicando que isso é bug na versão 19c, corrigido na versão 20.1. Porém o cenário descrito no documento, era um apply como OPatchAuto, e a solução era corrigir a permissão do arquivo e emitir um opatchauto resume. No meu caso, é um cenário de apply com o opatch, onde não temos a opção de resumir a sessão.
Solução
A correção para esse impasse se deu em 5 passos, conforme demonstrado a seguir.
1) Com usuário root ou grid, ajustar a permissão do arquivo:
[grid@sfzrac02]$ chmod 660 /u01/app/oraInventory/ContentsXML/oui-patch.xml
2) No node 02, excluir a pasta $ORACLE_HOME/inventory/oneoffs/<patch_number>
Abaixo estou excluindo a pasta do patch 32218454, que apresentou erro durante o apply:
[oracle@sfzrac02]$ mv $ORACLE_HOME/inventory/oneoffs/32218454 $ORACLE_HOME/inventory/oneoffs/32218454.old
3) Copiar essa pasta no node01 para o node02:
Estamos fazendo isso porque o opatch não permite aplicar o mesmo patch novamente, mas também apresenta erro ao fazer rollback pelo fato de não existir os arquivos usados como referência para saber como desfazer as alterações no Oracle Home. Como o apply concluiu com sucesso no node01, copiar essa pasta para o segundo node foi um workaround que funcionou muito bem.
[oracle@sfzrac01]$ cd $ORACLE_HOME/inventory/oneoffs [oracle@sfzrac01]$ scp -r 32218454 oracle@sfzrac02:$ORACLE_HOME/inventory/oneoffs/
4) No node 02, realizar rollback do patch que teve o apply interrompido:
[oracle@sfzrac02]$ opatch rollback -id 32218454 Oracle Interim Patch Installer version 12.2.0.1.24 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/19.0.0.0/db_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19.0.0.0/db_1/oraInst.loc OPatch version : 12.2.0.1.24 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19.0.0.0/db_1/cfgtoollogs/opatch/opatch2021-04-03_17-20-04PM_1.log Patches will be rolled back in the following order: 32218454 The following patch(es) will be rolled back: 32218454 Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = '/u01/app/oracle/product/19.0.0.0/db_1') Is the local system ready for patching? [y|n] y User Responded with: Y Rolling back patch 32218454... RollbackSession rolling back interim patch '32218454' from OH '/u01/app/oracle/product/19.0.0.0/db_1' Patching component oracle.rdbms, 19.0.0.0.0... Deleting "kge.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "kubsbufio.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "ktbdat.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "qjsntrans.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "kpdbapx.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "kcert.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "kqro.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "kbclgdr.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "kubsd.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Deleting "kbcs.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libserver19.a" Patching component oracle.rdbms.rsf, 19.0.0.0.0... Deleting "skgzepclib.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libgeneric19.a" Deleting "skgzibr.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libgeneric19.a" Deleting "kgoms.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libgeneric19.a" Deleting "skgrlib_ipcdat.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libgeneric19.a" Deleting "qcpi8.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libgeneric19.a" Deleting "skgrlib.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libgeneric19.a" Deleting "skgzfndd.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libgeneric19.a" Deleting "qesdsbc.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libcommon19.a" Deleting "qesxldsb.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libcommon19.a" Deleting "skfparity.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libcommon19.a" Deleting "kubsbdcore.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libclient19.a" Deleting "kubsbd.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libclient19.a" Deleting "kubsorccore.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libclient19.a" Deleting "kubscrf.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libclient19.a" Deleting "kubsorcppd.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libclient19.a" Deleting "kubsutl.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libclient19.a" Deleting "kubsorcpb.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libclient19.a" Deleting "kubsbufio.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libclient19.a" Patching component oracle.rdbms.util, 19.0.0.0.0... Patching component oracle.assistants.acf, 19.0.0.0.0... Patching component oracle.assistants.deconfig, 19.0.0.0.0... Patching component oracle.assistants.server, 19.0.0.0.0... Patching component oracle.buildtools.rsf, 19.0.0.0.0... Patching component oracle.ctx, 19.0.0.0.0... Patching component oracle.dbjava.ic, 19.0.0.0.0... Patching component oracle.dbjava.jdbc, 19.0.0.0.0... Patching component oracle.dbjava.ucp, 19.0.0.0.0... Patching component oracle.dbtoolslistener, 19.0.0.0.0... Patching component oracle.ldap.owm, 19.0.0.0.0... Patching component oracle.ldap.rsf, 19.0.0.0.0... Patching component oracle.network.rsf, 19.0.0.0.0... Patching component oracle.oracore.rsf, 19.0.0.0.0... Patching component oracle.rdbms.dbscripts, 19.0.0.0.0... Patching component oracle.rdbms.deconfig, 19.0.0.0.0... Patching component oracle.sdo, 19.0.0.0.0... Patching component oracle.sdo.locator.jrf, 19.0.0.0.0... Patching component oracle.sqlplus, 19.0.0.0.0... Patching component oracle.xdk, 19.0.0.0.0... Patching component oracle.marvel, 19.0.0.0.0... Patching component oracle.xdk.rsf, 19.0.0.0.0... Deleting "jzntrans.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libxml19.a" Deleting "jznpathval.o" from archive "/u01/app/oracle/product/19.0.0.0/db_1/lib/libxml19.a" Patching component oracle.ctx.atg, 19.0.0.0.0... Patching component oracle.rdbms.scheduler, 19.0.0.0.0... Patching component oracle.rdbms.lbac, 19.0.0.0.0... Patching component oracle.duma, 19.0.0.0.0... Patching component oracle.ldap.rsf.ic, 19.0.0.0.0... Patching component oracle.odbc, 19.0.0.0.0... Patching component oracle.ctx.rsf, 19.0.0.0.0... Patching component oracle.oraolap.api, 19.0.0.0.0... Patching component oracle.xdk.parser.java, 19.0.0.0.0... Patching component oracle.oraolap, 19.0.0.0.0... Patching component oracle.sdo.locator, 19.0.0.0.0... Patching component oracle.sqlplus.ic, 19.0.0.0.0... Patching component oracle.mgw.common, 19.0.0.0.0... Patching component oracle.ons, 19.0.0.0.0... Patching component oracle.dbdev, 19.0.0.0.0... Patching component oracle.network.listener, 19.0.0.0.0... Patching component oracle.nlsrtl.rsf, 19.0.0.0.0... Patching component oracle.ovm, 19.0.0.0.0... Patching component oracle.oraolap.dbscripts, 19.0.0.0.0... Patching component oracle.xdk.xquery, 19.0.0.0.0... Patching component oracle.precomp.rsf, 19.0.0.0.0... Patching component oracle.javavm.client, 19.0.0.0.0... Patching component oracle.precomp.common.core, 19.0.0.0.0... Patching component oracle.ldap.security.osdt, 19.0.0.0.0... Patching component oracle.rdbms.oci, 19.0.0.0.0... Patching component oracle.rdbms.rman, 19.0.0.0.0... Patching component oracle.rdbms.crs, 19.0.0.0.0... Patching component oracle.rdbms.install.common, 19.0.0.0.0... Patching component oracle.javavm.server, 19.0.0.0.0... Patching component oracle.rdbms.drdaas, 19.0.0.0.0... Patching component oracle.rdbms.install.plugins, 19.0.0.0.0... Patching component oracle.rdbms.dv, 19.0.0.0.0... Patching component oracle.ldap.client, 19.0.0.0.0... Patching component oracle.network.client, 19.0.0.0.0... Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0... Patching component oracle.precomp.common, 19.0.0.0.0... Patching component oracle.precomp.lang, 19.0.0.0.0... Patching component oracle.jdk, 1.8.0.201.0... RollbackSession removing interim patch '32218454' from inventory Inactive sub-set patch [29517242] has become active due to the rolling back of a super-set patch [32218454]. Please refer to Doc ID 2161861.1 for any possible further required actions. Log file location: /u01/app/oracle/product/19.0.0.0/db_1/cfgtoollogs/opatch/opatch2021-04-03_17-20-04PM_1.log OPatch succeeded.
5) Por fim, podemos aplicar o patch novamente com sucesso:
[oracle@sfzrac02 32218454]$ cd /home/oracle/32126828/32218454 [oracle@sfzrac02 32218454]$ opatch apply -silent Oracle Interim Patch Installer version 12.2.0.1.24 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /u01/app/oracle/product/19.0.0.0/db_1 Central Inventory : /u01/app/oraInventory from : /u01/app/oracle/product/19.0.0.0/db_1/oraInst.loc OPatch version : 12.2.0.1.24 OUI version : 12.2.0.7.0 Log file location : /u01/app/oracle/product/19.0.0.0/db_1/cfgtoollogs/opatch/opatch2021-04-03_17-26-24PM_1.log Verifying environment and performing prerequisite checks... OPatch continues with these patches: 32218454 Do you want to proceed? [y|n] Y (auto-answered by -silent) User Responded with: Y All checks passed. Please shutdown Oracle instances running out of this ORACLE_HOME on the local system. (Oracle Home = '/u01/app/oracle/product/19.0.0.0/db_1') Is the local system ready for patching? [y|n] Y (auto-answered by -silent) User Responded with: Y Backing up files... Applying interim patch '32218454' to OH '/u01/app/oracle/product/19.0.0.0/db_1' ApplySession: Optional component(s) [ oracle.network.gsm, 19.0.0.0.0 ] , [ oracle.rdbms.ic, 19.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 19.0.0.0.0 ] , [ oracle.tfa, 19.0.0.0.0 ] , [ oracle.net.cman, 19.0.0.0.0 ] , [ oracle.network.cman, 19.0.0.0.0 ] , [ oracle.oid.client, 19.0.0.0.0 ] , [ oracle.options.olap.api, 19.0.0.0.0 ] , [ oracle.options.olap, 19.0.0.0.0 ] , [ oracle.xdk.companion, 19.0.0.0.0 ] , [ oracle.jdk, 1.8.0.191.0 ] not present in the Oracle Home or a higher version is found. Patching component oracle.rdbms, 19.0.0.0.0... Patching component oracle.rdbms.rsf, 19.0.0.0.0... Patching component oracle.rdbms.util, 19.0.0.0.0... Patching component oracle.assistants.acf, 19.0.0.0.0... Patching component oracle.assistants.deconfig, 19.0.0.0.0... Patching component oracle.assistants.server, 19.0.0.0.0... Patching component oracle.buildtools.rsf, 19.0.0.0.0... Patching component oracle.ctx, 19.0.0.0.0... Patching component oracle.dbjava.ic, 19.0.0.0.0... Patching component oracle.dbjava.jdbc, 19.0.0.0.0... Patching component oracle.dbjava.ucp, 19.0.0.0.0... Patching component oracle.dbtoolslistener, 19.0.0.0.0... Patching component oracle.ldap.owm, 19.0.0.0.0... Patching component oracle.ldap.rsf, 19.0.0.0.0... Patching component oracle.network.rsf, 19.0.0.0.0... Patching component oracle.oracore.rsf, 19.0.0.0.0... Patching component oracle.rdbms.dbscripts, 19.0.0.0.0... Patching component oracle.rdbms.deconfig, 19.0.0.0.0... Patching component oracle.sdo, 19.0.0.0.0... Patching component oracle.sdo.locator.jrf, 19.0.0.0.0... Patching component oracle.sqlplus, 19.0.0.0.0... Patching component oracle.xdk, 19.0.0.0.0... Patching component oracle.marvel, 19.0.0.0.0... Patching component oracle.xdk.rsf, 19.0.0.0.0... Patching component oracle.ctx.atg, 19.0.0.0.0... Patching component oracle.rdbms.scheduler, 19.0.0.0.0... Patching component oracle.rdbms.lbac, 19.0.0.0.0... Patching component oracle.duma, 19.0.0.0.0... Patching component oracle.ldap.rsf.ic, 19.0.0.0.0... Patching component oracle.odbc, 19.0.0.0.0... Patching component oracle.ctx.rsf, 19.0.0.0.0... Patching component oracle.oraolap.api, 19.0.0.0.0... Patching component oracle.xdk.parser.java, 19.0.0.0.0... Patching component oracle.oraolap, 19.0.0.0.0... Patching component oracle.sdo.locator, 19.0.0.0.0... Patching component oracle.sqlplus.ic, 19.0.0.0.0... Patching component oracle.mgw.common, 19.0.0.0.0... Patching component oracle.ons, 19.0.0.0.0... Patching component oracle.dbdev, 19.0.0.0.0... Patching component oracle.network.listener, 19.0.0.0.0... Patching component oracle.nlsrtl.rsf, 19.0.0.0.0... Patching component oracle.ovm, 19.0.0.0.0... Patching component oracle.oraolap.dbscripts, 19.0.0.0.0... Patching component oracle.xdk.xquery, 19.0.0.0.0... Patching component oracle.precomp.rsf, 19.0.0.0.0... Patching component oracle.javavm.client, 19.0.0.0.0... Patching component oracle.precomp.common.core, 19.0.0.0.0... Patching component oracle.ldap.security.osdt, 19.0.0.0.0... Patching component oracle.rdbms.oci, 19.0.0.0.0... Patching component oracle.rdbms.rman, 19.0.0.0.0... Patching component oracle.rdbms.crs, 19.0.0.0.0... Patching component oracle.rdbms.install.common, 19.0.0.0.0... Patching component oracle.javavm.server, 19.0.0.0.0... Patching component oracle.rdbms.drdaas, 19.0.0.0.0... Patching component oracle.rdbms.install.plugins, 19.0.0.0.0... Patching component oracle.rdbms.dv, 19.0.0.0.0... Patching component oracle.ldap.client, 19.0.0.0.0... Patching component oracle.network.client, 19.0.0.0.0... Patching component oracle.rdbms.rsf.ic, 19.0.0.0.0... Patching component oracle.precomp.common, 19.0.0.0.0... Patching component oracle.precomp.lang, 19.0.0.0.0... Patching component oracle.jdk, 1.8.0.201.0... Patch 32218454 successfully applied. Sub-set patch [29517242] has become inactive due to the application of a super-set patch [32218454]. Please refer to Doc ID 2161861.1 for any possible further required actions. Log file location: /u01/app/oracle/product/19.0.0.0/db_1/cfgtoollogs/opatch/opatch2021-04-03_17-26-24PM_1.log OPatch succeeded.
Pingback: OPatch Falha com “UtilSession failed: NApply was not able to get the list of patches to apply” – Blog do Dibiei