Problem: trying to create a spatial index on a valid point geometry column results in "SQL Error [29855] [99999]: ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine" with no other traceback, while having all the necessary privileges
Context:
Oracle database version 21c.
I am connected as user SYSTEM to an Oracle PDB, with all necessary privileges enabled (CREATE TABLE / SEQUENCE etc.). Below is a sample test code with EPSG:5514 and sample coordinates I used to recreate the error, in order from top to bottom, which I am trying to execute. For bounds I am using the EPSG 5514 bound coordinates themselves.
- All queries up to index creation work just fine
- SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT validates geometry successfully
- All values being inserted into USER_SDO_GEOM_METADATA as well as into TEST_SPATIAL work without issues
- At the point of index creation, it fails with the aforementioned error and no additional feedback
I have checked the bounds inserted into USER_SDO_GEOM_METADATA and the actual coordinate point on a map projected with CRS 5514, to no avail, even though they seem correct. Using different RDBMS didn't help or change anything. Changing JDBC drivers to latest version also did not work.
Similar issues happen with other EPSGs and their sample coordinates.
The only time I managed to successfully create a spatial index on a geometry column was with the base WGS 84 (EPSG 4326) CRS.
What is the issue here? Is the problem administrative, or am I missing something else (like an extra privilege etc.)?
CREATE TABLE TEST_SPATIAL (
id INTEGER,
geom MDSYS.SDO_GEOMETRY,
CONSTRAINT PK PRIMARY KEY (id)
);
INSERT INTO TEST_SPATIAL VALUES (
1,
MDSYS.SDO_GEOMETRY(
2001,
5514,
MDSYS.SDO_POINT_TYPE(-368875, -1230037, NULL),
NULL,
NULL
)
);
INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME,DIMINFO,SRID)
VALUES (
'TEST_SPATIAL','GEOM',
MDSYS.SDO_DIM_ARRAY(
MDSYS.SDO_DIM_ELEMENT('X', -951499.37, -159365.31, 0.5),
MDSYS.SDO_DIM_ELEMENT('Y', -1353292.51, -911053.67 , 0.5)
),
5514
);
-- this returns TRUE
SELECT SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(GEOM,0.005)
FROM TEST_SPATIAL;
COMMIT;
-- fails
CREATE INDEX test_spatial_idx
ON TEST_SPATIAL(geom)
INDEXTYPE IS MDSYS.SPATIAL_INDEX_V2;