Rebuilding a database is a specific type of import and export involving unloading and reloading your entire database. The rebuild (load/unload) and extract procedures are used to rebuild databases and to create new databases from part of an old one. Rebuilding your database takes all the information out of your database and puts it back in, in a uniform fashion, thus filling space and improving performance much like defragmenting your disk drive.
Consider rebuilding your database when you want to improve database performance, reclaim fragmented disk space, or upgrade your database to a newer version of Adaptive Server Anywhere.
You can carry out rebuilding your database from Sybase Central or by using the dbunload command line utility.
NoteIt is good practice to make backups of your database before rebuilding. For information, see Introduction to backup and recovery. |
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.
Rebuilding is different from exporting in that rebuilding exports and imports table definitions and schema in addition to the data. The unload portion of the rebuild process produces ASCII format data files and a reload.sql file which contains table and other definitions. Running the reload.sql script recreates the tables and loads the data into them.
Consider extracting a database (creating a new database from an old database) if you are using SQL Remote or MobiLink. For more information about extracting a database, see Extracting databases.
The procedure for rebuilding a database depends on whether the database is involved in replication or not. If the database is involved in replication, you must preserve the transaction log offsets across the operation, as the Message Agent and Replication Agent require this information. If the database is not involved in replication, the process is simpler.
Reasons to rebuild databases
Rebuild considerations
Rebuild and reload tools
Exporting table data or table schema
Reloading a database
Minimizing downtime during rebuilding
SQL Anywhere Studio 9.0.2
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.