-
Connect to system account with its password (oracle in my case) using sqlplus. Name localhost means Oracle is running on the current system, 1521 is port number and XEPDB1 is database name.
All these are default and should work in your systems unless you configure Oracle differently.
>sqlplus system/oracle@localhost:1521/XEPDB1
SQL*Plus: Release 18.0.0.0.0 - Production on Wed Mar 17 15:16:55 2021
Version 18.4.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Last Successful login time: Wed Mar 17 2021 15:16:05 +05:30
Connected to:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production
Version 18.4.0.0.0
- Once you are connected, unlock HR account and change its password as follows:
SQL> alter user hr account unlock;
User altered.
SQL> alter user hr identified by hr;
User altered.
-
Now you can connect to HR account as follows:
SQL> connect hr/hr@localhost:1521/XEPDB1
Connected.
SQL> select tname from tab;
TNAME
--------------------------------------------------------------------------------
REGIONS
COUNTRIES
LOCATIONS
DEPARTMENTS
JOBS
EMPLOYEES
JOB_HISTORY
EMP_DETAILS_VIEW
8 rows selected.
SQL>