ORA-65054: Cannot open a pluggable database in the desired mode.

ORA-65054: Cannot open a pluggable database in the desired mode.

Can we open a PDB in read write mode when CDB is in read only mode?

Since the CDB is in open read only mode, the underlying PDB cannot be opened because of the metadata synchronization between CDB and PDB

SQL> sho pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBHY1                         READ ONLY
         4 PROX1                          MOUNTED
SQL> SELECT name,open_mode from v$database;

NAME      OPEN_MODE
--------- --------------------
HYDRA1    READ ONLY

Close the PDB

SQL> alter session set container=PDBHY1;

Session altered.
SQL> shu immediate;
Pluggable Database closed.

Open the PDB throws ORA-65054

SQL> alter pluggable database PDBHY1 open;
alter pluggable database PDBHY1 open
                         *
ERROR at line 1:
ORA-65054: Cannot open a pluggable database in the desired mode.

This means that, if CDB is in open read only and other PDB need to be opened in read write mode, then the above error is observed.

SQL> !oerr ora 65054
65054, 00000, "Cannot open a pluggable database in the desired mode."
// *Cause:  An attempt was made to open a pluggable database (PDB) in a mode
//          incompatible with the multitenant container database (CDB) or,
//          if the PDB belonged to an application container, in a mode
//          incompatible with the application root.
// *Action: Open the CDB or the application root in a compatible mode
//          first and retry the operation.
//

Make the CDB in read write mode to open the underlying PDB.

SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 1778382528 bytes
Fixed Size                  9135808 bytes
Variable Size             419430400 bytes
Database Buffers         1342177280 bytes
Redo Buffers                7639040 bytes
Database mounted.
Database opened.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDBHY1                         READ WRITE NO

This error occur to prevent inconsistency or corruption of the metadata for internal objects.

Leave a Reply

%d bloggers like this: