Sunil
Sunil

Reputation: 1248

Create Schema in Oracle 11g

I am trying to create a new Schema in Oracle 11g.

I have referred to the Oracle documentation

I have tried to execute the commands mentioned there.

CREATE SCHEMA AUTHORIZATION oe

   CREATE TABLE new_product 

      (color VARCHAR2(10)  PRIMARY KEY, quantity NUMBER) 

   CREATE VIEW new_product_view 

      AS SELECT color, quantity FROM new_product WHERE color = 'RED' 

   GRANT select ON new_product_view TO hr; 

I am getting the following error when I run this commands in Eclipse.

ORA-02421: missing or invalid schema authorization identifier (0 rows affected)

Elapsed Time: 0 hr, 0 min, 0 sec, 0 ms.

Anybody has an idea why this is happening ?

Thank you.

Upvotes: 0

Views: 12182

Answers (2)

user1256936
user1256936

Reputation: 141

Go to Command Prompt. Login as System and Password as orcl

SQL> create user [username] identified by [password];

User created.

SQL> grant create session to [username];

Grant succeeded.

SQL> grant create table to [username];

Grant succeeded.

SQL> create role developer;

Role created.

SQL> grant developer to [username];

Grant succeeded.

SQL> grant resource to [username];

Upvotes: 4

Gerrat
Gerrat

Reputation: 29680

At at a guess, I'd say you're not logged in as user oe (which the docs you reference say you must be).

Also see the description of the error you're getting.

Upvotes: 4

Related Questions