ORA-16000: database or pluggable database open for read-only access
Error
ORA-16000: database or pluggable database open for read-only access
Tried to create the pluggable database then i am getting the following the error:
CREATE PLUGGABLE DATABASE pdb2 ADMIN USER pdb_adm IDENTIFIED BY Password1
FILE_NAME_CONVERT=('D:\ORACLE\18.0.0\ORADATA\XE\PDBSEED\','D:\ORACLE\18.0.0\ORADATA\XE\PDB2\');
CREATE PLUGGABLE DATABASE pdb2 ADMIN USER pdb_adm IDENTIFIED BY Password1
*
ERROR at line 1:
ORA-16000: database or pluggable database open for read-only access
Solution
1. Check the con_id of the session where you tried to execute the following create PDB command.
SQL> show con_id
CON_ID
--------------------
2
2. If its CDB$ROOT container then it must be value 1. If it is in another container you have to switch the container.
SQL> alter session set container=CDB$ROOT;
Session altered.
SQL> show con_id
CON_ID
------------------------------
1