Unlock HR user in Oracle 19c/18c/12c?
Unlocking sample accounts like HR in Oracle 19c/18c/12c


Edit tnsnames.ora  file located at %db_home%\network\admin

Add TNS ORCLPDB like below-highlighted block


Open CMD as Administrator and execute below command

C:\&gt;lsnrctl reload


Open CMD and execute SQLPlus with below command to login as SYSDBA

C:\WINDOWS\system32&gt; sqplus / as sysdba


Run below SQL commands to Unlock your Schema

  ALTER SESSION SET container = ORCLPDB;


Check if the pluggable database is opened ?

SELECT name, open_mode FROM v$pdbs;



  To open your pluggable database Skip If Already open


ALTER PLUGGABLE DATABASE open;


Unlock HR user    

ALTER USER hr IDENTIFIED BY &lt;your_password&gt; ACCOUNT UNLOCK;
conn
username hr@orclpdb
password &lt;your_password&gt;
Connected.


Connected means you can access HR schema lets start


  Now you will be able to access HR schema


select * from tab;