3 Replies Latest reply: Jan 9, 2013 7:02 AM by Jeff Smith Sqldev Pm-Oracle RSS

    how to unlock hr schema with sql developer

    Ambrosiano
      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
          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
            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-Oracle
              You can also use the DBA interface in SQL Developer to access the Security Node, then Users. Select your user, right-click -> unlock.