How to apply PSU patch on Oracle Database 18C

Fiz a instalação de um Oracle Database 18C há um bom tempo, e ainda não havia aplicado PSU nele (apenas alguns patches específicos devido bug). Desse modo, para não ficar recebendo erro de graça durante meus laboratórios, pretendo aplicar o último PSU disponível (JAN21). Ao acessar o Oracle Note “Database 18 Proactive Patch Information (Doc ID 2369376.1)” consigo acessar a parte de download:

Como meu ambiente não possui o GRID instalado, me atento apenas ao sistema operacional e seleciona o Database Release Patch:

Realizando o download:

Enquanto o arquivo passa pelo download, podemos ver no Readme que é necessário uma versão de OPatch mínima 12.2.0.1.23. Validando a versão que eu possuo:

[oracle@oel8 OPatch]$ cd $ORACLE_HOME/OPatch
[oracle@oel8 OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.14
 
OPatch succeeded.

Como constatado, minha versão é inferior, e o próprio readme possui um link para que possamos baixar o Opatch:

Seleciono minha release e S.O:

Movendo meu atual OPatch para uma pasta backup:

[oracle@oel8 OPatch]$ cd ..
[oracle@oel8 product]$ mv OPatch/ OPatch_OLD

Download do OPatch concluído. Podemos realizar o unzip para o DB_HOME:

[oracle@oel8 ~]$ unzip -d /oracle/18.0.0/product/ p6880880_180000_Linux-x86-64.zip
Archive:  p6880880_180000_Linux-x86-64.zip
   creating: /oracle/18.0.0/product/OPatch/
  inflating: /oracle/18.0.0/product/OPatch/emdpatch.pl
 
...
 
  inflating: /oracle/18.0.0/product/OPatch/operr
  inflating: /oracle/18.0.0/product/OPatch/opatchauto.cmd
[oracle@oel8 ~]$

Validado com sucesso:

[oracle@oel8 OPatch]$ cd $ORACLE_HOME/OPatch
[oracle@oel8 OPatch]$ ./opatch version
OPatch Version: 12.2.0.1.24
 
OPatch succeeded.

Obviamente, no readme também é mencionado a sugestão de termos um backup dos binários e inventário do Oracle. Como este meu ambiente é apenas um lab, fiz simplesmente um snapshot da minha VM pelo VirtualBox.

Agora posso descompactar o arquivo do PSU em si:

[oracle@oel8 ~]$ unzip p32204699_180000_Linux-x86-64.zip
Archive:  p32204699_180000_Linux-x86-64.zip
   creating: 32204699/
   creating: 32204699/etc/
   creating: 32204699/etc/config/
 
...
 
  inflating: 32204699/custom/scripts/init
  inflating: 32204699/README.html
 extracting: 32204699/README.txt
replace PatchSearch.xml? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
  inflating: PatchSearch.xml

Entrando na pasta que foi criada:

[oracle@oel8 ~]$ cd 32204699
[oracle@oel8 32204699]$ ll
total 84
drwxr-x---.  3 oracle oinstall    21 Jan 12 16:02 custom
drwxr-x---.  3 oracle oinstall    20 Jan 12 15:59 etc
drwxr-x---. 30 oracle oinstall  4096 Jan 12 15:59 files
-rw-r--r--.  1 oracle oinstall 73836 Jan 12 16:02 README.html
-rw-r--r--.  1 oracle oinstall    21 Jan 12 16:02 README.txt

Verificando se o PSU possui algum conflito com algum patch que já tenha sido aplicado no ambiente:

[oracle@oel8 32204699]$ /oracle/18.0.0/product/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2021, Oracle Corporation.  All rights reserved.
 
PREREQ session
 
Oracle Home       : /oracle/18.0.0/product
Central Inventory : /oracle/18.0.0/oraInventory
   from           : /oracle/18.0.0/product/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.4.0
Log file location : /oracle/18.0.0/product/cfgtoollogs/opatch/opatch2021-03-20_10-38-24AM_1.log
 
Invoking prereq "checkconflictagainstohwithdetail"
 
Prereq "checkConflictAgainstOHWithDetail" passed.
 
OPatch succeeded.
[oracle@oel8 32204699]$

Já que não foi reportada nenhum incompatibilidade, podemos aplicar o PSU. Antes disso, vou baixar o Oracle Database e o listener:

[oracle@oel8 32204699]$ sqlplus / as sysdba
 
SQL*Plus: Release 18.0.0.0.0 - Production on Sat Mar 20 10:39:30 2021
Version 18.3.0.0.0
 
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
 
 
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
 
SQL> SHU IMMEDIATE;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
[oracle@oel8 32204699]$ lsnrctl stop
 
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 20-MAR-2021 10:40:16
 
Copyright (c) 1991, 2018, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oel8.localdomain)(PORT=1521)))
The command completed successfully

Aplicando o PSU (com sucesso):

[oracle@oel8 32204699]$ /oracle/18.0.0/product/OPatch/opatch apply
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2021, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /oracle/18.0.0/product
Central Inventory : /oracle/18.0.0/oraInventory
   from           : /oracle/18.0.0/product/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.4.0
Log file location : /oracle/18.0.0/product/cfgtoollogs/opatch/opatch2021-03-20_10-41-03AM_1.log
 
Verifying environment and performing prerequisite checks...
 
--------------------------------------------------------------------------------
Start OOP by Prereq process.
Launch OOP...
 
Oracle Interim Patch Installer version 12.2.0.1.24
Copyright (c) 2021, Oracle Corporation.  All rights reserved.
 
 
Oracle Home       : /oracle/18.0.0/product
Central Inventory : /oracle/18.0.0/oraInventory
   from           : /oracle/18.0.0/product/oraInst.loc
OPatch version    : 12.2.0.1.24
OUI version       : 12.2.0.4.0
Log file location : /oracle/18.0.0/product/cfgtoollogs/opatch/opatch2021-03-20_10-41-22AM_1.log
 
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   32204699
 
Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
 
Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/oracle/18.0.0/product')
 
 
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying interim patch '32204699' to OH '/oracle/18.0.0/product'
ApplySession: Optional component(s) [ oracle.assistants.server.oui, 18.0.0.0.0 ] , [ oracle.has.crs, 18.0.0.0.0 ] , [ oracle.network.gsm, 18.0.0.0.0 ] , [ oracle.tfa, 18.0.0.0.0 ] , [ oracle.oid.client, 18.0.0.0.0 ] , [ oracle.network.cman, 18.0.0.0.0 ] , [ oracle.assistants.asm, 18.0.0.0.0 ] , [ oracle.options.olap, 18.0.0.0.0 ] , [ oracle.rdbms.tg4tera, 18.0.0.0.0 ] , [ oracle.rdbms.tg4db2, 18.0.0.0.0 ] , [ oracle.rdbms.tg4sybs, 18.0.0.0.0 ] , [ oracle.rdbms.tg4msql, 18.0.0.0.0 ] , [ oracle.assistants.usm, 18.0.0.0.0 ] , [ oracle.ons.daemon, 18.0.0.0.0 ] , [ oracle.net.cman, 18.0.0.0.0 ] , [ oracle.crs, 18.0.0.0.0 ] , [ oracle.rdbms.tg4ifmx, 18.0.0.0.0 ] , [ oracle.jdk, 1.8.0.171.00 ]  not present in the Oracle Home or a higher version is found.
 
Patching component oracle.rdbms.util, 18.0.0.0.0...
 
Patching component oracle.rdbms, 18.0.0.0.0...
 
Patching component oracle.rdbms.rsf, 18.0.0.0.0...
 
Patching component oracle.assistants.acf, 18.0.0.0.0...
 
Patching component oracle.assistants.server, 18.0.0.0.0...
 
Patching component oracle.ctx, 18.0.0.0.0...
 
Patching component oracle.dbdev, 18.0.0.0.0...
 
Patching component oracle.dbjava.ic, 18.0.0.0.0...
 
Patching component oracle.dbjava.jdbc, 18.0.0.0.0...
 
Patching component oracle.dbjava.ucp, 18.0.0.0.0...
 
Patching component oracle.dbtoolslistener, 18.0.0.0.0...
 
Patching component oracle.javavm.client, 18.0.0.0.0...
 
Patching component oracle.ldap.owm, 18.0.0.0.0...
 
Patching component oracle.ldap.rsf, 18.0.0.0.0...
 
Patching component oracle.ldap.security.osdt, 18.0.0.0.0...
 
Patching component oracle.network.rsf, 18.0.0.0.0...
 
Patching component oracle.oracore.rsf, 18.0.0.0.0...
 
Patching component oracle.rdbms.dbscripts, 18.0.0.0.0...
 
Patching component oracle.rdbms.deconfig, 18.0.0.0.0...
 
Patching component oracle.rdbms.install.common, 18.0.0.0.0...
 
Patching component oracle.rdbms.install.plugins, 18.0.0.0.0...
 
Patching component oracle.rdbms.oci, 18.0.0.0.0...
 
Patching component oracle.sdo, 18.0.0.0.0...
 
Patching component oracle.sdo.locator.jrf, 18.0.0.0.0...
 
Patching component oracle.sqlplus, 18.0.0.0.0...
 
Patching component oracle.swd.opatchautodb, 12.2.0.1.5...
 
Patching component oracle.precomp.rsf, 18.0.0.0.0...
 
Patching component oracle.ons, 18.0.0.0.0...
 
Patching component oracle.oraolap.dbscripts, 18.0.0.0.0...
 
Patching component oracle.duma, 18.0.0.0.0...
 
Patching component oracle.ldap.client, 18.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf.core, 18.0.0.0.0...
 
Patching component oracle.rdbms.crs, 18.0.0.0.0...
 
Patching component oracle.rdbms.lbac, 18.0.0.0.0...
 
Patching component oracle.rdbms.hsodbc, 18.0.0.0.0...
 
Patching component oracle.oraolap, 18.0.0.0.0...
 
Patching component oracle.xdk.parser.java, 18.0.0.0.0...
 
Patching component oracle.xdk, 18.0.0.0.0...
 
Patching component oracle.ldap.ssl, 18.0.0.0.0...
 
Patching component oracle.assistants.deconfig, 18.0.0.0.0...
 
Patching component oracle.server, 18.0.0.0.0...
 
Patching component oracle.ctx.atg, 18.0.0.0.0...
 
Patching component oracle.sqlplus.ic, 18.0.0.0.0...
 
Patching component oracle.sdo.locator, 18.0.0.0.0...
 
Patching component oracle.xdk.rsf, 18.0.0.0.0...
 
Patching component oracle.rdbms.dv, 18.0.0.0.0...
 
Patching component oracle.ctx.rsf, 18.0.0.0.0...
 
Patching component oracle.network.client, 18.0.0.0.0...
 
Patching component oracle.ldap.rsf.ic, 18.0.0.0.0...
 
Patching component oracle.network.listener, 18.0.0.0.0...
 
Patching component oracle.odbc, 18.0.0.0.0...
 
Patching component oracle.rdbms.drdaas, 18.0.0.0.0...
 
Patching component oracle.rdbms.rman, 18.0.0.0.0...
 
Patching component oracle.nlsrtl.rsf, 18.0.0.0.0...
 
Patching component oracle.install.deinstalltool, 18.0.0.0.0...
 
Patching component oracle.rdbms.rsf.ic, 18.0.0.0.0...
 
Patching component oracle.precomp.common, 18.0.0.0.0...
 
Patching component oracle.precomp.lang, 18.0.0.0.0...
 
Patching component oracle.jdk, 1.8.0.152.0...
Patch 32204699 successfully applied.
Sub-set patch [28502403] has become inactive due to the application of a super-set patch [32204699].
Sub-set patch [27908644] has become inactive due to the application of a super-set patch [32204699].
Sub-set patch [28090523] has become inactive due to the application of a super-set patch [32204699].
Please refer to Doc ID 2161861.1 for any possible further required actions.
Log file location: /oracle/18.0.0/product/cfgtoollogs/opatch/opatch2021-03-20_10-41-22AM_1.log
 
OPatch succeeded.
[oracle@oel8 32204699]$

Validando:

[oracle@oel8 32204699]$ cd $ORACLE_HOME/OPatch
[oracle@oel8 OPatch]$ ./opatch lsinventory | grep escript
ARU platform description:: Linux x86-64
Patch description:  "Database Release Update : 18.13.0.0.210119 (32204699)"
Patch description:  "OJVM RELEASE UPDATE: 18.3.0.0.180717 (27923415)"
Patch description:  "OCW RELEASE UPDATE 18.3.0.0.0 (28090553)"
[oracle@oel8 OPatch]$

Banco de dados operacional:

[oracle@oel8 OPatch]$ sqlplus / as sysdba
 
SQL*Plus: Release 18.0.0.0.0 - Production on Sat Mar 20 10:47:57 2021
Version 18.13.0.0.0
 
Copyright (c) 1982, 2018, Oracle.  All rights reserved.
 
Connected to an idle instance.
 
SQL> STARTUP;
ORACLE instance started.
 
Total System Global Area 2466249080 bytes
Fixed Size                  8898936 bytes
Variable Size             671088640 bytes
Database Buffers         1778384896 bytes
Redo Buffers                7876608 bytes
Database mounted.
Database opened.
SQL> SELECT INSTANCE_NAME,STATUS FROM V$INSTANCE;
 
INSTANCE_NAME    STATUS
---------------- ------------
TALAMO           OPEN

2 thoughts on “How to apply PSU patch on Oracle Database 18C”

  1. Pingback: Creating a new PDB by cloning from Non-CDB (using DBLINK) – Bruno Santos da Silva

  2. Pingback: Creating a new PDB by cloning from Non-CDB (using DBLINK) – SWIV

Leave a Comment

Your email address will not be published.