Alter the Replication Scheme

In order to perform the database defragmentation on the ttdb1 database, perform the following:

  1. Stop all application processing and disconnect all application connections with the ttAdmin -disconnect command. Any processing can be moved to work at the ttdb2 TimesTen database. For more information, see Disconnecting from a Database and ttAdmin in the Oracle TimesTen In-Memory Database Reference.
  2. Call the ttRepSubscriberWait built-in procedure at the database (ttdb1) that is not defragmented, with the database name and host of the defragmented database (ttdb2) as input parameters. This verifies that all queued updates have been transmitted to both databases.

    Note:

    If you set the waitTime to -1, the call waits until all committed transactions have been transmitted to the subscriber without timeout value.

    However, if you set the waitTime to any value (this value may not be NULL), ensure that the return timeOut parameter value is 0x00 before continuing. If the returned value is 0x01, repeatedly call the ttRepSubscriberWait built-in procedure until it returns 0x00, which indicates that all committed transactions are transmitted to the subscriber.

    For more details, see ttRepSubscriberWait in the Oracle TimesTen In-Memory Database Reference.

    Using ttIsql on ttdb1:

    call ttRepSubscriberWait(NULL,NULL,'ttdb2','ttsrv2', 100);

    If you are using a bidirectional replication scheme, skip steps 3 - 6.

  3. For a unidirectional replication scheme, stop the replication agent on ttdb2:
    ttAdmin -repStop ttdb2
  4. For a unidirectional replication scheme, drop the replication scheme on the master ttdb1 and subscriber ttdb2:

    Using ttIsql on ttdb1:

    DROP REPLICATION r1;

    Using ttIsql on ttdb2:

    DROP REPLICATION r1;
  5. Configure ttdb2 as a master database for a unidirectional replication scheme. Recreate the replication scheme with ttdb2 as the master and ttdb1 as the subscriber for each element.
    CREATE REPLICATION ttuser.rep1        
    ELEMENT e1 TABLE ttuser.t1
    MASTER ttdb2        
    SUBSCRIBER ttdb1        
    STORE ttdb1 TABLE DEFINITION CHECKING RELAXED
  6. For a unidirectional replication scheme, restart the replication agent on the master database ttdb2:
    ttAdmin -repStart ttdb2
  7. Stop the replication agent on ttdb1:
    ttAdmin -repStop ttdb1

If you modified a unidirectional replication scheme, the ttdb2 database now acts as the master database in the unidirectional scheme; the ttdb1 database acts as the subscriber database in the unidirectional replication scheme. Now, the master database is functional and the next step is to recreate the new database ttdb1 by duplicating the previously defragmented database ttdb2. For details, see Destroy and Re-Create a Database.