Skip Headers
Oracle® TimesTen In-Memory Database Reference
Release 11.2.1

Part Number E13069-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

ttRepAdmin

Description

Displays existing replication definitions and monitors replication status. The ttRepAdmin utility is also used when upgrading to a new release of TimesTen, as described in Oracle TimesTen In-Memory Database Installation Guide.

Required privilege

This utility requires the ADMIN privilege.

Syntax

ttRepAdmin {-h | -help | -?}
ttRepadmin {-V | -version}
ttRepAdmin -self -list [-scheme [owner.]schemeName] {DSN | -connStr connectionString}

ttRepAdmin -receiver [-name receiverName]
      [-host receiverHostName] [-state receiverState] [-reset]
      [-list] [-scheme [owner.]schemeName]
      {DSN | -connStr connectionString} 

ttRepAdmin -log {DSN | -connStr connectionString}

ttRepAdmin -showstatus -awtmonifo {DSN | -connStr connectionString}

ttRepAdmin -showconfig {DSN | -connStr connectionString}

ttRepAdmin -bookmark {DSN | -connStr connectionString}

ttRepAdmin -wait [-name receiverName] [-host receiverHostName] 
      [-timeout seconds] {DSN | -connStr connectionString}

ttRepAdmin -duplicate -from srcDataStoreName
      -host srcDataStoreHost
      [-setMasterRepStart] [-ramLoad] [-delXla]
      [-UID userId] [-PWD pwd | -PWDCrypt encryptedPwd]
      [-drop { [owner.]table ... | [owner.]sequence |ALL }]
      [-truncate { [owner.]table ... | ALL }]
      [-compression 0 | 1] [-bandwidthmax maxKbytesPerSec]
      [-initCacheDr [-noDRTruncate]]
      [-keepCG [-cacheUid cacheUid [-cachePwd cachePwd]] 
         [-recoveringNode | -deferCacheUpdate]
      | -nokeepCG]
      [-remoteDaemonPort portNo] [-verbosity {0|1|2}]
      [-localhost localHostName]
      {destDSN | -connStr connectionString}

ttRepAdmin operations

The ttRepAdmin utility is used for many replication operations. These operations fall into the following categories:


Help and version information

Use this form of ttRepAdmin to obtain help and the current version of TimesTen.

ttRepAdmin {-h | -help | -?}
ttRepadmin {-V | -version}
Option Description
-h

-help

-?

Display help information.
-V | -version Display TimesTen version information.


Data store information

Use this form of ttRepAdmin to obtain summary information about a data store.

ttRepAdmin -self -list [-scheme [owner.]schemeName]
{DSN | -connStr connectionString}

Options

ttRepAdmin -self -list has the options:

Option Description
DSN Data source name of a master or subscriber data store.
-connStr connection_string Connection string of a master or subscriber data store.
-self Specified data store.
-list Lists data store name, host, port number, and bookmark position.
-scheme [owner.]schemeName] Name of replication scheme when there is more than one scheme.

Examples

ttRepAdmin -self -list my_dsn

The above syntax prints out information about the replication definition of the data store my_dsn.


Subscriber data store operations

Use this form of ttRepAdmin to check the status or reset the state of a subscriber (receiver) data store.

ttRepAdmin -receiver [-name receiverName]
[-host receiverHostName] 
       [-state receiverState] [-reset]
       [-list] [-scheme [owner.]schemeName]
       {DSN | -connStr connectionString}

Options

ttRepAdmin -receiver has the options:

Option Description
DSN Data source name of the master data store.
-connStr connection_string Connection string of the master data store.
-receiver Subscriber data stores receiving updates from the master. Use -name and -host to specify a specific subscriber data store.
-name receiverName A specific subscriber (receiving) data store. The receiverName is the last component in the data store path name.
-host receiverHostName Hostname or TCP/IP address of the subscriber host machine.
-state start

-state stop

-state pause

Sets the state of replication for the subscriber.
  • start - Starts replication to the subscriber (default).

  • stop - Stops replication to the subscriber, discarding updates.

  • pause - Pauses the replication agent, preserving updates.

See "Setting the replication state of subscribers" in the Oracle TimesTen In-Memory Database TimesTen to TimesTen Replication Guide for more information.

-reset Clears the bookmark in the master data store log for the latest transaction to be sent to a given subscriber. This option should only be used when the transaction numbering of the master data store is changed, such as when the data store is re-created using ttMigrate or ttBackup. If the master data store is saved and restored using ttBackup and ttRestore, transaction numbering is preserved and this option should not be used.
-list Lists information about a replication definition.
-scheme [owner.]schemeName] Specifies the replication scheme name when there is more than one scheme.

Examples

ttRepAdmin -receiver -list my_dsn

The above syntax lists replication information for all of the subscribers of the master data store, my_dsn.

ttRepAdmin -receiver -name rep_dsn -list my_dsn

The above syntax lists replication information for the rep_dsn subscriber of the master data store, my_dsn.

ttRepAdmin -receiver -name rep_dsn -reset my_dsn

The above syntax resets the replication bookmark with respect to the rep_dsn subscriber of the master data store. Should only be used when migrating a replicated data store with ttMigrate or ttBulkCp.

ttRepAdmin -receiver -name rep_dsn -state Start my_dsn

The above syntax resets the replication state of the rep_dsn subscriber data store to the Start state with respect to the master data store, my_dsn.


Duplicate a data store

Use this form of ttRepAdmin to create a new data store with the same contents as the master data store.

The following must be true for you to perform the ttRepAdmin -duplicate:

Before running the ttRepAdmin -duplicate command, use ttStatus to be sure that the replication agent is started for the source data store.

ttRepAdmin -duplicate -from srcDataStoreName
       -host srcDataStoreHost
      [-setMasterRepStart] [-ramLoad] [-delXla]
      -UID userId (-PWD pwd | -PWDCrypt encryptedPwd)
      [-drop { [owner.]table ... | [owner.]sequence |ALL }]
      [-truncate { [owner.]table ... | ALL }]
      [-compression 0 | 1] [-bandwidthmax maxKbytesPerSec]
      [-initCacheDr [-noDRTruncate]]
      [-keepCG [-cacheUid cacheUid [-cachePwd cachePwd]] 
      [-recoveringNode | -deferCacheUpdate]
      |-nokeepCG]
      [-remoteDaemonPort portNo] [-verbosity {0|1|2}]
      [-localhost localHostName]
      {destDSN | -connStr connectionString}

Options

ttRepAdmin -duplicate has the options:

Option Description
-bandwidthmax maxKbytesPerSec Specifies that the duplicate operation should not put more than maxKbytesPerSec KB of data per second onto the network. A value of 0 indicates that there should be no bandwidth limitation. The default is 0. The maximum is 9999999.
-compression 0 | 1 Enables or disables compression during the duplicate operation. The default is 0 (disabled).
-connStr connection_string Specifies the connection string of the destination data store.
-delXla Removes all the XLA bookmarks as part of the duplicate operation. Use this option if you do not want to copy the bookmarks to the duplicate data store.
destDSN Indicates the data source name of the destination data store.
-drop {[owner.]table ... |[owner.]sequence |ALL Drops any tables or sequences that are copied as part of the -duplicate operation but which are not included in the replication scheme. The option is ignored if the table is a cache group table.
-duplicate Creates a duplicate of the specified data store using replication to transmit the data store contents across the network. See "Duplicating a data store" in Oracle TimesTen In-Memory Database TimesTen to TimesTen Replication Guide.
-from srcDataStoreName Used with -duplicate to specify the name of the sender (or master) data store. The srcDataStoreName is the last component in the data store path name.
-host srcDataStoreName Defines the hostname or TCP/IP address of the sender (or master) data store.
-initCacheDr Initializes disaster recovery. Must be used with -cacheUid and -cachePwd options.
-keepCG [-cacheUid cacheUid -cachePwd cachePwd] [-recoveringNode | -deferCacheUpdate] | -noKeepCG -keepCG and -noKeepCG specify whether tables in cache groups should be maintained as cache group tables or converted to regular tables in the target data store. The default is -noKeepCG.

cacheUid is the cache administration user ID.

cachePwd is the password for the cache administrator user.

If no password is provided, ttRepAdmin prompts for a password.

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

-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 of the incremental cache groups are not replicated or if -duplicate is being used for rolling out a new or modified replication scheme to a node.

-localhost hostName Can be used with -duplicate and-setMasterRepStart to explicitly identify the name or IP address of the local host.
-noDRTruncate Used with the -initCacheDr option, -noDRTruncate disables truncation of Oracle tables during the initial rollout process for the remote subscriber on the Disaster Recovery site. When –noDRTruncate is specified, TimesTen does not truncate the Oracle database tables that correspond to the asynchronous writethrough cache group tables in an active standby pair replication scheme.
-PWD pwd The password of the user specified in the -UID option.
-PWDCrypt encryptedPwd The encrypted password of the user specified in the -UID option.
-ramLoad Keeps the data store in memory upon completion of the duplicate operation. This option avoids the unload/reload data store cycle to improve the performance of the duplicate operation when copying large data stores. After the duplicate option, the RAM Policy for the data store is set to "manual." Use the ttAdmin utility to make further changes to the RAM policy.
-remoteDaemonPort portNo The port number of the remote main daemon.

The port number supplied as an argument to this option is used unless the value is zero. In that case the default behavior to determine the port number is used.

The -remoteDaemonPort option cannot be used to duplicate data stores that have stores which use automatic port configuration.

-setMasterRepStart When used with -duplicate, this option sets the replication state for the newly created data store to the Start state just before the data store is copied across the network. This ensures that all updates made to the source data store after the duplicate operation are replicated to the newly duplicated local data store. Any unnecessary transaction log files for the data store are removed.
-truncate [owner.]table ...| ALL Truncates any tables that are copied as part of the -duplicate operation but which are not included in the replication scheme. The option is ignored if the table is a cache group table.
-UID userid The user ID of a user having the ADMIN privilege on the source database must be supplied.
-verbosity {0 | 1 | 2} Provide details of the communication steps within the duplicate process and reports progress information about the duplicate transfer.

0 - No diagnostics are returned (default).

1 - Reports details of the duplicate parameters to stdout.

2 - Reports details of the duplicate parameters and details of the duplicate transfer operation to stdout.


Examples

Example 3-1 Duplicating a data store

On the source data store, create a user and grant the ADMIN privilege to the user:

CREATE USER ttuser IDENTIFIED BY ttuser;
User created.

GRANT admin TO ttuser;

The instance administrator must have the same user name on both instances involved in the duplication. Logged in as the instance administrator, duplicate the ds1 data store on server1 to the ds2 data store:

ttRepAdmin -duplicate -from ds1 -host "server1" 
           -UID ttuser -PWD ttuser
           -connStr "dsn=ds2;UID=ttuser;PWD=ttuser" 

Example 3-2 Duplicating a data store with cache groups

Use the -keepCG option to keep cache group tables when you duplicate a data store. Specify the cache administration user ID and password with the -cacheuid and -cachepwd options. If you do not provide the cache administration user password, ttRepAdmin prompts for a password.

If the cache administration user ID is orauser and the password is orapwd, duplicate data store dsn1 on host1:

ttRepAdmin -duplicate -from dsn1 -host host1 -uid ttuser -pwd ttuser -keepCG -cacheuid orauser -cacheuid orapwd "DSN=dsn2;UID=;PWD="

The UID and PWD for dsn2 are specified as null values in the connection string so that the connection is made as the current OS user, which is the instance administrator. Only the instance administrator can run ttRepAdmin -duplicate. If dsn2 is configured with PWDCrypt instead of PWD, then the connection string should be "DSN=dsn2;UID=;PWDCrypt=".

Example 3-3 Setting the replication state on the source data store

The -setMasterRepStart option causes the replication state in the srcDataStoreName data store to be set to the Start state before it is copied across the network and then keeps the data store in memory. It ensures that any updates made to the master after the duplicate operation has started are copied to the subscriber.

You can use the -localhost option to identify the local host by host name or IP address. These options ensure that all updates made after the duplicate operation are replicated from the remote data store to the newly created or restored local data store.

ttRepAdmin -duplicate -from srcDataStoreName -host srcDataStoreHost
        -setMasterRepStart -ramLoad
        -UID timesten_user -PWD timesten_user]
        -localhost localHostName 
        [destDSN | -connStr connectionString ]

Notes

This utility can duplicate any temporary table definition in a data store, but it does not replicate the contents of temporary tables.

You cannot use this utility to duplicate data stores across major releases of TimesTen.


Wait for updates to complete

Use this form of ttRepAdmin to assure that all of the updates in the log are replicated to all subscribers before call returns.

ttRepAdmin -wait [-name receiverName] [-host receiverHostName]
[-timeout seconds] {DSN | -connStr connectionString} 

Options

ttRepAdmin -wait has the options:

Option Description
DSN Indicates the data source name of the master data store.
-connStr connection_string Specifies the connection string of the master data store.
-wait Waits for replication to become current before continuing.
-name receiverName Identifies the data store. The data store name is the last component in the data store path name.
-host receiverHostName Defines the hostname or TCP/IP address of the subscriber host machine.
-timeout seconds Specifies timeout value in seconds. ttRepAdmin returns within this amount of time, even if all updates to subscribers have not been completed.

Examples

ttRepAdmin -wait -name receiverName -host receiverHostName
-timeout seconds -dsn DSN 

The above syntax provides a way to ensure that all updates, committed at the time this program was invoked, have been transmitted to the subscriber, receiverName, and the subscriber has acknowledged that all those updates have been durably committed at the subscriber data store. The timeout in seconds limits the wait.

Note:

If ttRepAdmin -wait is invoked after all write transaction activity is quiesced at a store (there are no active transactions and no transactions have started), it may take 60 seconds or more before the subscriber sends the acknowledgement that all updates have been durably committed at the subscriber.
ttRepAdmin -wait -dsn DSN

In the above syntax, if no timeout and no subscriber name are specified, ttRepAdmin does not return until all updates committed at the time this program was invoked have been transmitted to all subscribers and all subscribers have acknowledged that all those updates have been durably committed at the subscriber data store.


Replication status

Use this form of ttRepAdmin to check the size of the transaction log files, bookmark position, or replication configuration of a master data store.

ttRepAdmin -log {DSN | -connStr connectionString}
ttRepAdmin -showstatus {-awtmonifo] {DSN | -connStr connectionString}
ttRepAdmin -showconfig {DSN | -connStr connectionString}
ttRepAdmin -bookmark {DSN | -connStr connectionString}

Options

The ttRepAdmin monitor operations have the options:

Option Description
DSN Indicates the data source name of the master data store.
-awtmoninfo If you have enabled monitoring for AWT cache groups by calling the ttCacheAwtMonitorConfig procedure, you can display the monitoring results by using the this option.

If AWT monitoring is enabled, ttrepadmin -awtmoninfo displays the output:

  • TimesTen processing time: The total number of milliseconds spent in processing AWT transaction data since monitoring was enabled.

  • Oracle bookmark management time: The total number of milliseconds spent in managing AWT metadata on Oracle since monitoring was enabled.

-connStr connection_string Specifies the connection string of the master data store.
-log Prints out number and size of transaction log files retained by replication to transmit updates to other data stores.
-showconfig Lists the entire replication configuration.

See "Show configuration of replicated data stores" in the Oracle TimesTen In-Memory Database TimesTen to TimesTen Replication Guide for more information.

-showstatus Reports the current status of the specified replicated data store.

See "Show replication status" in the Oracle TimesTen In-Memory Database TimesTen to TimesTen Replication Guide for more information.

-bookmark Reports the latest marker record from where replication needs to read the log, the most recently created log sequence number, and the latest log sequence number whose record has been flushed to disk.

See "Show replicated log records" in the Oracle TimesTen In-Memory Database TimesTen to TimesTen Replication Guide for more information.


Result set

If AWT monitoring is enabled, this utility displays the following information in addition to other ttRepAdmin -showstatus output:

The output also includes the percentage of time spent on TimesTen processing, Oracle bookmark management, Oracle execution and Oracle commits.

Examples

ttRepAdmin -log DSN

The above syntax reports the number of transaction log files that replication is retaining to transmit updates to other data stores. The replication agent retains a transaction log file until all updates in that transaction log file have been successfully transferred to each subscriber data store.

ttRepAdmin -showconfig DSN

The above syntax reports the entire replication configuration. It lists all the subscribers for the specified DSN, the names and details of the tables being replicated, and all the subscriptions.

ttRepAdmin -showstatus DSN

The above syntax reports the current state of the data store for the specified DSN. The output includes the state of all of the threads in the replication agents for the replicated data stores, bookmark locations, port numbers, and communication protocols.

ttRepAdmin -bookmark DSN

The above syntax prints out the log sequence numbers of the earliest log record still needed by replication, the last log record written to disk, and the last log record generated.

ttRepAdmin -showstatus -awtmoninfo myDSN

[other -showstatus output]
...
AWT Monitoring statistics
--------------------------
TimesTen processing time : 0.689000 millisecs (0.164307 %)   Oracle bookmark management time : 3.229000 millisecs (0.770027%)   Oracle execute time : 342.908000 millisecs (81.774043 %)   Oracle commit time : 72.450000 millisecs (17.277315 %)   Time since monitoring was started: 8528.641000 millisecs   Cache-connect Operational Stats :      Total Number of TimesTen row operations : 2      Total Number of TimesTen transactions : 2      Total Number of flushes to Oracle : 2

The above syntax and output shows the AWT monitoring status.

Notes

The ttRepAdmin utility is supported only for TimesTen Data Manager DSNs. It is not supported for TimesTen Client DSNs.

You must use the -scheme option when specifying more than one replication scheme, or when more than one scheme exists involving the specified data store.

Using SQL configuration, you can create multiple replication schemes in the same data store. If there is only one replication scheme, the ttRepAdmin utility automatically determines the scheme. If there is more than one scheme, you must use the ttRepAdmin -scheme option to specify which scheme to use.

When configuring replication for data stores with the same name on different hosts, you can indicate which data store you wish to operate on by using -host. For example, if all the subscribers have the name DATA, you can set the replication state on host SW1 with:

ttRepAdmin -receiver -name DATA -host SW1 -state start DSN

See also

For a full description of TimesTen Replication, see Oracle TimesTen In-Memory Database TimesTen to TimesTen Replication Guide.

For upgrade examples, see "Data Store Upgrades" in Oracle TimesTen In-Memory Database Installation Guide.