CREATE ACTIVE STANDBY PAIR
This statement is not supported in TimesTen Scaleout.
In TimesTen Classic:
This statement creates an active standby pair. It includes an active master database, a standby master database, and may also include one or more read-only subscribers. The active master database replicates updates to the standby master database, which propagates the updates to the subscribers.
Required Privilege
ADMIN
Usage with TimesTen Scaleout
This statement is not supported with TimesTen Scaleout.
SQL Syntax
CREATE ACTIVE STANDBY PAIR FullStoreName, FullStoreName [ReturnServiceAttribute] [SUBSCRIBER FullStoreName [,...]] [STORE FullStoreName [StoreAttribute [...]]] [NetworkOperation [...] ] [{ INCLUDE | EXCLUDE }{TABLE [[Owner.]TableName [,...]]| CACHE GROUP [[Owner.]CacheGroupName [,...]]| SEQUENCE [[Owner.]SequenceName [,...]]} [,...]]
Syntax for ReturnServiceAttribute
:
{ RETURN RECEIPT [BY REQUEST] | RETURN TWOSAFE [BY REQUEST] | NO RETURN }
Syntax for StoreAttribute
:
DISABLE RETURN {SUBSCRIBER | ALL} NumFailures RETURN SERVICES {ON | OFF} WHEN [REPLICATION] STOPPED DURABLE COMMIT {ON | OFF} RESUME RETURN Milliseconds LOCAL COMMIT ACTION {NO ACTION | COMMIT} RETURN WAIT TIME Seconds COMPRESS TRAFFIC {ON | OFF} PORT PortNumber TIMEOUT Seconds FAILTHRESHOLD Value TABLE DEFINITION CHECKING {RELAXED|EXACT}
Syntax for NetworkOperation
:
ROUTE MASTER FullStoreName SUBSCRIBER FullStoreName { { MASTERIP MasterHost | SUBSCRIBERIP SubscriberHost } PRIORITY Priority } [...]
Parameters
Parameter | Description |
---|---|
|
The database, specified as one of the following:
For example, if the database path is This is the database file name specified in the
|
|
Enables the return receipt service, so that applications that commit a transaction to an active master database are blocked until the transaction is received by the standby master database. Specifying |
|
Enables the return twosafe service, so that applications that commit a transaction to an active master database are blocked until the transaction is committed on the standby master database. Specifying For details on the use of the return services, see Using a Return Service in Oracle TimesTen In-Memory Database Replication Guide. |
|
Set the return service failure policy so that return service blocking is disabled after the number of timeouts specified by Specifying This failure policy can be specified for either the |
|
Sets return services on or off when replication is disabled (stopped or paused state).
See Establishing Return Service Failure and Recovery Policies in Oracle TimesTen In-Memory Database Replication Guide. |
|
If |
|
Specifies that no return service is to be used. This is the default. For details on the use of the return services, see Using a Return Service in Oracle TimesTen In-Memory Database Replication Guide. |
|
Specifies the number of seconds to wait for return service acknowledgment. A value of 0 (zero) means that there is no waiting. The default value is 10 seconds. The application can override this timeout setting by using the |
|
A database that receives updates from a master database. |
|
Defines the attributes for the specified database. Attributes include |
|
StoreAttribute clause. Specifies type of table definition checking that occurs on the subscriber:
The default is Note: If you use |
|
An active standby pair replicates an entire database by default.
Do not use the |
|
Compress replicated traffic to reduce the amount of network bandwidth. |
|
Overrides the |
|
The number of log files that can accumulate for a subscriber database. If this value is exceeded, the subscriber is set to the See Setting the Transaction Log Failure Threshold in Oracle TimesTen In-Memory Database Replication Guide for more information. |
|
Specifies the default action to be taken for a return twosafe transaction in the event of a timeout. Note: This attribute is valid only when the
This setting can be overridden for specific transactions by calling the |
|
The database on which applications update the specified element. The |
|
The TCP/IP port number on which the replication agent for the database listens for connections. If not specified, the replication agent automatically allocates a port number. In an active standby pair, the standby master database listens for updates from the active master database. Read-only subscribers listen for updates from the standby master database. |
|
Denotes the
When using active standby pairs, For |
|
Clause can be specified more than once. |
|
Variable expressed as an integer from 1 to 99. Denotes the priority of the IP address. Lower integral values have higher priority. An error is returned if multiple addresses with the same priority are specified. Controls the order in which multiple IP addresses are used to establish peer connections. Required syntax of |
|
The maximum number of seconds the replication agent waits for a response from remote replication agents. The default is 120 seconds. In an active standby pair, the active master database sends messages to the standby master database. The standby master database sends messages to the read-only subscribers. Note: For large transactions that may cause a delayed response from the remote replication agent, the agent scales the timeout based on the size of the transaction. This scaling is disabled if you set |
Description
-
After you create an active standby pair, make one of your databases the active database. To accomplish this, call
ttRepStateSet
('ACTIVE')
. Then usettRepAdmin
to duplicate the active database to the second database. When the operation is successful, the second database becomes the standby database. For more information, see Setting Up an Active Standby Pair with No Cache Groups in Oracle TimesTen In-Memory Database Replication Guide. -
The
SUBSCRIBER
clause lists one or more read-only subscriber databases. You can designate up to 127 subscriber databases. -
Replication between the active master database and the standby master database can be
RETURN TWOSAFE
,RETURN RECEIPT
, or asynchronous.RETURN TWOSAFE
ensures no transaction loss. -
Use the
INCLUDE
andEXCLUDE
clauses to exclude the listed tables, sequences and cache groups from replication, or to include only the listed tables, sequences and cache groups, excluding all others. -
If the active standby pair has the
RETURN TWOSAFE
attribute and replicates a cache group, a transaction may fail if:-
The transaction that is being replicated contains an
ALTER TABLE
statement or anALTER CACHE GROUP
statement. -
The transaction contains an
INSERT
,UPDATE
orDELETE
statement on a replicated table, replicated cache group or an asynchronous writethrough cache group.
-
-
You can use an active standby pair to replicate read-only cache groups and asynchronous writethrough (AWT) cache groups. You cannot use an active standby pair to replicate synchronous writethrough (SWT) cache groups or user managed cache groups.
-
You cannot use the
EXCLUDE
clause for AWT cache groups. -
You cannot execute the
CREATE ACTIVE STANDBY PAIR
statement when Oracle Clusterware is used with TimesTen.
Examples
This example creates an active standby pair whose master databases are rep1
and rep2
. There is one subscriber, rep3
. The type of replication is RETURN RECEIPT
. The statement also sets PORT
and TIMEOUT
attributes for the master databases.
CREATE ACTIVE STANDBY PAIR rep1, rep2 RETURN RECEIPT SUBSCRIBER rep3 STORE rep1 PORT 21000 TIMEOUT 30 STORE rep2 PORT 22000 TIMEOUT 30;
Specify NetworkOperation
clause to control network interface:
CREATE ACTIVE STANDBY PAIR rep1,rep2 ROUTE MASTER rep1 ON "machine1" SUBSCRIBER rep2 ON "machine2" MASTERIP "1.1.1.1" PRIORITY 1 SUBSCRIBERIP "2.2.2.2" PRIORITY 1 ROUTE MASTER rep2 ON "machine2" SUBSCRIBER rep1 ON "machine1" MASTERIP "2.2.2.2" PRIORITY 1 SUBSCRIBERIP "1.1.1.1" PRIORITY 1;