DB: patching to 180116

Database Cloud Service patching, from 171×30 to 180116, may fail, resulting into all PDBs to restart in restricted session mode.

Running $ORACLE_HOME/OPatch/datapatch -verbose confirms an issue, while trying to rollback the patch 23026585:

Patch 23026585 rollback (pdb PDB$SEED): WITH ERRORS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/23026585/21186443/23026585_rollback_DB_PDBSEED_2018Mar20_12_02_32.log (errors)
    Error at line 31: Warning: Package Body created with compilation errors.
Patch 23026585 rollback (pdb JCS): WITH ERRORS
  logfile: /u01/app/oracle/cfgtoollogs/sqlpatch/23026585/2118644/. . .
    Error at line 31: Warning: Package Body created with compilation errors.

The workaround is to update the file below to comment or remove the package body definition intended to be replaced:

?/sqlpatch/23026585/21186443/rollback_files/rdbms/admin/prvtrmns.plb

Then to reload the proper package body from the ORACLE_HOME:

sqlplus / as sysdba @?/rdbms/admin/prvtrmns.plb

Then start again the datapatch session:

$ORACLE_HOME/OPatch/datapatch -version