1.先创建一张新表
CREATE TABLE HSDGA.T_ORG_SP
(
"SHAPE" MDSYS.SDO_GEOMETRY,
"PK_ID" NUMBER,
"TYPE" CHAR(1),
"NAME" VARCHAR2(300),
"DESC" VARCHAR2(1024),
"LONGITUDE" VARCHAR2(20),
"LATITUDE" VARCHAR2(20),
"ADDRESS" VARCHAR2(256),
"IMG" VARCHAR2(256),
"RESERVE1" VARCHAR2(300),
"RESERVE2" VARCHAR2(300),
"RESERVE3" VARCHAR2(300)
)
2.创建空间索引
(1)第一步执行: INSERT INTO user_sdo_geom_metadata VALUES ('T_ORG_SP','SHAPE',
MDSYS.SDO_DIM_ARRAY(
MDSYS.SDO_DIM_ELEMENT('LONG', -180.0, 180.0, 0.0000005),
MDSYS.SDO_DIM_ELEMENT('LAT', -90.0, 90.0, 0.0000005)
),
4326
);
(2)第二步执行:Create index T_ORG_SP_sidx on HSDGA.T_ORG_SP(SHAPE) Indextype is mdsys.spatial_index;
3.查看索引是否创建成功
SELECT * FROM user_sdo_geom_metadata