Unlocking sample user accounts
Oracle Database 11g XE comes with sample database users such as HR, MDSYS, and others. Some of the user accounts are by default locked. In the rest of the chapters, we will use HR schema objects for our testing and building applications.
Log on to SQL*Plus as SYSDBA, query account status for all users, and unlock the HR account as shown below:
SQL> connect /as sysdba SQL> select username, account_status from dba_users; SQL> alter user hr account unlock; # Unlock the locked account SQL> alter user hr identified by hr; # Open the expired account
Or:
SQL> alter user hr identified by hr account unlock; #Unlock and open in a single statement SQL> connect hr/hr