What’s the most efficient way to reclaim disk space after deleting lots of data from a database on Sybase ASE 15

bcpdatabase-backupdatabase-restoresybase

As I understand it, based on some research but zero real-world experience with Sybase ASE, the only way to reclaim disk space once it's been allocated to a database is to export that database, create a new DB with the same schema, and reload all the exported data to the new database. Is this correct, or is there some other method?

Then: assuming the above is correct and a full export-recreate-reload is required, what's the most efficient way to do that? Are there tools that will automate all or part of that process? I'm being told we would have to write separate bcp export and import commands for each and every object in the database, which if true sounds easily scriptable by someone who knows Sybase ASE well enough. (I don't.)

This seems to me like a really basic housekeeping task, and it feels like I'm missing something obvious.

Best Answer

reorg rebuild

Tweak space management settings before the rebuild if needed. When reorg rebuild rebuilds a table, it rewrites all table and index rows according to the table’s current settings for reservepagegap, fillfactor, and exp_row_size. These properties all affect how quickly inserts cause a table to become fragmented, as measured by a low cluster ratio.

Related Topic