Sempre leiam as notas técnicas da Oracle antes de aplicar qualquer patch.
Referências Técnicas
Upgrades de DomU e cloud tooling
- Exadata Cloud Service Software Versions (Doc ID 2333222.1)
- How to update the Exadata Image (OS) in Exadata Cloud at Customer (Doc ID 2391164.1)
- How to upgrade DBAAS Cloud Tooling using dbaascli (Doc ID 2350471.1)
- Atualização do cloud tooling sem utilizar dbaascli (necessário em versões antigas): https://docs.oracle.com/en/cloud/paas/database-dbaas-cloud/csdbi/problems-administering-deployments.html#GUID-14724B31-FE0B-4D8C-BE36-CEE81FC84A5B
- How-To Update the OSC-Exawatcher Package on All Database Domains (Doc ID 2044825.1)
- Patching Exadata Cloud at Customer: https://docs.oracle.com/en/cloud/cloud-at-customer/exadata-cloud-at-customer/exacc/patch.html
- Rolling Back a Patch or Failed Patch: https://docs.oracle.com/en/cloud/cloud-at-customer/exadata-cloud-at-customer/exacc/roll-back-patch.html#GUID-0D1B9B1E-62E4-4A66-8D5D-6D1AC2B69A3F
Iremos aplicar o patch em um ambiente RAC Data Guard.
Realizando o backup do Oracle Home dos nós do RAC:
[oracle@srv01 ~]$ echo $ORACLE_HOME
/u02/app/oracle/product/11.2.0/dbhome_2
ShellScriptNode 1:
[root@srv01 ~]$ tar -pcvf /backup/cesar_update/oracle_home_srv01.tar dbhome_2
[root@srv01 ~]$ cd /u01/app/
[root@srv01 ~]$ tar -pcvf /backup/cesar_update/srv01_oraInventory.tar oraInventory
ShellScriptNode 2:
[root@srv02 ~]$ tar -pcvf /backup/cesar_update/oracle_home_srv02.tar dbhome_2
[root@srv02 ~]$ cd /u01/app/
[root@srv02 ~]$ tar -pcvf /backup/cesar_update/srv02_oraInventory.tar oraInventory
ShellScriptVerificando status dos bancos do RAC:
[oracle@srv01 ~]$ srvctl status database -d DBPROD
Instance DBPROD1 is running on node srv01
Instance DBPROD2 is running on node srv02
ShellScriptVerificando versão do dbaastools instalado:
[root@srv01 11.2.0]# rpm -qa|grep -i dbaastools
dbaastools_exa-1.0-1+19.1.1.1.0_211221.1316.x86_64
[root@srv01 11.2.0]# dbaascli patch tools list
DBAAS CLI version 19.1.1.1.0
Executing command patch tools list
[root@srv02 11.2.0]# rpm -qa|grep -i dbaastools
dbaastools_exa-1.0-1+19.1.1.1.0_211221.1316.x86_64
[root@srv02 11.2.0]# dbaascli patch tools list
DBAAS CLI version 19.1.1.1.0
Executing command patch tools list
ShellScriptVerificar se a url para download do patch estão iguais em todos os nós:
[root@srv01 exapatch]# cat /var/opt/oracle/exapatch/exadbcpatch.cfg |grep oss_container_url
[root@srv02 exapatch]# cat /var/opt/oracle/exapatch/exadbcpatch.cfg |grep oss_container_url
ShellScriptVerificar se a url esta acessível:
[root@srv01 exapatch]# curl -v -O URL GERADA ACIMA
[root@srv02 exapatch]# curl -v -O URL GERADA ACIMA
ShellScriptExportar variáveis de ambiente e verificar os patchs disponíveis para serem aplicados:
export ORACLE_BASE=/u02/app/oracle
export ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_2
export PATH=${ORACLE_HOME}/bin:$PATH
export ORACLE_SID=DBPROD1
echo $ORACLE_SID
ShellScriptexport ORACLE_BASE=/u02/app/oracle
export ORACLE_HOME=/u02/app/oracle/product/11.2.0/dbhome_2
export PATH=${ORACLE_HOME}/bin:$PATH
export ORACLE_SID=DBPROD2
echo $ORACLE_SID
ShellScriptVerificar os patchs disponíveis para serem aplicados Node 1:
[root@srv02 ~]# dbaascli patch db list --oh srv02:/u02/app/oracle/product/11.2.0/dbhome_2
DBAAS CLI version 19.1.1.1.0
Executing command patch db list --oh srv02:/u02/app/oracle/product/11.2.0/dbhome_2
INFO : EXACS patching
Available Patches
patchid :26610265 (DB 11.2.0.4.170814 QUARTERLY DATABASE PATCH FOR EXADATA - Aug 2017)
patchid :26635694 (DB 11.2.0.4.171017 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2017)
patchid :27011043 (DB 11.2.0.4.180116 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2018)
patchid :27475722 (DB 11.2.0.4.180417 QUARTERLY DATABASE PATCH FOR EXADATA - Apr 2018)
patchid :27980213 (DB 11.2.0.4.180717 QUARTERLY DATABASE PATCH FOR EXADATA - Jul 2018)
patchid :28462975 (DB 11.2.0.4.181016 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2018)
patchid :28833571 (DB 11.2.0.4.190115 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2019)
patchid :29257245 (DB 11.2.0.4.190416 QUARTERLY DATABASE PATCH FOR EXADATA - Apr 2019)
patchid :29698813 (DB 11.2.0.4.190716 QUARTERLY DATABASE PATCH FOR EXADATA - Jul 2019)
patchid :30070157 (DB 11.2.0.4.191015 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2019)
patchid :30501894 (DB 11.2.0.4.200114 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2020)
patchid :30805507 (DB 11.2.0.4.200414 QUARTERLY DATABASE PATCH FOR EXADATA - Apr 2020)
patchid :31220011 (DB 11.2.0.4.200714 QUARTERLY DATABASE PATCH FOR EXADATA - Jul 2020)
patchid :31718644 (DB 11.2.0.4.201020 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2020)
patchid :32131241 (DB 11.2.0.4.210119 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2021)
patchid :32537095 (DB 11.2.0.4.210420 QUARTERLY DATABASE PATCH FOR EXADATA - Apr 2021)
patchid :32917411 (DB 11.2.0.4.210720 QUARTERLY DATABASE PATCH FOR EXADATA - Jul 2021)
patchid :33248386 (DB 11.2.0.4.211019 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2021)
patchid :33575241 (DB 11.2.0.4.220118 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2022)
Install database patch using
dbaascli patch db apply --patchid 33575241 --dbnames <>
ShellScriptVerificar os patchs disponíveis para serem aplicados Node 2:
[root@srv01 ~]# dbaascli patch db list --oh srv01:/u02/app/oracle/product/11.2.0/dbhome_2
DBAAS CLI version 19.1.1.1.0
Executing command patch db list --oh srv01:/u02/app/oracle/product/11.2.0/dbhome_2
INFO : EXACS patching
Available Patches
patchid :26610265 (DB 11.2.0.4.170814 QUARTERLY DATABASE PATCH FOR EXADATA - Aug 2017)
patchid :26635694 (DB 11.2.0.4.171017 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2017)
patchid :27011043 (DB 11.2.0.4.180116 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2018)
patchid :27475722 (DB 11.2.0.4.180417 QUARTERLY DATABASE PATCH FOR EXADATA - Apr 2018)
patchid :27980213 (DB 11.2.0.4.180717 QUARTERLY DATABASE PATCH FOR EXADATA - Jul 2018)
patchid :28462975 (DB 11.2.0.4.181016 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2018)
patchid :28833571 (DB 11.2.0.4.190115 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2019)
patchid :29257245 (DB 11.2.0.4.190416 QUARTERLY DATABASE PATCH FOR EXADATA - Apr 2019)
patchid :29698813 (DB 11.2.0.4.190716 QUARTERLY DATABASE PATCH FOR EXADATA - Jul 2019)
patchid :30070157 (DB 11.2.0.4.191015 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2019)
patchid :30501894 (DB 11.2.0.4.200114 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2020)
patchid :30805507 (DB 11.2.0.4.200414 QUARTERLY DATABASE PATCH FOR EXADATA - Apr 2020)
patchid :31220011 (DB 11.2.0.4.200714 QUARTERLY DATABASE PATCH FOR EXADATA - Jul 2020)
patchid :31718644 (DB 11.2.0.4.201020 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2020)
patchid :32131241 (DB 11.2.0.4.210119 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2021)
patchid :32537095 (DB 11.2.0.4.210420 QUARTERLY DATABASE PATCH FOR EXADATA - Apr 2021)
patchid :32917411 (DB 11.2.0.4.210720 QUARTERLY DATABASE PATCH FOR EXADATA - Jul 2021)
patchid :33248386 (DB 11.2.0.4.211019 QUARTERLY DATABASE PATCH FOR EXADATA - Oct 2021)
patchid :33575241 (DB 11.2.0.4.220118 QUARTERLY DATABASE PATCH FOR EXADATA - Jan 2022)
Install database patch using
dbaascli patch db apply --patchid 33575241 --dbnames <>
ShellScriptExecutar o precheck em todos os nós antes de aplicar o patchid 33575241 Node 1:
[root@srv01 ~]$ dbaascli patch db prereq --patchid 33575241 --instance1 srv01:/u02/app/oracle/product/11.2.0/dbhome_2 --dbnames DBPROD -alldbs
ShellScriptExecutar o precheck em todos os nós antes de aplicar o patchid 33575241 Node 2:
[root@srv02 ~]$ dbaascli patch db prereq --patchid 33575241 --instance1 srv02:/u02/app/oracle/product/11.2.0/dbhome_2 --dbnames DBPROD -alldbs
ShellScriptLogs do precheck:
INFO: status of slave txn###: Precheck completed on srv01
INFO: -precheck_async completed on srv01:/u02/app/oracle/product/11.2.0/dbhome_2
INFO: Successfully released ohome lock. Proceeding to release local provisioning lock
INFO: Successfully released local provisioning lock
INFO: -precheck_async completed on all nodes
INFO: status of slave txn###: Precheck completed on srv02
INFO: -precheck_async completed on srv02:/u02/app/oracle/product/11.2.0/dbhome_2
INFO: Successfully released ohome lock. Proceeding to release local provisioning lock
INFO: Successfully released local provisioning lock
INFO: -precheck_async completed on all nodes
ShellScriptAplicar o patchid 33575241 no node srv02:
[root@srv02 ~]$ nohup dbaascli patch db apply --patchid 33575241 --instance1 srv02:/u02/app/oracle/product/11.2.0/dbhome_2 --dbnames DBPROD --run_datasql 0 &
ShellScriptAcompanhando os logs da aplicação do patch:
[root@srv02 ~]$ tail -f /var/opt/oracle/log/exadbcpatch/exadbcpatch.log
2022-05-19 18:07:00.950618 - Instance check cleared for node srv02 w.r.t nodelist
2022-05-19 18:07:00.950760 - INFO: deleting patching_progress, patched_ohome, patched_ohome_name from creg
2022-05-19 18:07:00.958084 - INFO: deleted patching_progress, patched_ohome, patched_ohome_name from creg
2022-05-19 18:07:00.958209 -
INFO: initpatch being run for post ecs patching
2022-05-19 18:07:00.958467 - Output from cmd /var/opt/oracle/misc/initpatch.pl ecsbppost run on localhost is:
INFO : No patch needed
2022-05-19 18:07:01.510654 - cmd took 0.551481008529663 seconds
2022-05-19 18:07:01.510964 - ##### INFO: Exadbcpatch completed successfully #####
ShellScriptAplicar o patchid 33575241 no node srv01:
[root@srv02 ~]$ nohup dbaascli patch db apply --patchid 33575241 --instance1 srv01:/u02/app/oracle/product/11.2.0/dbhome_2 --dbnames DBPROD --run_datasql 0 &
ShellScriptAcompanhando os logs da aplicação do patch:
[root@srv01 ~]$ tail -f /var/opt/oracle/log/exadbcpatch/exadbcpatch.log
2022-05-20 09:47:27.879789 - Instance check cleared for node srv01 w.r.t nodelist
2022-05-20 09:47:27.880011 - INFO: deleting patching_progress, patched_ohome, patched_ohome_name from creg
2022-05-20 09:47:27.891809 - INFO: deleted patching_progress, patched_ohome, patched_ohome_name from creg
2022-05-20 09:47:27.892030 -
INFO: initpatch being run for post ecs patching
2022-05-20 09:47:27.893285 - Output from cmd /var/opt/oracle/misc/initpatch.pl ecsbppost run on localhost is:
INFO : No patch needed
2022-05-20 09:47:28.447038 - cmd took 0.553269147872925 seconds
2022-05-20 09:47:28.447205 - ##### INFO: Exadbcpatch completed successfully #####
ShellScript