Aplicando os Bundle Patches de JAN 2021 em Oracle Database 12.1.0.2, o datapatch falhou com o erro ORA-22308 ao aplicar o patch “32298703 (MERGE REQUEST ON TOP OF DATABASE BP 12.1.0.2.210119 FOR BUGS 32269583 32269586)”:

  The following patches will be applied:
    32298703 (MERGE REQUEST ON TOP OF DATABASE BP 12.1.0.2.210119 FOR BUGS 32269583 32269586)

Installing patches...
Patch installation complete.  Total patches installed: 1

Validating logfiles...
Patch 32298703 apply: WITH ERRORS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32298703/24007820/32298703_apply_SAMPRD00_2021May04_23_19_55.log (errors)
    Error at line 25067: ORA-22308: operation not allowed on evolved type
    Error at line 25073: ORA-22308: operation not allowed on evolved type

Please refer to MOS Note 1609718.1 and/or the invocation log
/u01/app/oracle/cfgtoollogs/sqlpatch/sqlpatch_74723_2021_05_04_23_19_14/sqlpatch_invocation.log
for information on how to resolve the above errors.

SQL Patching tool complete on Tue May  4 23:23:46 2021

Pesquisando no MOS, achei essa nota que resolveu o problema:

Data Patch Apply fails with ORA-22308: operation not allowed on evolved type (Doc ID 2327572.1)

O doc recomenda executar esses comandos e depois executar o datapatch novamente:

SQL> drop type sys.oracle_loader;
SQL> drop type sys.oracle_datapump;
SQL> @?/rdbms/admin/dpload.sql

Nota: O script dpload.sql deve levar alguns minutos.

Eu optei por recompilar todos os objetos inválidos antes de repetir a execução do datapatch:

SQL> @?/rdbms/admin/utlrp.sql

Então executei o datapatch novamente:

$ORACLE_HOME/OPatch/datapatch -verbose

O patch foi aplicado com sucesso:

  The following patches will be applied:
    32298703 (MERGE REQUEST ON TOP OF DATABASE BP 12.1.0.2.210119 FOR BUGS 32269583 32269586)

Installing patches...
Patch installation complete.  Total patches installed: 1

Validating logfiles...
Patch 32298703 apply: SUCCESS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/32298703/24007820/32298703_apply_SAMPRD00_2021May04_23_32_11.log (no errors)

Consultando no registro do banco de dados, podemos ver 2 entradas para o patch 32298703, a primeira que apresentou falha e a segunda que concluiu com sucesso:

set lin 1000
col patch_id 99999999999
col action form a12
col description form a100
col status format a20
col action_date form a20
select 
patch_id,
description, 
action, 
status,
to_char(action_time,'DD/MM/RR HH24:MI:SS') action_date 
from dba_registry_sqlpatch r
order by r.action_time;
One thought on “datapatch falha com erro “ORA-22308: operation not allowed on evolved type””

Leave a Reply

Discover more from Blog do Dibiei

Subscribe now to keep reading and get access to the full archive.

Continue reading