DR TABLE

Documentation

VoltDB Home » Documentation » Using VoltDB

DR TABLE

DR TABLE — Identifies a table as a participant in database replication (DR)

Synopsis

DR TABLE table-name [DISABLE]

Description

The DR TABLE statement identifies a table as a participant in database replication (DR). If DR is not enabled, the DR TABLE statement has no effect on the operation of the table or the database as a whole. However, once DR is enabled and if the current cluster is the master database for the DR operation, any updates to the contents of tables identified in the DR TABLE statement are copied and applied to the replica database as well.

The DR TABLE ... DISABLE statement reverses the effect of a previous DR TABLE statement, removing the specified table from participation in DR. Because the replica database schema must have DR TABLE statements for any tables being replicated by the master, if DR is actively occurring you must add the DR TABLE statements to the replica before adding them to the master. In reverse, you must issue DR TABLE... DISABLE statements on the master before you issue the matching statements on the replica.

See Chapter 11, Database Replication and Active(N) for more information about how database replication works.

Examples

The following example identifies the tables Employee and Department as participants in database replication.

DR TABLE Employee;
DR TABLE Department;