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!

Create SDO_GEOMETRY spatial index in Oracle Live SQL

User_1871Mar 29 2023 — edited Mar 29 2023

I'm trying to create an SDO_GEOMETRY spatial index in Oracle Live SQL (https://livesql.oracle.com/):

CREATE TABLE ply (objectid     NUMBER(*,0), 
                  query_source NVARCHAR2(255),
                  shape        SDO_GEOMETRY);
INSERT INTO user_sdo_geom_metadata (table_name,column_name,diminfo,srid) 
VALUES (
   'ply',
   'SHAPE',
   sdo_dim_array(
       sdo_dim_element(NULL, 1, 100, 0.001), 
       sdo_dim_element(NULL, 1, 100, 0.001)
   ),
   26917
   );
CREATE INDEX ply_shape ON ply (shape) INDEXTYPE IS mdsys.spatial_index;

But I'm getting an error:

ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 10

Why am I getting that error?


Unfortunately, I can't seem to save/share my Live SQL session due to an error:

But the SQL does work in db<>fiddle: https://dbfiddle.uk/KqGs8_uZ. And it works in my on-prem Oracle 18c database too.

Any ideas? Thanks.


Edit:

I was able to eventually save the Live SQL script:
https://livesql.oracle.com/apex/livesql/s/oyvnm2jx4akuczwt1durh8124

This post has been answered by kpatenge-Oracle on Apr 11 2023
Jump to Answer
Comments
Post Details
Added on Mar 29 2023
4 comments
573 views