Unlocking account in Oracle 11g R2

database, oracle, oracle11g

Solution

During the installation process, one of the questions that is asked is whether you want to install the sample schemas (`SCOTT`, `HR`, etc.). If the `SCOTT` user doesn't exist, it would appear that you chose not to install the sample schemas.

You can create a new user, grant appropriate privileges to that user, and then build tables to work with. For example

CREATE USER rjchar 
  IDENTIFIED BY rjchar
  DEFAULT TABLESPACE users
  TEMPORARY TABLESPACE temp;

GRANT create session,
      create table,
      create view,
      create procedure,
      create trigger
   TO rjchar;

You can then log in as the user `rjchar` from SQL Developer and can start building your schema. Alternately, you can manually install the sample schemas using the scripts that were installed on your server.

Problem

I know this question has been asked many times, but this problem is confusing me a lot. I just installed `Oracle 11g R2`. And I was trying to unlock `Scott/Tiger account` so that I can use them to make a `SQL Developer connection`. I was trying to do something like below- And I always get user `SCOTT` does not exist? Why is it so? Is there anything wrong I am doing? ``` SQL> conn system/abcdef1234 Connected. SQL> alter user scott account unlock; alter user scott account unlock * ERROR at line 1: ORA-01918: user 'SCOTT' does not exist ``` Any thoughts will be appreciated. Updates:- ``` SQL> select username,account_status from dba_users where username='SCOTT'; no rows selected ```

Original source