Nos artigos anteriores, realizamos a atualização da camada de Sistema Operacional e GRID, e agora vamos avançar na camada de DB Home.
Validando versão vigente pelo utilitário DB CLI e a sugerida para atualização (de modo que, se aplicada, o DB Home ficará up-to-date):
[opc@luxor ~]$ sudo su -
Last login: Mon May 31 07:00:55 UTC 2021
[root@luxor ~]# dbcli describe-component
System Version
---------------
21.1.3.3.0
Component Installed Version Available Version
---------------------------------------- -------------------- --------------------
GI 19.11.0.0.0 up-to-date
DB 12.2.0.1.201020 12.2.0.1.210420
Para garantir que o Data Patch será aplicado ao nosso banco de dados, devemos garantir que o mesmo está up:
[root@luxor ~]# exit
logout
[opc@luxor ~]$ sudo su - oracle
Last login: Mon May 31 07:01:02 UTC 2021
[oracle@luxor ~]$ srvctl status database -db $ORACLE_UNQNAME
Instance CORTEX is not running on node luxor
[oracle@luxor ~]$ srvctl start database -db $ORACLE_UNQNAME
[oracle@luxor ~]$ srvctl status database -db $ORACLE_UNQNAME
Instance CORTEX is running on node luxor
Nessa etapa, precisamos coletar o DB Home ID conforme comando abaixo:
[oracle@luxor ~]$ exit
logout
[opc@luxor ~]$ sudo su -
Last login: Mon May 31 07:01:15 UTC 2021 on pts/0
[root@luxor ~]# dbcli list-databases
ID DB Name DB Type DB Version CDB Class Shape Storage Status DbHomeID
---------------------------------------- ---------- -------- -------------------- ---------- -------- -------- ---------- ------------ ----------------------------------------
4c906765-68ea-4e05-ba3f-c54152f912cf CORTEX Si 12.2.0.1.201020 true Oltp ASM Configured 8bc7f0a5-6230-4b99-b568-b73cf0038525
Caso queiramos nos certificar que todos os pré-requisitos são atendidos e que o ambiente está apto para atualização, podemos rodar o pré-check abaixo:
[root@luxor ~]# dbcli update-dbhome --precheck
Missing/invalid Arguments
Please refer usage: dbcli update-dbhome -h
[root@luxor ~]# dbcli update-dbhome -i "8bc7f0a5-6230-4b99-b568-b73cf0038525" --precheck
{
"jobId" : "1e436ec5-136d-4760-80d0-d7cf62e4f2d2",
"status" : "Created",
"message" : null,
"reports" : [ ],
"createTimestamp" : "May 31, 2021 07:11:14 AM UTC",
"resourceList" : [ ],
"description" : "DBHome Prechecks",
"updatedTime" : "May 31, 2021 07:11:14 AM UTC",
"percentageProgress" : "0%"
}
Acompanhando a evolução do Job que foi criado:
[root@luxor ~]# dbcli describe-job -i "1e436ec5-136d-4760-80d0-d7cf62e4f2d2"
Job details
----------------------------------------------------------------
ID: 1e436ec5-136d-4760-80d0-d7cf62e4f2d2
Description: DBHome Prechecks
Status: Running
Created: May 31, 2021 7:11:14 AM UTC
Progress: 50%
Message:
Task Name Start Time End Time Status
------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
Pre-operations for DBHome patching May 31, 2021 7:11:15 AM UTC May 31, 2021 7:12:28 AM UTC Success
DBHome patching May 31, 2021 7:12:28 AM UTC May 31, 2021 7:12:28 AM UTC Running
Job de verificação finalizado com sucesso:
[root@luxor ~]# dbcli describe-job -i "1e436ec5-136d-4760-80d0-d7cf62e4f2d2"
Job details
----------------------------------------------------------------
ID: 1e436ec5-136d-4760-80d0-d7cf62e4f2d2
Description: DBHome Prechecks
Status: Success
Created: May 31, 2021 7:11:14 AM UTC
Progress: 100%
Message:
Task Name Start Time End Time Status
------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
Pre-operations for DBHome patching May 31, 2021 7:11:15 AM UTC May 31, 2021 7:12:28 AM UTC Success
DBHome patching May 31, 2021 7:12:28 AM UTC May 31, 2021 7:17:30 AM UTC Success
Post-operations for DBHome patching May 31, 2021 7:17:30 AM UTC May 31, 2021 7:17:35 AM UTC Success
Disparando efetivamente o patching do DB Home:
[root@luxor ~]# dbcli update-dbhome -i "8bc7f0a5-6230-4b99-b568-b73cf0038525"
{
"jobId" : "65e8f05e-fc9d-4df5-9363-b380317792ca",
"status" : "Created",
"message" : null,
"reports" : [ ],
"createTimestamp" : "May 31, 2021 07:19:42 AM UTC",
"resourceList" : [ ],
"description" : "DBHome Patching: Home ID is 8bc7f0a5-6230-4b99-b568-b73cf0038525",
"updatedTime" : "May 31, 2021 07:19:42 AM UTC",
"percentageProgress" : "0%"
}
Acompanhando o Job:
[root@luxor ~]# dbcli describe-job -i "65e8f05e-fc9d-4df5-9363-b380317792ca"
Job details
----------------------------------------------------------------
ID: 65e8f05e-fc9d-4df5-9363-b380317792ca
Description: DBHome Patching: Home ID is 8bc7f0a5-6230-4b99-b568-b73cf0038525
Status: Running
Created: May 31, 2021 7:19:42 AM UTC
Progress: 20%
Message:
Task Name Start Time End Time Status
------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
Pre-operations for DBHome patching May 31, 2021 7:19:43 AM UTC May 31, 2021 7:20:48 AM UTC Success
DBHome patching May 31, 2021 7:20:48 AM UTC May 31, 2021 7:20:48 AM UTC Running
Processo finalizado com êxito:
[root@luxor ~]# dbcli describe-job -i "65e8f05e-fc9d-4df5-9363-b380317792ca"
Job details
----------------------------------------------------------------
ID: 65e8f05e-fc9d-4df5-9363-b380317792ca
Description: DBHome Patching: Home ID is 8bc7f0a5-6230-4b99-b568-b73cf0038525
Status: Success
Created: May 31, 2021 7:19:42 AM UTC
Progress: 100%
Message:
Task Name Start Time End Time Status
------------------------------------------------------------------------ ----------------------------------- ----------------------------------- ----------
Pre-operations for DBHome patching May 31, 2021 7:19:43 AM UTC May 31, 2021 7:20:48 AM UTC Success
DBHome patching May 31, 2021 7:20:48 AM UTC May 31, 2021 8:03:07 AM UTC Success
Post-operations for DBHome patching May 31, 2021 8:03:07 AM UTC May 31, 2021 8:06:59 AM UTC Success
Validando a versão atual do DB Home:
[root@luxor ~]# dbcli describe-component
System Version
---------------
21.1.3.3.0
Component Installed Version Available Version
---------------------------------------- -------------------- --------------------
GI 19.11.0.0.0 up-to-date
DB 12.2.0.1.210420 up-to-date
Atualização realizada com sucesso conforme evidências:
[root@luxor ~]# exit
logout
[opc@luxor ~]$ sudo su - oracle
Last login: Mon May 31 08:06:53 UTC 2021
[oracle@luxor ~]$ cd $ORACLE_HOME/OPatch
[oracle@luxor OPatch]$ ll
total 200
-rw-r----- 1 oracle oinstall 2980 Feb 1 10:40 README.txt
drwxr-x--- 6 oracle oinstall 4096 Apr 22 2020 auto
drwxr-x--- 2 oracle oinstall 4096 May 31 07:20 config
-rwxr-x--- 1 oracle oinstall 589 Feb 1 10:40 datapatch
-rwxr-x--- 1 oracle oinstall 627 Feb 1 10:40 datapatch.bat
drwxr-x--- 2 oracle oinstall 4096 May 31 07:20 docs
-rwxr-x--- 1 oracle oinstall 23550 Feb 1 10:40 emdpatch.pl
drwxr-x--- 2 oracle oinstall 4096 May 31 07:20 jlib
drwxr-x--- 6 oracle oinstall 4096 May 31 07:20 jre
drwxr-x--- 9 oracle oinstall 4096 May 31 07:20 modules
drwxr-x--- 5 oracle oinstall 4096 May 31 07:20 ocm
-rwxr-x--- 1 oracle oinstall 49564 Feb 1 10:40 opatch
-rwxr-x--- 1 oracle oinstall 16458 Feb 1 10:40 opatch.bat
-rw-r----- 1 oracle oinstall 2551 Feb 1 10:40 opatch.pl
-rwxr-x--- 1 oracle oinstall 4290 Feb 1 10:40 opatch_env.sh
-rwxr-x--- 1 oracle oinstall 1763 Feb 1 10:47 opatchauto
-rwxr-x--- 1 oracle oinstall 393 Feb 1 10:47 opatchauto.cmd
drwxr-x--- 4 oracle oinstall 4096 May 31 07:20 opatchprereqs
-rwxr-x--- 1 oracle oinstall 3159 Feb 1 10:40 operr
-rwxr-x--- 1 oracle oinstall 4218 Feb 1 10:40 operr.bat
-rw-r----- 1 oracle oinstall 3177 Feb 1 10:40 operr_readme.txt
drwxr-x--- 2 oracle oinstall 4096 May 31 07:20 oplan
drwxr-x--- 3 oracle oinstall 4096 Apr 22 2020 oracle_common
drwxr-x--- 3 oracle oinstall 4096 Apr 22 2020 plugins
drwxr-xr-x 2 oracle oinstall 4096 May 31 07:20 private
drwxr-x--- 2 oracle oinstall 4096 May 31 07:20 scripts
-rw-r----- 1 oracle oinstall 27 Feb 1 10:40 version.txt
[oracle@luxor OPatch]$ ./opatch lsinventory | grep escript
ARU platform description:: Linux x86-64
Patch description: "UPDATE PERL IN 12.2.0.1 DATABASE ORACLE HOME TO V5.32"
Patch description: "JDK BUNDLE PATCH 12.2.0.1.210420"
Patch description: "Database Apr 2021 Release Update : 12.2.0.1.210420 (32507738)"
Patch description: "OJVM RELEASE UPDATE 12.2.0.1.201020 (31668898)"
Patch description: "OCW OCT 2020 RELEASE UPDATE 12.2.0.1.201020 (31802727)"
Obs: Este procedimento foi criado pelo senhor Ahmed Baraka (www.ahmedbaraka.com) e foi apenas reproduzido por mim em um laboratório pessoal para fins de aprendizado.