ALTER REPLICATION
This statement is not supported in TimesTen Scaleout.
In TimesTen Classic:
The ALTER REPLICATION
statement adds, alters, or drops replication elements and changes the replication attributes of participating databases involved in a classic replication scheme.
Most ALTER REPLICATION
operations are supported only when the replication agent is stopped (ttAdmin
-repStop
). However, it is possible to dynamically add a subscriber database to a replication scheme while the replication agent is running. See Altering a Classic Replication Scheme in Oracle TimesTen In-Memory Database Replication
Guide for more information.
Required Privilege
ADMIN
Usage with TimesTen Scaleout
This statement is not supported with TimesTen Scaleout.
SQL Syntax
The ALTER REPLICATION
statement has the syntax:
ALTER REPLICATION [Owner.]ReplicationSchemeName ElementOperation [...] | StoreOperation | NetworkOperation [...]
Specify ElementOperation
one or more times:
ADD ELEMENT ElementName { DATASTORE | { TABLE [Owner.]TableName [CheckConflicts] } | SEQUENCE [Owner.]SequenceName } { MASTER | PROPAGATOR } FullStoreName { SUBSCRIBER FullStoreName [,... ] [ReturnServiceAttribute] } [ ... ] { INCLUDE | EXCLUDE } { TABLE [[Owner.]TableName[,...]] | SEQUENCE [[Owner.]SequenceName[,...]] } [,...] ALTER ELEMENT { ElementName | * IN FullStoreName } ADD SUBSCRIBER FullStoreName [,...] [ReturnServiceAttribute] | ALTER SUBSCRIBER FullStoreName [,...]| SET [ReturnServiceAttribute] DROP SUBSCRIBER FullStoreName [,... ] ALTER ELEMENT * IN FullStoreName SET { MASTER | PROPAGATOR } FullStoreName ALTER ELEMENT ElementName {SET NAME NewElementName | SET CheckConflicts} ALTER ELEMENT ElementName { INCLUDE | EXCLUDE } { TABLE [Owner.]TableName | SEQUENCE [Owner.]SequenceName }[,...] DROP ELEMENT { ElementName | * IN FullStoreName }
CheckConflicts
can only be set when replicating TABLE
elements. See CHECK CONFLICTS for syntax requirements.
Syntax for ReturnServiceAttribute
is:
{ RETURN RECEIPT [BY REQUEST] | NO RETURN }
StoreOperation
clauses:
ADD STORE FullStoreName [StoreAttribute [... ]] ALTER STORE FullStoreName SET StoreAttribute [... ]
Syntax for the StoreAttribute
is:
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 CONFLICT REPORTING SUSPEND AT Value CONFLICT REPORTING RESUME AT Value TABLE DEFINITION CHECKING {EXACT|RELAXED}
Specify NetworkOperation
one or more times:
ADD ROUTE MASTER FullStoreName SUBSCRIBER FullStoreName { { MASTERIP MasterHost | SUBSCRIBERIP SubscriberHost } PRIORITY Priority } [...] DROP ROUTE MASTER FullStoreName SUBSCRIBER FullStoreName { MASTERIP MasterHost | SUBSCRIBERIP SubscriberHost } [...]
Parameters
Parameter | Description |
---|---|
|
Name assigned to the classic replication scheme. |
|
Adds a new element to the existing classic replication scheme. If the element is a |
|
Adds a new
If the element is a sequence, |
|
Indicates an additional subscriber database. |
|
Makes a change to all elements for which This syntax can be used on a set of element names to:
|
|
Name of the element to which a subscriber is to be added or dropped. |
|
Renames |
|
If the element is a sequence, |
|
Indicates an alteration to a subscriber database to enable, disable, or change the return receipt service. |
|
Check for replication conflicts when simultaneously writing to bidirectionally replicating |
|
Compress replicated traffic to reduce the amount of network bandwidth. |
|
Suspends conflict resolution reporting.
This clause is valid for table level replication. |
|
Resumes conflict resolution reporting.
This clause is valid for table level replication. |
|
Set the return service failure policy so that return service blocking is disabled after the number of timeouts specified by If |
|
Overrides the |
|
Deletes the replication description of all elements for which |
|
Deletes the replication description of |
|
Indicates that updates should no longer be sent to the specified subscriber database. This operation fails if the classic replication scheme has only one subscriber. |
|
The number of log files that can accumulate for a subscriber database. If this value is exceeded, the subscriber is set to the The value 0 means "No Limit." This is the default. See Setting the Transaction Log Failure Threshold in Oracle TimesTen In-Memory Database Replication Guide for more information. |
|
The database, specified as one of the following:
For example, if the database path is This is the database file name specified in the
|
|
Specifies the default action to be taken for a
This setting can be overridden for specific transactions by calling the |
|
The database on which applications update the specified element. The |
|
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. |
|
The TCP/IP port number on which the replication agent on this database listens for connections. If not specified, the replication agent allocates a port number automatically. All TimesTen databases that replicate to each other must use the same port number. |
|
The database that receives replicated updates and passes them on to other databases. |
|
If return service blocking has been disabled by If |
|
Enables the return receipt service, so that applications that commit a transaction to a master database are blocked until the transaction is received by all subscribers.
|
|
Sets return services on or off when replication is disabled (stopped or paused state).
|
|
Enables the return twosafe service, so that applications that commit a transaction to a master database are blocked until the transaction is committed on all subscribers.
|
|
Specifies the number of seconds to wait for return service acknowledgment. The default value is 10 seconds. A value of 0 (zero) means there is no timeout. Your application can override this timeout setting by calling the |
|
Sets the given database to be the |
|
A database that receives updates from the |
|
Specifies type of table definition checking that occurs on the subscriber:
The default is Note: If you use |
|
The maximum number of seconds the replication agent waits for a response from remote replication agents. The default is 120 seconds. Note: For large transactions that may cause a delayed response from the remote replication agent, the agent scales the timeout to increasingly larger values, as needed, based on the size of the transaction. This scaling will not occur, and the agent may time out waiting for responses, if you set |
|
Adds Can be specified more than once. For |
|
Drops Can be specified more than once. For |
|
Clause can be specified more than once. Valid for both |
|
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 |
Description
-
ALTER ELEMENT DROP SUBSCRIBER
deletes a subscriber for a particular replication element. -
ALTER ELEMENT SET NAME
may be used to change the name of a replication element when it conflicts with one already defined at another database.SET NAME
does not admit the use of* IN
FullStoreName
. TheFullStoreName
must be the database's file base name. For example, if the database file name isdata.ds0
, thendata
is the file base name. -
ALTER ELEMENT SET MASTER
may be used to change the master database for replication elements. The* IN
FullStoreName
option must be used for theMASTER
operation. That is, a master database must transfer ownership of all of its replication elements, thereby giving up its master role entirely. Typically, this option is used inALTER REPLICATION
statements requested atSUBSCRIBER
databases after the failure of a (common)MASTER
. -
To transfer ownership of the master elements to the subscriber:
-
Manually drop the replicated elements by executing an
ALTER REPLICATION DROP ELEMENT
statement for each replicated table. -
Use
ALTER REPLICATION ADD ELEMENT
to add each table back to the replication scheme, with the newly designatedMASTER
/SUBSCRIBER
roles.
-
-
ALTER REPLICATION ALTER ELEMENT SET MASTER
does not automatically retain the old master as a subscriber in the scheme. If this is desired, execute anALTER REPLICATION ALTER ELEMENT ADD SUBSCRIBER
statement.Note:
There is no
ALTER ELEMENT DROP MASTER
. Each replication element must have exactly oneMASTER
database, and the currently designatedMASTER
cannot be deleted from the replication scheme. -
Stop the replication agent before you use the
NetworkOperation
clause. -
You cannot alter the following replication schemes with the
ALTER REPLICATION
statement:-
Any active standby pair. Instead, use
ALTER ACTIVE STANDBY PAIR
. -
A Clusterware-managed active standby pair. Instead, perform the tasks described in Changing the Schema section of the Oracle TimesTen In-Memory Database Replication Guide.
-
Examples
This example sets up a classic replication scheme for an additional table westleads
that is updated on database west
and replicated to database east
.
ALTER REPLICATION r1 ADD ELEMENT e3 TABLE westleads MASTER west ON "westcoast" SUBSCRIBER east ON "eastcoast";
This example adds an additional subscriber (backup
) to table westleads
.
ALTER REPLICATION r1 ALTER ELEMENT e3 ADD SUBSCRIBER backup ON "backupserver";
This example changes the element name of table westleads
from e3
to newelementname
.
ALTER REPLICATION r1 ALTER ELEMENT e3 SET NAME newelementname;
This example makes newwest
the master for all elements for which west
currently is the master.
ALTER REPLICATION r1 ALTER ELEMENT * IN west SET MASTER newwest;
This element changes the port number for east
.
ALTER REPLICATION r1 ALTER STORE east ON "eastcoast" SET PORT 22251;
This example adds my.tab1
table to the ds1
database element in my.rep1
replication scheme.
ALTER REPLICATION my.rep1 ALTER ELEMENT ds1 DATASTORE INCLUDE TABLE my.tab1;
This example adds ds1
database to my.rep1
replication scheme. Include my.tab2
table in the database.
ALTER REPLICATION my.rep1 ADD ELEMENT ds1 DATASTORE MASTER rep2 SUBSCRIBER rep1, rep3 INCLUDE TABLE my.tab2;
This example adds ds2
database to a replication scheme but excludes my.tab1
table.
ALTER REPLICATION my.rep1 ADD ELEMENT ds2 DATASTORE MASTER rep2 SUBSCRIBER rep1 EXCLUDE TABLE my.tab1;
Add NetworkOperation
clause:
ALTER REPLICATION r ADD ROUTE MASTER rep1 ON "machine1" SUBSCRIBER rep2 ON "machine2" MASTERIP "1.1.1.1" PRIORITY 1 SUBSCRIBERIP "2.2.2.2" PRIORITY 1 MASTERIP "3.3.3.3" PRIORITY 2 SUBSCRIBERIP "4.4.4.4" PRIORITY 2;
Drop NetworkOperation
clause:
ALTER REPLICATION r DROP ROUTE MASTER repl ON "machine1" SUBSCRIBER rep2 ON "machine2" MASTERIP "1.1.1.1" SUBSCRIBERIP "2.2.2.2" MASTERIP "3.3.3.3" SUBSCRIBERIP "4.4.4.4";
See Also
ALTER ACTIVE STANDBY PAIR
CREATE ACTIVE STANDBY PAIR
CREATE REPLICATION
DROP ACTIVE STANDBY PAIR
DROP REPLICATION
To drop a table from a database, see Altering a Replicated Table in a Classic Replication Scheme in Oracle TimesTen In-Memory Database Replication Guide.