Thursday, September 13, 2007

Create or rebuilding an oracle spatial index in another schema

If you ever want to create or rebuild an oracle spatial index in another schema, you need to make sure that the target user has CREATE TABLE and CREATE SEQUENCE granted.

select privilege
from DBA_SYS_PRIVS
where privilege in ('CREATE TABLE', 'CREATE SEQUENCE' )
and grantee = 'TARGET_SCHEMA'


and if they don't have it

grant CREATE TABLE to target_schema;
grant CREATE SEQUENCE to target_schema;


otherwise you will get these errors, hope this helps someone :)

ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-13249: internal error in Spatial index: [mdidxrbd]
ORA-13249: Error in Spatial index: index build failed
ORA-13249: Error in R-tree: [mdrcrtscrt]
ORA-13231: failed to create index table [MDRT_11CBE$] during R-tree creation
ORA-13249: Stmt-Execute Failure: CREATE TABLE -----snip-----
ORA-29400: data cartridge error
ORA-01031: insufficient privileges ORA-06512: at ""MDSYS.SDO_INDEX_METHOD_10I"", line 10 "

10 comments:

rojacques said...

Excellent comment, very helpful. That's exactly the problem I faced today and I found the answer right away in your blog. Thanks and keep on the good job.

rojacques said...

Excellent comment, very helpful. That's exactly the problem I faced today and I found the answer right away in your blog. Thanks and keep on the good job.

UroŇ° said...

Thank you, i just need that.

Anonymous said...

Thanks a lot, that was the solution for me!!!

Anonymous said...

Yep, you've helped me too. Exactly what I needed.

Eric vd Spoel said...

Saved me a lot of trouble. Thanks.

Anonymous said...

Finally; thanks.

Anonymous said...

Excellent you have saved my day

Regards,
Sankar

gidah said...

Your blog helps us to resolved the issue, we thank you and continue with good work!!

venki said...

Aweseome, thanks for help