Check Replication State

You can use the ttReplicationStatus built-in procedure to check the state of the subscriber database with respect to its master. If the subscriber is in the Stop, Pause, or Failed state, use the ttReplicationStatus procedure to reset the subscriber state to Start, as described in Set the Replication State of Subscribers in the Oracle TimesTen In-Memory Database Replication Guide.

This examples uses ttReplicationStatus to obtain the status of the subscriberds database from its master database, masterDSN, enter:

> ttIsql masterDSN
Command> CALL ttReplicationStatus ('subscriberds');
< SUBSCRIBERDS, MYHOST, 0, pause, 1, 10, REPSCHEME, REPL >
1 row found.

To reset state to Start call the ttRepSubscriberStateSet procedure:

Command> CALL ttRepSubscriberStateSet('REPSCHEME', 'REPL', 'SUBSCRIBERDS', 'MYHOST', 0)
Command> CALL ttReplicationStatus ('subscriberds');
< SUBSCRIBERDS, MYHOST, 0, start, 1, 152959, REPSCHEME, REPL >
1 row found.

Check Replication Scheme Configuration

This section describes the procedures you can use to confirm the correct configuration of the various components in your replicated system:

Check ttRepAdmin -showconfig

Use ttRepAdmin -showconfig to confirm the configuration of your replication scheme.

What to look for:

  • Are all of the subscriber agents started and reported to be in the Start state? If not, reset the agents to the Start state. See Set the Replication State of Subscribers in the Oracle TimesTen In-Memory Database Replication Guide.

  • Do the reported Peer names match the names given in the DataStore attributes in the DSN definitions for the replicated databases? Replication does not work if you specified the names given for the Data Source Name attributes.

  • Is there anything under List of subscribers? If not, confirm the database names you specified in the DSN definition are consistent with those you specified in your replication scheme configuration file.

  • Are the Host names correct? If in doubt, see Check Host Names for information.

  • Are the correct table names displayed under Table details? If not, correct the table names in your replication scheme configuration file.

This example confirms the configuration of the replication scheme.

> ttRepAdmin -showconfig masterDSN
Self host "MYHOST", port auto, name "MASTERDS", LSN 4/2970276, timeout 120, threshold 0
List of subscribers
-----------------
Peer name         Host name                 Port    State  Proto
----------------  ------------------------ ------  ------- -----
SUBSCRIBERDS      MYHOST                    Auto   Start      10
Last Msg Sent Last Msg Recv Latency TPS     RecordsPS Logs
------------- ------------- ------- ------- --------- ----
0:01:12       -               19.41       5        52    2
List of tables and subscriptions
--------------------------------
Table details
-------------
Table : REPL.TAB
Master Name               Subscriber Name
-----------               -------------
MASTERDS                  SUBSCRIBERDS

Check TTREP.TTSTORES Systen Table

Check the TTREP.TTSTORES table to confirm that replication associates the replication scheme with the local database.

Connect to the database and enter:

SELECT * FROM ttrep.ttstores WHERE is_local_store <> 0x0;
< -5193371075573733683, MYHOST, MASTERDS, 01, 0, 0, 4, 0 >
1 row found.

There should be exactly one row returned. If more than one row is returned, contact TimesTen Customer Support. If no rows are returned, then none of the hosts returned by the following statement is perceived to be a local system by TimesTen replication:

SELECT DISTINCT host_name FROM ttrep.ttstores;

It may also be that none of the database names specified in your replication scheme match those specified in your DSN descriptions.

Check Host Names

Some hosts or IP addresses specified in a replication scheme cannot be resolved by the replication agent because:

  • Host names or IP addresses specified in the replication scheme are wrong or misspelled.

  • Host names or IP addresses cannot be resolved or found by DNS or in the /etc/hosts file

  • Entries in the /etc/hosts file are incorrectly ordered in appearance. This error is most common when multiple NICs are used. You must have root privilege to make changes to the /etc/hosts files.

See Configuring the Network in the Oracle TimesTen In-Memory Database Replication Guide for details on how to configure DNS and /etc/hosts files for host systems used for replication.

To check if a host name in the replication scheme matches the host name of the local system, write an application to perform these tasks:

  1. Use a gethostname operating system function call to determine the host name of the running host.
  2. Call gethostbyname with the output from Step 1.
  3. Call gethostbyname with the host name specified in the replication scheme.
  4. Compare output of Step 2 and Step 3. If there is a match, then the running host is involved in replication. Otherwise, it is not involved in replication.