"BEFORE YOU DO THIS, BACKUP YOUR DATABASE, DO AN ORACLE DUMP OR A SQL SERVER BACKUP. ALTHOUGH THIS THING WORKED FOR ME THREE TIMES I CAN'T GUARANTEE"
Buckle up, we are about to open the hood of the SDE Technology and loose few bolts in the SDE engine, change a fuse or two, start the engine manually and put the hood back.
1- Fireup your DBMS, connect as SDE user.
2- Open the SDE.VERSIONS
3- Now you might have different values, but look at the whole structure it should be the same
4- The geodatabase is not compressing because there are two states pointing to zero which makes the compress command thinks everything is rosy. So take your screwdriver lets screw this DB.
5- We will do a manual reconcile to those two hidden versions to point to the same state id as the default (that is reconciling basically) Change the state 0 in those two version to the state_id of the default as follows
6- Save and close
7- Go run the compress command
sdeversion -o compress [-N] -u sde -p sde_password -i arcsde_service -s server_name -D database |
You should now see your state tree set to zero.
Or
Follow the steps below.
- Reconcile and post all versions which are ready to be applied to the DEFAULT version. Alternatively, delete the versions.
- Delete all versions, excluding the sde.DEFAULT version.
- Verify no users are connected. A connection acquires a state lock and a locked state cannot be compressed.
- Compress the database.
-show me- - Verify the DEFAULT version references state_id 0 by describing the version with the ArcSDE utility sdeversion –o describe once the compress command completes. The output should show the value for the DEFAULT version’s state_id to be 0. The delta tables of the versioned class should be empty.
- Analyze the database to update database statistics for best performance.