Pentru a ințelege importanța aplicării patch-urilor este nevoie să înțelegem ce reprezintă un patch. Un patch este o bucată de cod care îmbunătățește un program deja instalat, practic un bandaj pentru software de calculator. Odată descoperită o eroare/un bug într-un program deja lansat, se creează un patch pentru a remedia problema fără a fi necesară re-crearea programului. Printre beneficiile aduse de instalarea patch-urilor se regăsesc îmbunătățiri de securitate, productivitate, conformitate si inovație.

Dacă în articolele precedente am vazut care sunt pașii pentru a instala o bază de date Oracle 19c RAC, în acest articol vom urmări cum actualizăm Oracle Grid Infrastructure și Oracle Database.

Descărcare patch-uri

Înainte de planificarea instalării unui patch trebuie să verificăm dacă avem acces la patch-ul pe care dorim să-l instalăm. Pentru acest lucru avem nevoie de un cont activ pe support.oracle.com

Update OPatch

Întotdeauna înainte de instalarea unui patch verificați dacă aveți ultima versiune a tool-ului OPatch.

Copiați patch-urile descărcate anterior pe ambele noduri pe un disc local unde aveți disponibil minim 7 GB.

Update-ul de OPatch trebuie făcută atât în home-ul de GI, cât și cel de RDBMS pe toate instanțele.

 $ $ORACLE_HOME/OPatch/opatch version
 OPatch Version: 12.2.0.17.0
 OPatch succeeded.
 $ cp p6880880_190000_Linux-x86-64.zip $ORACLE_HOME
 $ cd $ORACLE_HOME
 $ mv OPatch OPatch_OLD
 $ unzip p6880880_190000_Linux-x86-64.zip
 $ $ORACLE_HOME/OPatch/opatch version
 OPatch Version: 12.2.0.19.0
 OPatch succeeded.

Check for conflict

După ce ne-am asigurat că am instalat ultima versiune de OPatch trebuie să verificăm dacă există conflicte intre patch-urile instalate și cele care urmează să fie instalate. Primul pas este să dezarhivăm patch-ul descărcat anterior după care vom verifica cu OPatch conflictele atât pe home-ul de GI cât și pe RDBMS:

 $ unzip p30463609_190000_Linux-x86-64.zip

tree

Când am descarcat patch-ul am ales Combo-ul care conține următoarele patch-uri:

  • 30484981 – OJVM Release Update 19.6.0.0.200114
  • 30501910 – GI Release Update 19.6.0.0.200114
  • 30557433 – Database Release Update 19.6.0.0.200114

Verificăm pe rând toate patch-urile, atât pentru home-ul de GI:

$ env | grep ORACLE_HOME
ORACLE_HOME=/opt/app/grid/19c
$

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/patch/30463609/30484981

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/patch/30463609/30501910/30489227

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/patch/30463609/30501910/30489632

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/patch/30463609/30501910/30557433

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/patch/30463609/30501910/30655595

cât și pentru RDBMS:

$ env | grep ORACLE_HOME
ORACLE_HOME=/opt/app/oracle/product/19c/dbhome_1
$
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /tmp/patch/30463609/30501910/30557433

In cazul in care există un patch care este în conflict, va fi necesar rollback si verificat din nou conflictul pana cand rezultatul este Succes pentru fiecare din patch-urile de mai sus.

Verificare

Înainte de a aplica, verificăm patch-urile instalate pe toate home-urile ce urmează să fie aplicate patch-uri:

$ $ORACLE_HOME/OPatch/opatch lspatches -oh /opt/app/grid/19c
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517247;ACFS RELEASE UPDATE 19.3.0.0.0 (29517247)
29517242;Database Release Update : 19.3.0.0.190416 (29517242)
29401763;TOMCAT RELEASE UPDATE 19.0.0.0.0 (29401763)

OPatch succeeded.
$ $ORACLE_HOME/OPatch/opatch lspatches -oh /opt/app/oracle/product/19c/dbhome_1
29585399;OCW RELEASE UPDATE 19.3.0.0.0 (29585399)
29517242;Database Release Update : 19.3.0.0.190416 (29517242)

OPatch succeeded.

Pentru a aplica patch-ul cu opatchauto avem mai multe posibilități:

1) aplicare patch-ului doar pe home-ul de GI:

$opatchauto apply /30501910 -oh /opt/app/grid/19c

Respectiv home-ul de RDBMS:

$opatchauto apply /30501910 -oh /opt/app/oracle/product/19c/dbhome_1

2) Sau putem aplica patch-ul rulând opatchauto cu root fără a specifica home-ul Oracle.

Aplicare Patch

In cazul de față am ales să rulez opatchauto cu root, astfel patch-urile vor fi instalate pe toate home-urile înregistrate în OraInventory.

Pentru a verifica că nu vor exista probleme în timpul aplicarii patch-urilor rulăm întâi o simulare a aplicării celor două patch-uri:

# /opt/app/grid/19c/OPatch/opatchauto apply /tmp/patch/30463609/30501910 -analyze

# /opt/app/grid/19c/OPatch/opatchauto apply /tmp/patch/30463609/30484981 -analyze

Dacă ambele comenzi s-au finalizat cu succes putem continua rulând din nou aceleași comenzi dar fără „-analyze”:

# /opt/app/grid/19c/OPatch/opatchauto apply /tmp/patch/30463609/30501910

System initialization log file is /opt/app/grid/19c/cfgtoollogs/opatchautodb/systemconfig2020-04-11_01-51-47PM.log.

Session log file is /opt/app/grid/19c/cfgtoollogs/opatchauto/opatchauto2020-04-11_01-59-30PM.log
The id for this session is I559

Executing OPatch prereq operations to verify patch applicability on home /opt/app/grid/19c

Executing OPatch prereq operations to verify patch applicability on home /opt/app/oracle/product/19c/dbhome_1
Patch applicability verified successfully on home /opt/app/oracle/product/19c/dbhome_1

Patch applicability verified successfully on home /opt/app/grid/19c
Verifying SQL patch applicability on home /opt/app/oracle/product/19c/dbhome_1
SQL patch applicability verified successfully on home /opt/app/oracle/product/19c/dbhome_1
Preparing to bring down database service on home /opt/app/oracle/product/19c/dbhome_1
Successfully prepared home /opt/app/oracle/product/19c/dbhome_1 to bring down database service
Bringing down CRS service on home /opt/app/grid/19c
CRS service brought down successfully on home /opt/app/grid/19c
Performing prepatch operation on home /opt/app/oracle/product/19c/dbhome_1
Perpatch operation completed successfully on home /opt/app/oracle/product/19c/dbhome_1
Start applying binary patch on home /opt/app/oracle/product/19c/dbhome_1

Binary patch applied successfully on home /opt/app/oracle/product/19c/dbhome_1
Performing postpatch operation on home /opt/app/oracle/product/19c/dbhome_1
Postpatch operation completed successfully on home /opt/app/oracle/product/19c/dbhome_1
Start applying binary patch on home /opt/app/grid/19c
Binary patch applied successfully on home /opt/app/grid/19c

Checking shared status of home.....

Starting CRS service on home /opt/app/grid/19c
CRS service started successfully on home /opt/app/grid/19c
Preparing home /opt/app/oracle/product/19c/dbhome_1 after database service restarted
No step execution required.........
Trying to apply SQL patch on home /opt/app/oracle/product/19c/dbhome_1

SQL patch applied successfully on home /opt/app/oracle/product/19c/dbhome_1

OPatchAuto successful.

Si acelasi lucru si pentru patch-ul OJVM:

# /opt/app/grid/19c/OPatch/opatchauto apply /tmp/patch/30463609/30484981

System initialization log file is /opt/app/grid/19c/cfgtoollogs/opatchautodb/systemconfig2020-04-11_04-28-36PM.log.

Session log file is /opt/app/grid/19c/cfgtoollogs/opatchauto/opatchauto2020-04-11_04-41-46PM.log
The id for this session is 6V25

Executing OPatch prereq operations to verify patch applicability on home /opt/app/grid/19c

Executing OPatch prereq operations to verify patch applicability on home /opt/app/oracle/product/19c/dbhome_1
Patch applicability verified successfully on home /opt/app/grid/19c

Patch applicability verified successfully on home /opt/app/oracle/product/19c/dbhome_1
Verifying SQL patch applicability on home /opt/app/oracle/product/19c/dbhome_1
SQL patch applicability verified successfully on home /opt/app/oracle/product/19c/dbhome_1
Preparing to bring down database service on home /opt/app/oracle/product/19c/dbhome_1
Successfully prepared home /opt/app/oracle/product/19c/dbhome_1 to bring down database service
Bringing down database service on home /opt/app/oracle/product/19c/dbhome_1
Following database(s) and/or service(s) are stopped and will be restarted later during the session: orcl
Database service successfully brought down on home /opt/app/oracle/product/19c/dbhome_1
Bringing down CRS service on home /opt/app/grid/19c
CRS service brought down successfully on home /opt/app/grid/19c
Performing prepatch operation on home /opt/app/oracle/product/19c/dbhome_1
Perpatch operation completed successfully on home /opt/app/oracle/product/19c/dbhome_1
Start applying binary patch on home /opt/app/oracle/product/19c/dbhome_1
Binary patch applied successfully on home /opt/app/oracle/product/19c/dbhome_1
Performing postpatch operation on home /opt/app/oracle/product/19c/dbhome_1
Postpatch operation completed successfully on home /opt/app/oracle/product/19c/dbhome_1
Start applying binary patch on home /opt/app/grid/19c
Binary patch applied successfully on home /opt/app/grid/19c
Starting CRS service on home /opt/app/grid/19c
CRS service started successfully on home /opt/app/grid/19c
Starting database service on home /opt/app/oracle/product/19c/dbhome_1
Database service successfully started on home /opt/app/oracle/product/19c/dbhome_1
Preparing home /opt/app/oracle/product/19c/dbhome_1 after database service restarted
No step execution required.........
Trying to apply SQL patch on home /opt/app/oracle/product/19c/dbhome_1

SQL patch applied successfully on home /opt/app/oracle/product/19c/dbhome_1

OPatchAuto successful.

Verificare post patch

$ORACLE_HOME/OPatch/opatch lspatches -oh /opt/app/grid/19c
30655595;TOMCAT RELEASE UPDATE 19.0.0.0.0 (30655595)
30557433;Database Release Update : 19.6.0.0.200114 (30557433)
30489632;ACFS RELEASE UPDATE 19.6.0.0.0 (30489632)
30489227;OCW RELEASE UPDATE 19.6.0.0.0 (30489227)

OPatch succeeded.
$ORACLE_HOME/OPatch/opatch lspatches -oh /opt/app/oracle/product/19c/dbhome_1
30557433;Database Release Update : 19.6.0.0.200114 (30557433)
30489227;OCW RELEASE UPDATE 19.6.0.0.0 (30489227)

OPatch succeeded.

De asemenea verificăm dacă s-au aplicat scripturile SQL în baza de date:

$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production 
Version 19.6.0.0.0

Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.6.0.0.0

set pagesize 20;
set linesize 200;
col ACTION_TIME format a30;

col DESCRIPTION format a60
SQL> select PATCH_ID,ACTION,DESCRIPTION,STATUS from registry$sqlpatch order by ACTION_TIME ;

PATCH_ID ACTION  DESCRIPTION                                         STATUS
---------- --------------- ------------------------------ --------------------
29517242 APPLY  Database Release Update : 19.3.0.0.190416 (29517242) SUCCESS
30557433 APPLY  Database Release Update : 19.6.0.0.200114 (30557433) SUCCESS
30484981 APPLY  OJVM RELEASE UPDATE: 19.6.0.0.200114 (30484981)      SUCCESS

SQL>

Lasă un răspuns

Completează mai jos detaliile cerute sau dă clic pe un icon pentru a te autentifica:

Logo WordPress.com

Comentezi folosind contul tău WordPress.com. Dezautentificare /  Schimbă )

Fotografie Facebook

Comentezi folosind contul tău Facebook. Dezautentificare /  Schimbă )

Conectare la %s

Mathijs Bruggink

Tips Tricks and Blogs on Oracle

Oracle Romania

Simplify IT

Programat in Romania

Blogul industriei de software din Romania. Comunitate dezvoltatori

Dan Bârsan

The miracle is not that we do this work, but that we are happy to do it. I'm writing in Romanian and English

Romanian Oracle User Group

Focusing On Oracle Database Administration

Big Lazy SysAdmin

Adapt. Enjoy. Survive.

Talip Hakan Ozturk's ORACLE BLOG

The secret of success is at your fingertips!...

Pickleball spielen

002 - License to dink

Mathijs Bruggink

Tips Tricks and Blogs on Oracle

Oracle Romania

Simplify IT

Programat in Romania

Blogul industriei de software din Romania. Comunitate dezvoltatori

Dan Bârsan

The miracle is not that we do this work, but that we are happy to do it. I'm writing in Romanian and English

Romanian Oracle User Group

Focusing On Oracle Database Administration

Big Lazy SysAdmin

Adapt. Enjoy. Survive.

Talip Hakan Ozturk's ORACLE BLOG

The secret of success is at your fingertips!...

Pickleball spielen

002 - License to dink

%d blogeri au apreciat: