DROP INDEX SPX_BOUNDINGPOLYGON;
delete from USER_SDO_GEOM_METADATA where TABLE_NAME = 'EX_BOUNDINGPOLYGON' AND COLUMN_NAME = 'GEOM';
INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID) 
  VALUES ('EX_BOUNDINGPOLYGON', 'GEOM', 
    MDSYS.SDO_DIM_ARRAY 
    (
       MDSYS.SDO_DIM_ELEMENT('X', -180, 180, 0.0005), 
       MDSYS.SDO_DIM_ELEMENT('Y', -90, 90, 0.0005)
    ), 4978
  );

CREATE INDEX SPX_BOUNDINGPOLYGON on EX_BOUNDINGPOLYGON(GEOM) INDEXTYPE is MDSYS.SPATIAL_INDEX;


DROP INDEX SPX_GEOGRBBOX;
delete from USER_SDO_GEOM_METADATA where TABLE_NAME = 'EX_GEOGRBBOX' AND COLUMN_NAME = 'GEOM';
INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID) 
  VALUES ('EX_GEOGRBBOX', 'GEOM', 
    MDSYS.SDO_DIM_ARRAY 
    (
       MDSYS.SDO_DIM_ELEMENT('X', -180, 180, 0.0005), 
       MDSYS.SDO_DIM_ELEMENT('Y', -90, 90, 0.0005)
    ), 4978
  );

CREATE INDEX SPX_GEOGRBBOX on EX_GEOGRBBOX(GEOM) INDEXTYPE is MDSYS.SPATIAL_INDEX;

DROP INDEX SPX_CQP_BBOX;
delete from USER_SDO_GEOM_METADATA where TABLE_NAME = 'CQP_BBOX' AND COLUMN_NAME = 'GEOM';
INSERT INTO USER_SDO_GEOM_METADATA (TABLE_NAME, COLUMN_NAME, DIMINFO, SRID) 
  VALUES ('CQP_BBOX', 'GEOM', 
    MDSYS.SDO_DIM_ARRAY 
    (
       MDSYS.SDO_DIM_ELEMENT('X', -180, 180, 0.0005), 
       MDSYS.SDO_DIM_ELEMENT('Y', -90, 90, 0.0005)
    ), 4978
  );

CREATE INDEX SPX_CQP_BBOX on CQP_BBOX(GEOM) INDEXTYPE is MDSYS.SPATIAL_INDEX;
commit;