SDE Examples for Oracle

Export from database to SDE export file
sdeexport -l [SOURCE_TABLE],[GEOMETRY FIELD] -f .\[OUTPUT FILE NAME].sdx -i sde:oracle11g -u [USERNAME] -p [PASSWORD]@[TNS NAME]

Export from database to shapefile
sde2shp -o init -l [SOURCE_TABLE],[GEOMETRY FIELD] -f [OUTPUT FILE NAME].shp -t polygonZ -a all -i sde:oracle11g –
u [USER] -p [PASSWORD]@[TNS NAME]

Import to database from SDE export file
sdeimport -o CREATE -t [OUTPUT_TABLE_NAME] -f [INPUT_FILE_NAME] -g RTREE -k [DBTUNE KEYWORD] -i sde:oracle11g -u [USER] -p [PASSWORD]@[TNS NAME]

Delete table from database including SDO/SDE metadata.
sdetable -o delete -t [TABLE_NAME] -u [USER] -p [PASSWORD]@[TNS NAME] -i sde:oracle11g

Drop and Create Spatial Index
DROP INDEX “[SCHEMA]”.”[INDEX_NAME]”;

CREATE INDEX “[SCHEMA]”.”SIDX_[TABLE_NAME]” ON “[SDE]”.”[TABLE_NAME]” (“[SHAPE_FIELD]”)
INDEXTYPE IS “MDSYS”.”SPATIAL_INDEX” ;

Leave a Reply

Your email address will not be published.

99 − 92 =