Rebuilding the database (no defragmentation)
You can follow these steps to perform a rebuild task that does not defragment disk fragments.
1. Close SQL Anywhere and adaptive Server Anywhere database servers because version 10 of the Dbunload utility does not work with databases running on earlier versions of the database server. For example:
dbstop -c "DBF=mydb.db;UID=DBA;PWD=sql"
2. Ensure that version 10 utilities take precedence over other tools in the system path.
3. Create a Reload.sql file using the Dbunload utility. For example:
dbunload -c "connection-string" directory-name
4, use the Initialization tool (DBINIT) to create a new database. or create a new database in Sybase Central. For example:
dbinit new.db
5. Connect the new database using interactive sql:
dbisql -c "DBF=new.db;UID=DBA;pwd=sql"
6. Execute the following command to join the disk space in the database to load the data. Be sure to add enough disk space to accommodate your data. Disk space must be contiguous, which can improve the performance of the load. For example:
ALTER DBSPACE system
ADD 200MB
7. Apply Reload.sql to the database in interactive SQL.
dbisql -c "DBF=new.db;UID=DBA;pwd=sql" reload.sql
Known Issues
If the rebuild fails during the run of the Dbunload utility or Uninstall Wizard, you can use the following steps to help you determine the cause of the failure:
1, run the dbunload command using the-N option:
dbunload -c "connection-string" -n directory-name
2, create a new, blank version of the 10 database
dbinit test.db
3, apply the Reload.sql to the blank database:
dbisql -c "DBF=test.db;UID=DBA;pwd=sql" reload.sql
4, according to the application of Reload.sql file to the new database message, modify Reload.sql or the original database as appropriate.
The following table lists the causes and solutions that may cause the rebuild to fail.
Known Issues:
If the table name has an object owner prefix, the declare local temporary table statement in the stored procedure or trigger statement produces an expression error.
Solution:
Remove the owner of the object.