Rebuilding a database on Windows Mobile
 Unload a database on Windows Mobile (dbunload)

The following steps can be embedded into third-party Windows Mobile applications so that the process is automated for the end user. If you choose to do this, then you should consider using the -qc and/or -q dbunload and dbrunsql options or calling the DBUnload function in dbtool12.dll.

  1. On a platform other than Windows Mobile, create a new, empty SQL Anywhere 12 database.

    The CHAR collation sequence should match that of the existing database. If NCHAR UCA sorting is not required, the NCHAR collation sequence should be UTF8BIN. In this way, the ICU libraries (dbicu12.dll, dbicudt12.dll) are not required by the database server.

  2. Copy the SQL Anywhere 12 software and the empty SQL Anywhere database file to the Windows Mobile device. See Notes about using dbunload on Windows Mobile.

  3. Ensure there are no database servers running on the device.

  4. Run the following command:

    dbunload-path\dbunload -c "UID=DBA;PWD=DBA-password;CHARSET=none;DBF=existing-database" unload-directory
  5. Ensure that dbunload succeeded, and then close the dbunload window.

  6. Run the following command:

    dbrunsql-path\dbrunsql -c "UID=DBA;PWD=sql;CHARSET=none;DBF=new-empty-SQLAnywhere12database-file" -g- \reload.sql
  7. Ensure that dbrunsql succeeded, and then close the dbrunsql window.

  8. Remove the reload.sql file and unload-directory from the Windows Mobile device.