Skip to content
Home » Oracle » How to Resolve ORA-65118: operation affecting a pluggable database cannot be performed from another pluggable database

How to Resolve ORA-65118: operation affecting a pluggable database cannot be performed from another pluggable database

ORA-65118

When we tried to close a pluggable database (PDB), we got ORA-65118.

SQL> alter pluggable database FINPDB close;
alter pluggable database FINPDB close
*
ERROR at line 1:
ORA-65118: operation affecting a pluggable database cannot be performed from another pluggable database

ORA-65118 means that you was in the wrong pluggable database (PDB) or in the wrong container database (CDB), so there's no such PDB name. You should go to check what current container is.

SQL> show con_name

CON_NAME
------------------------------
CRMPDB

As we can see, the current container is not the one we want to close.

Solution

The best solution is to go back to the root container to operate with the PDB.

SQL> alter session set container=CDB$ROOT;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

Then we make sure the target PDB is actually in PDB list.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 FINPDB                         READ WRITE NO
         4 CRMPDB                         READ WRITE NO

Now we can do it again.

SQL> alter pluggable database FINPDB close;

Pluggable database altered.

Another possible case is that you went for the wrong CDB.

Leave a Reply

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