Datapatch Failing on ORA-65108 (PDB$SEED): Applying Datapatch Manually

In a new 12c environment (which actually includes 18c and 19c, as per the 12c family), the datapatch failed on the following:
ORA-00704: bootstrap process failure ORA-00604: error occurred at recursive SQL level 1 ORA-65108: invalid use of a cursor belonging to another container kpdbaKillPdbSessions: Starting kill. 2019-01-29 07:09:21.486584 :kjcipctxinit(): (pid|psn)=(25|2): initialised and linked pctx 0x00007FFB1A7B49C8 into process list ORA-00704: bootstrap process failure ORA-00604: error occurred at recursive SQL level 1 ORA-65108: invalid use of a cursor belonging to another containerHere, it's failing for the PDB$SEED. When upgrading, there are phases where you need the seed opened read-write. However, in general, you don’t do that yourself. The scripts to run in each container are called through catcon.pl which, by default, opens the seed read-write and ensures that the initial open mode is restored at the end (even in the event of an error). So, how do you manually proceed?
- First, apply the datapatch to other PDBs using the -pdbs clause:
./datapatch -verbose -pdbs PDB1,PDB2
- Open PDB$SEED for Oracle scripts:
SYS@CDB$ROOT SQL> alter session set "_oracle_script"=true; Session altered. SYS@CDB$ROOT SQL> alter pluggable database pdb$seed open read write force; Pluggable database PDB$SEED altered.
- Apply the datapatch to the PDB$SEED:
$ORACLE_HOME/OPatch/datapatch -verbose -pdbs ‘PDB$SEED’
- Close PDB$SEED and mount it:
SYS@CDB$ROOT SQL> alter session set container=PDB$SEED Session altered. SYS@CDB$ROOT SQL> shutdown immediate Pluggable Database closed ++ From Root SYS@CDB$ROOT SQL> alter pluggable database PDB$SEED open read only;