Update the SQL layer with datapatch -verbose after a binary patch
OraclePatching & LifecycleCommand
# 1) After the binary patch (opatch apply), start the DB; all PDBs must be open:
sqlplus / as sysdba <<EOF
STARTUP;
ALTER PLUGGABLE DATABASE ALL OPEN;
EXIT;
EOF
# 2) Check only first, then apply:
cd $ORACLE_HOME/OPatch
./datapatch -prereq
./datapatch -verbose
# For specific PDBs: ./datapatch -verbose -pdbs PDB1,PDB2
# 3) Recompile invalid objects:
sqlplus / as sysdba @?/rdbms/admin/utlrp.sql
# Logs: $ORACLE_BASE/cfgtoollogs/sqlpatch/What it does
datapatch applies the SQL/PL-SQL components (dictionary, packages) of the binary patches in the Oracle Home to CDB root, PDB$SEED and all open PDBs, and records the result in DBA_REGISTRY_SQLPATCH. It also reverts the SQL part of rolled-back patches.
When to use it
After every RU/RUR/one-off binary patch or rollback; for PDBs moved or unplugged/plugged into a newly patched home; and to rerun it when DBA_REGISTRY_SQLPATCH shows WITH ERRORS.
Caution
Closed or MOUNTED PDBs are not patched and may open in RESTRICTED mode; open all of them first. Do not run under heavy load (dictionary locks, package invalidation). On RAC run it once from one node only. With Data Guard run datapatch only on the primary; the changes reach the standby through redo (patch the standby binaries first).