Skip to content
Home » Oracle Database » How to Resolve ORA-65040: operation not allowed from within a pluggable database

How to Resolve ORA-65040: operation not allowed from within a pluggable database

ORA-65040

Tried to do something on all PDB, but it failed with ORA-65040.

Alter Pluggable Database All

SQL> alter pluggable database all open instances=all;
alter pluggable database all open instances=all
*
ERROR at line 1:
ORA-65040: operation not allowed from within a pluggable database
SQL> alter pluggable database all save state instances=all;
alter pluggable database all save state instances=all
*
ERROR at line 1:
ORA-65040: operation not allowed from within a pluggable database

Alter System Set Parameter

Some parameters cannot be altered in the pluggable database.

SQL> alter system set service_names='ERP' container=current;
alter system set service_names='ERP' container=current
*
ERROR at line 1:
ORA-65040: operation not allowed from within a pluggable database

ORA-65040 means that you can do such operation in a pluggable container, it should be done in the root container.

Solution

To be able to perform such operations, we should switch to the root container.

SQL> show con_name

CON_NAME
------------------------------
ORCLPDB

SQL> alter session set container=CDB$ROOT;

Session altered.

SQL> show con_name

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

Then we do it again.

SQL> alter pluggable database all open instances=all;

Pluggable database altered.

We solve it.

Leave a Reply

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