Skip to content

How to Resolve ORA-65025: Pluggable database is not closed on all instances.

ORA-65025

ORA-65025 means that the pluggable database should be closed completely for further operations like dropping. Let's see some cases about this error.

  1. Drop PDB
  2. Rename PDB

A. Drop PDB

SQL> drop pluggable database orclpdb2 including datafiles;
drop pluggable database orclpdb2
*
ERROR at line 1:
ORA-65025: Pluggable database ORCLPDB2 is not closed on all instances.

As error message of ORA-65025 revealed that we should close the PDB before dropping it.

SQL> alter pluggable database orclpdb2 close;

Pluggable database altered.

As you can see, we use ALTER PLUGGABLE DATABASE to close the PDB. For single-instance, you can safely drop the PDB now.

RAC System Problem

But for a RAC database like this case, it's not enough.

SQL> drop pluggable database orclpdb2 including datafiles;
drop pluggable database orclpdb2
*
ERROR at line 1:
ORA-65025: Pluggable database ORCLPDB2 is not closed on all instances.

We still got ORA-65025.

Solution

This is because the PDB is not closed completely in other instances within the RAC system. So the solution is obvious. To close the PDB on all nodes.

SQL> alter pluggable database orclpdb2 close instances=all;

Pluggable database altered.

Now we can drop the PDB.

SQL> drop pluggable database orclpdb2 including datafiles;

Pluggable database dropped.

B. Rename PDB

Before entering the procedure of renaming a PDB, we should put the PDB in restricted mode.

SQL> show pdbs

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

When we tried to rename the PDB, it failed with ORA-65025.

SQL> alter pluggable database ORCLPDB1 rename global_name to ORCLPDBX;
alter pluggable database ORCLPDB1 rename global_name to ORCLPDBX
*
ERROR at line 1:
ORA-65025: Pluggable database ORCLPDB1 is not closed on all instances.

Solution

Once again, this is because we didn't close the PDB in another instance for a RAC database. So the solution is to close the PDB on all nodes, then open it in restricted mode in this operation node.

SQL> alter pluggable database ORCLPDB1 close immediate instances=all;

Pluggable database altered.

SQL> alter pluggable database ORCLPDB1 open restricted;

Pluggable database altered.

We check the status again.

SQL> show pdbs

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

We can rename the PDB now.

SQL> alter pluggable database ORCLPDB1 rename global_name to ORCLPDBX;

Pluggable database altered.

After that, you should close PDB and open it on all nodes.

SQL> alter pluggable database ORCLPDB1 close immediate;

Pluggable database altered.

SQL> alter pluggable database ORCLPDB1 open instances=all;

Pluggable database altered.

Leave a Reply

Your email address will not be published.