Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Create schema command error

500237Dec 5 2007 — edited Dec 5 2007
Hi,
I tried to execute the following statement but was given the error.

1 CREATE SCHEMA AUTHORIZATION ashish
2 CREATE TABLE paint
3 (paint_id NUMBER PRIMARY KEY,
4 paint_size NUMBER,
5 colour VARCHAR2(10) )
6* GRANT select ON paint TO ashish
SQL> /
CREATE SCHEMA AUTHORIZATION painter
*
ERROR at line 1:
ORA-02421: missing or invalid schema authorization identifier

What is the error in this statement for not alllowing me to crate the schema?
This is 11g database.

Thanks,
Aashish

Comments

588568
The schema name must be an existing Oracle username.
500237
yes...I have created the user ashish first,granted all the necessary priviledges to it and then executed this statement.
611837
This is the error info from the documentation:

ORA-02421: missing or invalid schema authorization identifier
Cause: the schema name is missing or is incorrect in an authorization clause of a create schema statement.
Action: If the name is present, it must be the same as the current schema.

looks like you need to be connected as the user ashish.....
588568
I could have sworn that your SQL used "painter", not "ashish"! Have you edited it?
500237
yes...I have connected as user ashish only...
Actually I just picked up this example from oracle documentation and tried to execute it in the same way as guided...
Dont have any ckue about correctness..

This was trial only and have picked an example from one I found out on net only.
427492
It's:

create 'user', not 'schema'
Eduardo Legatti

Hi,

It must be the same as the current schema.

LEGATTI@ORACLE10> show user
USER is "LEGATTI"

LEGATTI@ORACLE10> create schema authorization legatti
  2  create table t1 (id number)
  3  create table t2 (id number)
  4  create table t3 (id number)
  5  ;

Schema created.

Cheers

Legatti

611837
check out the example on this page:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28310/general001.htm#ADMIN11523

does this work?

I wonder whether you have to define the NUMBER field length as the page says: The CREATE SCHEMA statement does not support Oracle Database extensions to the ANSI CREATE TABLE and CREATE VIEW statements, including the STORAGE clause.
588568
You need to:
create a user called ashish
login to SQL*Plus as ashish
Run the CREATE SCHEMA thing with ashish after "CREATE SCHEMA AUTHORIZATION"
500237
Thanks Rattus,neil,Harry and Eduardo...
It worked fine with your help...

Rgds,
Aashish S.
1 - 10
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jan 2 2008
Added on Dec 5 2007
10 comments
1,782 views