Search notes:

ORA-65146: account cannot be unlocked in a PDB while it is locked in the root

$ sqlplus  sys/elCarosSecret4@pdbtq84 as sysdba
 …
SQL> alter user xdb account unlock;
--
-- ORA-65146: account cannot be unlocked in a PDB while it is locked in the root
Check to which container we're connected:
SQL> select
   ses.con_id,
   case when con.con_id = ses.con_id then 'X' end cur_con, -- current container
   con.name
from
   v$session    ses   cross join
   v$containers con
where
   ses.sid = sys_context('userenv', 'sid') -- Identify own session
; 
-- 
--     CON_ID C NAME
-- ---------- - ------------
--          3 X PDBTQ84
Not connected to the root! Change this:
SQL> connect / as sysdba
Check current container again:
SQL> select
   ses.con_id,
   case when con.con_id = ses.con_id then 'X' end cur_con, -- current container
   con.name
from
   v$session    ses   cross join
   v$containers con
where
   ses.sid = sys_context('userenv', 'sid') -- Identify own session
; 
--     CON_ID C NAME
-- ---------- - -----------------
--          1 X CDB$ROOT
--          1   PDB$SEED
--          1   PDBTQ84
Try again:
SQL> alter user xdb account unlock;
--
-- User altered
Go back to PDB:
SQL> connect sys/elCarosSecret4@PDBTQ84 as sysdba
SQL> select account_status from dba_users where username = 'XDB';
The account status trickled from the root to the PDB.

See also

Other Oracle error messages

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759474050, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-65146_account-cannot-be-unlocked-in-a-PDB-while-it-is-locked-in-the-root(92): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78