Migrate and Rebuild a Database

To begin the defragmentation process, select a replication peer and stop replication on that database.

In this example, ttdb2 database is chosen for defragmentation. Perform the following to save a copy of the database:

Note:

While the database ttdb2 is being degramented, application processing can continue on the other replication database ttdb1.

  1. Stop the replication agent on the ttdb2 database:
    ttAdmin –repStop ttdb2
  2. Save a copy of the ttdb2 database using ttMigrate.
    ttMigrate -c ttdb2 ttdb2.dat
  3. Destroy the database:
    ttDestroy ttdb2
  4. As a TimesTen user with ADMIN privileges, restore the ttdb2 database:
    ttMigrate -r -relaxedUpgrade -connstr "dsn=ttdb2;uid=ttadmin;pwd=ttadminpwd" ttdb2.dat

    After restoring the ttdb2 database:

    • All the users are restored to ttdb2.

    • The replication agent is not running.

  5. Restart the replication agent on ttdb2:
    ttAdmin -repStart ttdb2

The ttdb2 TimesTen database is defragmented.