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
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