This content has been marked as final. Show 3 replies
976446 wrote: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:
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;
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"
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 .....
select * from hr.employees;
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
SELECT * FROM HR.EMPLOYEES ;
SELECT OWNER,TABLE_NAME FROM ALL_TABS WHERE TABLE_NAME LIKE '%EMP%';
You can also use the DBA interface in SQL Developer to access the Security Node, then Users. Select your user, right-click -> unlock.