This discussion is archived
3 Replies Latest reply: Jan 9, 2013 5:02 AM by Jeff Smith SQLDev PM RSS

how to unlock hr schema with sql developer

Ambrosiano Newbie
Currently Being Moderated
Hi all,

Am trying to unlock hr schema so I can practise the Oracle tutorials.
I did manage to unlock it using the sql*plus with the following command

Alter user hr identified by hr account unlock;

And

Grant create session to hr;

But when I try it on SQL developer, it doesn't work.

The " grant statement" worked but when I try to select * from employees it says " the table or view does not exist"
Pls advice
  • 1. Re: how to unlock hr schema with sql developer
    EdStevens Guru
    Currently Being Moderated
    976446 wrote:
    Hi all,

    Am trying to unlock hr schema so I can practise the Oracle tutorials.
    I did manage to unlock it using the sql*plus with the following command

    Alter user hr identified by hr account unlock;

    And

    Grant create session to hr;

    But when I try it on SQL developer, it doesn't work.

    The " grant statement" worked but when I try to select * from employees it says " the table or view does not exist"
    Pls advice
    Who (what account) are you connected as when you issue the SELECT statement? If you are not the owner of the table, you'll have to (1) be granted the privilege to SELECT it, and (2) qualify the the table name with the owner:
    select * from hr.employees;
    That example, of course, assumes there is an EMPLOYEES table in the HR schema ... If you are working with the standard HR test schema, it would be EMP, not EMPLOYEES .....
  • 2. Re: how to unlock hr schema with sql developer
    Askdineshsingh Explorer
    Currently Being Moderated
    WHEN YOU CONNECT TO DATABASE WITH SYSTEM /SYS USER OR OTHER THAN HR then
    you have to define the schema name before writing the table names eg
    SELECT * FROM EMPLOYEES --- THIS WRONG
    --TRY LIKE
    SELECT * FROM HR.EMPLOYEES ;
    SELECT OWNER,TABLE_NAME FROM ALL_TABS WHERE TABLE_NAME LIKE '%EMP%';
  • 3. Re: how to unlock hr schema with sql developer
    Jeff Smith SQLDev PM ACE Moderator
    Currently Being Moderated
    You can also use the DBA interface in SQL Developer to access the Security Node, then Users. Select your user, right-click -> unlock.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points