Error: Unique constraint violated
Building a pyramid with the 'sderaster' command yields a unique constraint violation error. For example:
Error: SE_stream_execute (-51)
Error: Underlying DBMS error
Error: DBMS error code (1)
Error: ORA-00001: unique constraint (VEGDIR.SDE_BLK_3_UK) violated".
This error is caused by pyramid blocks left behind by a mosaic or a previously failed attempt to build the pyramid.
Solution or Workaround
• Option 1: Remove the pyramid blocks left behind by a failed pyramid build. Use the pyramid operation of the 'sderaster' command set to level zero.
• Option 2: Use the raster column identifier to determine the number of pyramid blocks that may have been left behind by a mosaic.
- Use a SQL utility specific to the relational database management system to query the sde.raster_column table to obtain a raster column identifier.
where table_name =
'<business table name>';
- Replace the <N> in the sde_blk_<N> with the raster column id of your raster.
select count(*) from sde_blk_<N>
where rasterband_id < 0;
- Delete the pyramid blocks through SQL, if they exist.
delete from sde_blk_<N>
where rasterband_id < 0