// // DB Opened In Restricted Mode Due To PDB Plug-in Violations Related To Datapatch

A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

DB Opened In Restricted Mode Due To PDB Plug-in Violations Related To Datapatch

2 min read
After performing database upgrade from 12.1.0.2.171017 to 12.2.0.1.171017, PDB is shown in RESTRICTED mode.
SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  YES
         4 PDB                            READ WRITE YES
PDB_PLUG_IN_VIOLATIONS returns the following error:
SQL> select name,cause,message,status from PDB_PLUG_IN_VIOLATIONs order by name;

NAME       CAUSE      MESSAGE                                                                           STATUS
---------- ---------- --------------------------------------------------------------------------------- ----------
PDB$SEED   SQL Patch  DBRU bundle patch 171017 (DATABASE RELEASE UPDATE 12.2.0.1.171017): Installed in   PENDING
                      the CDB but not in the PDB.

PDB$SEED   SQL Patch  SQL patch ID/UID 24923080/21732324 (): Installed in the CDB but not in the PDB.    PENDING

PDB$SEED   SQL Patch  SQL patch ID/UID 26635944/21607957 (OJVM RELEASE UPDATE: 12.2.0.1.171017 (266359   PENDING
                      44)): Installed in the CDB but not in the PDB.

PDB        SQL Patch  DBRU bundle patch 171017 (DATABASE RELEASE UPDATE 12.2.0.1.171017): Installed in   PENDING
                      the CDB but not in the PDB.

PDB        SQL Patch  SQL patch ID/UID 24923080/21732324 (): Installed in the CDB but not in the PDB.    PENDING

PDB        SQL Patch  SQL patch ID/UID 26635944/21607957 (OJVM RELEASE UPDATE: 12.2.0.1.171017 (266359   PENDING
                      44)): Installed in the CDB but not in the PDB.
However, there was no datapatch related error shown in DBUA trace.log.
Upgrading PDB seems successfully completed.
Run datapatch by the following steps will resolve the issue:

1. $ sqlplus / as sysdba
2. SQL> alter pluggable database PDB close immediate instances=all;
3. SQL> alter system set cluster_database=false scope=spfile;
4. SQL> quit
5. $ srvctl stop database -d CDB
6. $ sqlplus / as sysdba
7. SQL> startup upgrade
8. SQL> alter pluggable database all open upgrade;
9. SQL> quit
10 cd $ORACLE_HOME/OPatch
11. $ ./datapatch -verbose
12. $ sqlplus / as sysdba
13. SQL> alter system set cluster_database=true scope=spfile;
14. SQL> shutdown immediate;
15. SQL> quit
16. $ srvctl start database -d CDB