This content has been marked as final. Show 2 replies
user13369336,1 person found this helpful
That table probably doesn't have a spatial index.
These instructions will get you going, but you'll want to know your data and read the documentation to guide your decisions.
Login to the appropriate schema using Sql-Plus and try:
If there are no results, commit a row in user_sdo_geom_metadata table.
-- "check if metadata present" SELECT * FROM user_sdo_geom_metadata WHERE UPPER(table_name) = UPPER('&table_name') -- "check if spatial_index present" SELECT index_name, status, ityp_name FROM user_indexes WHERE index_type = 'DOMAIN' AND table_name = UPPER('&table_name') -- "post all results on the forum" SELECT * FROM v$version;
-- "determine minimumally bounding extents: low_x, high_x, low_y, high_y" SELECT SDO_AGGR_MBR(geom) FROM &table_name
Commit then create a spatial index:
INSERT INTO user_sdo_geom_metadata VALUES ( UPPER('&table_name'), 'GEOM', SDO_DIM_ARRAY(SDO_DIM_ELEMENT('X', &low_x, &high_x, &&tol), SDO_DIM_ELEMENT('Y', &low_y, &high_y, &tol)), NULL)
Then try your query again.
COMMIT; CREATE INDEX &index_name ON &table_name (geom) INDEXTYPE IS MDSYS.SPATIAL_INDEX
Finally I found that after creating the spatial index and updating metadata, I renamed the table wo updating the metadata!!
Also srid needed to be defined in my query...
Your select queries from db saved me..