ASA SQL User's Guide
Importing and Exporting Data
Rebuilding databases
Rebuilding generally takes data out of an Adaptive Server Anywhere database and then places that data back into an Adaptive Server Anywhere database. The unloading and reloading are closely tied together since you usually perform both tasks, rather than just one or the other.
You might rebuild your database if you wanted to:
Upgrade your database file format Some new features are made available by applying the Upgrade utility, but others require a database file format upgrade, which is carried out by unloading and reloading the database. The New Features documentation will state if an unload and reload is required to obtain a particular feature.
Reclaim disk space Databases do not shrink if you delete data. Instead, any empty pages are simply marked as free so they can be used again. They are not removed from the database unless you rebuild it. Rebuilding a database can reclaim disk space if you have deleted a large amount of data from your database and do not anticipate adding more.
Improve performance Rebuilding databases can improve performance for the following reasons:
If data on pages within the database is fragmented, unloading and reloading can eliminate the fragmentation.
Since the data can be unloaded and reloaded in order by primary keys, access to related information can be faster, as related rows may appear on the same or adjacent pages.
New versions of the Adaptive Server Anywhere database server can be used without upgrading your database. If you want to use features of the new version that require access to new system tables or database options, you must use the upgrade utility to upgrade your database. The upgrade utility does not unload or reload any data.
If you want to use features of the new version that rely on changes in the database file format, you must unload and reload your database. You should back up your database after rebuilding the database.
To upgrade your database file, use the new version of Adaptive Server Anywhere.
For more information about upgrading your database, see Upgrading Adaptive Server Anywhere.