Skip to content

How to Resolve ORA-65054: Cannot open a pluggable database in the desired mode

  • by

ORA-65054

Tried to open a pluggable database (PDB), but it failed with ORA-65054. Let's see how it happened.

SQL> alter session set container=ORCLPDB;

Session altered.

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

Another way to open it in the PDB

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

Let's see what state the database is.

SQL> select status from v$instance;

STATUS
------------
MOUNTED

To know what state of the database currently is, we queried STATUS of V$INSTANCE. As you can see, it's at mounted.

ORA-65054 means that the root container is at MOUNT or READ ONLY state, so you can't open any PDB at this moment. You should open the CDB to solve it.

Solution

To solve ORA-65054, we switch to the root container.

SQL> alter session set container=CDB$ROOT;

Session altered.

Then we open it or restart it depends on what current state is.

Mount State

At mount state, we can directly open it.

SQL> alter database open;

Database altered.

READ ONLY State

If the state of root container is READ ONLY, then you should restart the whole database.

You can open the PDB now.

SQL> alter pluggable database orclpdb open;

Pluggable database altered.

Leave a Reply

Your email address will not be published. Required fields are marked *