Search code examples
oracle-databaseoracle11g

oracle unlock HR account


hello i'm learning oracle and trying to unlock HR account here's what happend to me No rows Selected why ? enter image description here


Solution

  • In your picture you show you are connected with SYS. To unlock the HR account you have to use the ALTER USER ACCOUNT UNLOCK statement.

    SQL> ALTER USER HR ACCOUNT UNLOCK ;
    

    Then you'll be able to connect with HR to the database, if that is what you want. However, having the account locked does not mean you cannot access the objects owned by that account. I mean, HR is an example schema, but you can see any table owned by HR as long as you have privileges over it.

    In your case, you are connecting with SYS, who is the superuser, so you can see literally everything with that user:

    Regards.