ttRepDuplicateEx

Description

Creates a replica of a remote database on the local system. The process is initiated from the receiving local system. From there, a connection is made to the remote source database to perform the duplicate operation.

Note:

  • This utility has features to recover from a site failure by creating a disaster recovery (DR) read-only subscriber as part of the active standby pair replication scheme. See Using a Disaster Recovery Subscriber in an Active Standby Pair in Oracle TimesTen In-Memory Database Replication Guide.

  • If the database does not use cache groups, the following items discussed below are not relevant: cacheuid and cachepwd data structure elements; TT_REPDUP_NOKEEPCG, TT_REPDUP_RECOVERINGNODE, TT_REPDUP_INITCACHEDR, and TT_REPDUP_DEFERCACHEUPDATE flag values.

  • There are elements in the ttRepDuplicateExArg structure that is a parameter of this utility, localIP and remoteIP, that enable you to optionally specify which local network interface to use, which remote network interface to use, or both.

Required Privilege

Requires an instance administrator on the receiving local database (where ttRepDuplicateEx is called) and a user with ADMIN privilege on the remote source database. Create the internal user on the remote source store as necessary.

In addition, be aware of the following requirements to execute ttRepDuplicateEx:

  • The operating system user name of the instance administrator on the receiving local database must be the same as the operating system user name of the instance administrator on the remote source database.

  • When ttRepDuplicateEx is called, the uid and pwd data structure elements must specify the user name and password of the user with ADMIN privilege on the remote source database. This user name is used to connect to the remote source database to perform the duplicate operation.

Syntax

ttRepDuplicateEx (ttUtilHandle handle,
                  const char* destConnStr,
                  const char* srcDatabase,
                  const char* remoteHost,
                  ttRepDuplicateExArg* arg
                  )
typedef struct
{
      unsigned int size; /*set to size of(ttRepDuplicateExArg) */
      unsigned int flags;
      const char* uid;
      const char* pwd;
      const char* pwdcrypt;
      const char* cacheuid;
      const char* cachepwd;
      const char* localHost;
      int truncListLen;
      const char** truncList;
      int dropListLen;
      const char** dropList;
      int maxkbytesPerSec;
      int remoteDaemonPort;
      int nThreads4initDR;
      const char* localIP
      const char* remoteIP
      int crsManaged;
} ttRepDuplicateExArg

Parameters

Parameter Type Description

handle

ttUtilHandle

Specifies the TimesTen utility library environment handle allocated using ttUtilAllocEnv.

destConnStr

const char*

This is a null-terminated string specifying the connection string for a local database into which the replica of the remote database is created.

srcDatabase

const char*

This is a null-terminated string specifying the remote source database name. This name is the last component of the database path name.

remoteHost

const char*

This is a null-terminated string specifying the TCP/IP host name of the system where the remote source database is located.

arg

ttRepDuplicateExArg*

This is the address of the structure containing the desired ttRepDuplicateEx arguments. If NULL is passed in for arg or if the value of arg ->size is invalid, TimesTen returns error 12230, "Invalid argument value", and TTUTIL_ERROR.

Struct Elements

The ttRepDuplicateExArg structure contains these elements:

Element Type Description

size

unsigned int

Size

This must be set up to sizeof (ttRepDuplicateExArg).

flags

unsigned int

Bit-wise union of values chosen from the list in the table of flag values

uid

const char*

User name of a user on the remote source database with ADMIN privileges

This user name is used to connect to the remote source database to perform the duplicate operation.

pwd

const char*

Password associated with the user ID

pwdcrypt

const char*

Encrypted password associated with the user ID

cacheuid

const char*

TimesTen cache administration user ID

cachepwd

const char*

TimesTen cache administration user password

localHost

const char*

Null-terminated string specifying the TCP/IP host name of the local system

This element is ignored if remoteRepStart is TT_FALSE. This explicitly identifies the local host. This parameter can be null, which is useful if the local host uses a nonstandard name such as an IP address.

truncListLen

int

Number of elements in the truncList

truncList

const char**

List of non-replicated tables to truncate after duplicate

dropListLen

int

Number of elements in dropList

dropList

const char**

List of non-replicated tables to drop after the duplicate operation

maxkbytesPerSec

int

Maximum kilobytes per second

Setting this to a nonzero value specifies that the duplicate operation should not put more than maxkbytesPerSec kilobytes of data per second onto the network. Setting it to 0 or a negative number indicates that the duplicate operation should not attempt to limit its bandwidth.

remoteDaemonPort

int

Remote daemon port

Setting this to 0 results in the daemon port number for the target database being set to the port number used for the daemon on the source database.

This option cannot be used in duplicate operations for databases with automatic port configuration.

nThreads4initDR

int

Number of threads for initialization

For the disaster recovery subscriber, this determines the number of threads used to initialize the Oracle database on the disaster recovery site.

After the TimesTen database is copied to the disaster recovery system, the Oracle database tables are truncated and the data from the TimesTen Classic cache groups is copied to the Oracle database on the disaster recovery system.

Also see the TT_REPDUP_INITCACHEDR flag below.

localIP

const char*

A null-terminated string specifying the alias or IP address (IPv4 or IPv6) of the local network interface to use for the duplicate operation. Set this to NULL if you do not want to specify the local network interface, in which case any compatible interface may be used.

remoteIP

const char*

A null-terminated string specifying the alias or IP address (IPv4 or IPv6) of the remote network interface to use for the duplicate operation. Set this to NULL if you do not want to specify the remote network interface, in which case any compatible interface may be used.

Note: You can specify both localIP and remoteIP, or either one by itself, or neither.

crsManaged

int

For internal use

This should be set to 0 (default).

The ttRepDuplicateExArg flags element is constructed from these values:

Value Description

TT_REPDUP_NOFLAGS

Indicates no flags.

TT_REPDUP_COMPRESS

Enables compression of the data transmitted over the network for the duplicate operation.

TT_REPDUP_REPSTART

Directs ttRepDuplicateEx to set the replication state (with respect to the local database) in the remote database to the start state before the remote database is copied across the network. This ensures that all updates made after the duplicate operation are replicated from the remote database to the newly created or restored local database.

TT_REPDUP_RAMLOAD

Keeps the database in memory upon completion of the duplicate operation. It changes the RAM policy for the database to manual.

TT_REPDUP_DELXLA

Directs ttRepDuplicateEx to remove all the XLA bookmarks as part of the duplicate operation.

TT_REPDUP_NOKEEPCG

Do not preserve the cache group definitions; ttRepDuplicateEx converts all cache group tables into regular tables.

By default, cache group definitions are preserved.

TT_REPDUP_RECOVERINGNODE

Specifies that ttRepDuplicateEx is being used to recover a failed node for a replication scheme that has an AWT or autorefresh cache group. Do not specify TT_REPDUP_RECOVERINGNODE when rolling out a new or modified replication scheme to a node. If ttRepDuplicateEx cannot update metadata stored on the Oracle database and all incremental autorefresh cache groups are replicated, then updates to the metadata are automatically deferred until the cache and replication agents are started.

TT_REPDUP_DEFERCACHEUPDATE

Forces the deferral of changes to metadata stored on the Oracle database until the cache and replication agents are started and the agents can connect to the Oracle database. Using this option can cause a full autorefresh if some incremental cache groups are not replicated or if ttRepDuplicateEx is being used for rolling out a new or modified replication scheme to a node.

TT_REPDUP_INITCACHEDR

Initializes disaster recovery. You must also specify cacheuid and cachepwd in the data structure. Also see nThreads4initDR in the data structure.

See Also

ttRepAdmin -duplicate in Oracle TimesTen In-Memory Database Reference

The following built-in procedures are described in Built-In Procedures in Oracle TimesTen In-Memory Database Reference.

  • ttReplicationStatus
  • ttRepPolicySet
  • ttRepStop
  • ttRepSubscriberStateSet
  • ttRepSyncGet
  • ttRepSyncSet