Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - SQL Usage » Data import and export


Database rebuilds

Rebuilding a database is a specific type of import and export involving unloading and reloading your entire database. The rebuild (unload/load) and extract tools are used to rebuild databases, to create new databases from part of an existing one, and to eliminate unused free pages.

You can rebuild your database from Sybase Central or by using dbunload.


It is good practice to make backups of your database before rebuilding, especially if you choose to replace the original database with the rebuilt database.

With importing and exporting, the destination of the data is either into your database or out of your database. Importing reads data into your database. Exporting writes data out of your database. Often the information is either coming from or going to another non-SQL Anywhere database.

If you specify the encryption options -ek, -ep, or -et, the LOAD TABLE statements in the reload.sql file must include the encryption key. Hard-coding the key compromises security, so a parameter in the reload.sql file specifies the encryption key. When you execute the reload.sql file with Interactive SQL, you must specify the encryption key as a parameter. If you do not specify the key in the READ statement, Interactive SQL prompts for the key.

Loading and unloading takes data and schema out of a SQL Anywhere database and then places the data and schema back into a SQL Anywhere database. The unloading procedure produces data files and a reload.sql file which contains table definitions required to recreate the tables exactly. Running the reload.sql script recreates the tables and loads the data back into them.

Rebuilding a database can be a time-consuming operation, and can require a large amount of disk space. As well, the database is unavailable for use while being unloaded and reloaded. For these reasons, rebuilding a database is not advised in a production environment unless you have a definite goal in mind.

 From one SQL Anywhere database to another
 Rebuilding versus exporting
 Rebuilding replicating databases
 See also

Reasons to rebuild databases
Tips on rebuilding databases using the Unload utility
Rebuilding databases involved in synchronization or replication (command line)
Rebuilding databases involved in synchronization or replication (manual)
Tips on rebuilding databases using the UNLOAD TABLE statement
Exporting table data
Exporting a table schema
Reloading a database
Minimizing downtime when rebuilding a database