Offline Defragmentation of a TimesTen Database

To defragment a TimesTen database, use the ttMigrate utility.

  1. Stop all connections to the database.
  2. Save a copy of the database using ttMigrate.
    ttMigrate -c ttdb ttdb.dat
  3. Destroy the database:
    ttDestroy ttdb
  4. As the administration user, rebuild the ttdb database:
    ttMigrate -r -relaxedUpgrade -connstr "dsn=ttdb" ttdb.dat

    Note:

    You can achieve maximum table defragmentation with the ttMigrate -r -relaxedUpgrade command. Table partitions is added when columns are added to tables with the ALTER TABLE ADD SQL statement. The -relaxedUpgrade option also condenses table partitions. If you do not want to condense table partitions, remove the -relaxedUpgrade option. See the notes on ALTER TABLE in the Oracle TimesTen In-Memory Database SQL Reference. For performance considerations, see Avoid ALTER TABLE. For details on the utility, see ttMigrate in the Oracle TimesTen In-Memory Database Reference.

After restoring the ttdb database:

  • All the users, cache groups, and the active standby pair have been restored to ttdb.

  • The cache groups are in AUTOREFRESH STATE = OFF.