Choose a topic
Starting and stopping the replication agentsAfter you have defined a replication scheme, you can start the replication agents for each database involved in the replication scheme. You must have the ADMIN privilege to start or stop a replication agent.You can start and stop a replication agent by using the ttAdmin utility with the -repStart or -repStop option. You can also use the ttRepStart and ttRepStop built-in procedures to start and stop a replication agent from the ttIsql command line.Example 11-1 Starting and stopping the replication agent with ttAdminTo start the replication agents for the DSNs named masterDSN and subscriberDSN, enter:ttAdmin -repStart masterDSNttAdmin -repStart subscriberDSNTo stop the replication agents, enter:ttAdmin -repStop masterDSNttAdmin -repStop subscriberDSNExample 11-2 Starting and stopping the replication agent from ttIsqlTo start and stop the replication agent for the DSN named masterDSN, enter:> ttIsql masterDSNCommand> call ttRepStart;Command> call ttRepStop;You can also use the ttAdmin utility to set the replication restart policy. By default the policy is manual, which enables you to start and stop the replication agents as described above. Alternatively, you can set the replication restart policy for a database to always or norestart.Restart PolicyStart replication agent when the TimesTen daemon startsRestart replication agent on errors or invalidationalwaysYesYesmanualNoYesnorestartNoNoNote:The TimesTen daemon manages the replication agents. It must be running to start or stop the replication agents.When the restart policy is always, the replication agent is automatically started when the database is loaded into memory. See "Specifying a RAM policy" in Oracle TimesTen In-Memory Database Operations Guide to determine when a database is loaded into memory.Example 11-3 Using ttAdmin to set the restart policyTo use ttAdmin to set the replication restart policy to always, enter:ttAdmin -repPolicy always DSNTo reset the policy back to manual, enter:ttAdmin -repPolicy manual DSNFollowing a database invalidation, both manual and always policies cause the replication agent to be automatically restarted. When the agent restarts automatically, it is often the first connection to the database. This happens after a fatal error that, for example, requires all applications to disconnect. The first connection to a database usually has to load the most recent checkpoint file and often needs to do recovery. For a very large database, this process may take several minutes. During this period, all activity on the database is blocked so that new connections cannot take place and any old connections cannot finish disconnecting. This may also result in two copies of the database existing at the same time because the old one stays around until all applications have disconnected. For very large databases for which the first-connect time may be significant, you may want to wait for the old database to become inactive first before starting up the new one. You can do this by setting the restart policy to norestart to specify that the replication agent is not to be automatically restarted. For more information on setting policies that would prevent the database from being reloaded, see "Specifying a RAM policy" in Oracle TimesTen In-Memory Database Operations Guide to determine when a database is loaded into memory.
Starting and stopping the replication agents