CREATE LOGICALLY REPLICATED statement starts logical data replication (LDR) on a table(s) that runs between a source and destination cluster in an active-active setup. CREATE LOGICALLY REPLICATED creates the new table on the destination cluster automatically and conducts a fast, offline initial scan. It accepts unidirectional or bidirectional on as an option to create either one of the setups automatically.
Once the offline initial scan completes, the new table will come online and is ready to serve queries. In a bidirectional setup, the second LDR stream will also initialize after the offline initial scan completes.
If the table to be replicated contains user-defined types, you must use the
CREATE LOGICAL REPLICATION STREAM statement instead. You can set up unidirectional or bidirectional LDR manually with CREATE LOGICAL REPLICATION STREAM.CREATE LOGICALLY REPLICATED SQL statement, which includes information on its parameters and options. For a step-by-step guide to set up LDR, refer to the Set Up Logical Data Replication page.
Required privileges
CREATE LOGICALLY REPLICATED requires one of the following privileges:
- The
adminrole. - The
REPLICATIONsystem privilege.
GRANT SYSTEM statement:
Synopsis
<?xml version=“1.0” encoding=“UTF-8”?>Parameters
Options
Examples
CREATE LOGICALLY REPLICATED will automatically create the specified source tables on the destination cluster. For unidirectional and bidirectional, run the statement to start LDR on the destination cluster that does not contain the tables.
Unidirectional
From the destination cluster of the LDR stream, run:- Fully qualified destination table name.
- Fully qualified source table name.
- External connection for the source cluster. For instructions on creating the external connection for LDR, refer to Set Up Logical Data Replication.
unidirectionaloption.- Any other options.
Bidirectional
Both clusters will act as a source and destination in bidirectional LDR setups. To start the LDR jobs, you must run this statement from the destination cluster that does not contain the tables:- Fully qualified destination table name.
- Fully qualified source table name.
- External connection for the source cluster. For instructions on creating the external connection for LDR, refer to Set Up Logical Data Replication.
bidirectional onoption defining the external connection for the destination cluster.- Any other options.

