Blog

Fix: ORA-65086: cannot open/close the pluggable database

During cloning activity I unplugged a pdb and then try to open it but I faced "ORA-65086: cannot open/close the pluggable database " error. I view Oracle document and found below concept to do the following steps:

-- Unplug a pluggable database


SQL> ALTER PLUGGABLE DATABASE hrpdb close immediate;

Pluggable database altered.

SQL> ALTER PLUGGABLE DATABASE hrpdb UNPLUG INTO '/u10/EXAM/bkp_pdb/hrpdb.xml';

Pluggable database altered.


Now you can see the status of pdbs.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO
         4 SALESPDB                       READ WRITE NO
         5 PDB2                           READ WRITE NO
         6 HRPDB                          MOUNTED
SQL>

Here, I am trying to open the same database. But it is not opening due to unplugged.

SQL> alter pluggable database hrpdb open;
alter pluggable database hrpdb open
*
ERROR at line 1:
ORA-65086: cannot open/close the pluggable database

SQL>

It is not possible to open again the pluggable database… The official documentation claims

After a PDB is unplugged, it remains in the CDB with an open mode of MOUNTED and a status of UNPLUGGED. The only operation you can perform on an unplugged PDB is DROP PLUGGABLE DATABASE, which will remove it from the CDB. You must drop the PDB before you can plug it into the same CDB or another CDB.

So, following official documentation recommendations:

SQL> drop pluggable database hrpdb;

Pluggable database dropped.
SQL> CREATE pluggable DATABASE hrpdb USING '/u10/EXAM/bkp_pdb/hrpdb.xml' NOCOPY;

Pluggable database created.

SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO
         4 SALESPDB                       READ WRITE NO
         5 PDB2                           READ WRITE NO
         6 HRPDB                          MOUNTED
SQL> alter pluggable database hrpdb open;

Pluggable database altered.


SQL> show pdbs;

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1                           READ WRITE NO
         4 SALESPDB                       READ WRITE NO
         5 PDB2                           READ WRITE NO
         6 HRPDB                          READ WRITE NO
SQL> 

Hope, It may helped you.

Follow me

Contact us for Training/ Job Support

Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided for educational purposes only. It has been tested internally, however, we do not guarantee that it will work for you. Ensure that you run it in your test environment before using.