ttRepAdmin
ttRepAdmin utility is also used when upgrading to a new release of TimesTen.Required Privilege
This utility requires the ADMIN privilege.
Usage in TimesTen Scaleout and TimesTen Classic
This utility is supported in TimesTen Classic but not supported in TimesTen Scaleout.
Syntax
ttRepAdmin {-h | -help | -?}
ttRepadmin {-V | -version}
ttRepAdmin -self -list [-scheme [owner.]schemeName]
{DSN | -connStr connection_string}
ttRepAdmin -receiver [-name receiverName]
[-host receiverHostName] [-state receiverState] [-reset]
[-list] [-scheme [owner.]schemeName]
{DSN | -connStr connection_string}
ttRepAdmin -log {DSN | -connStr connection_string}
ttRepAdmin -showstatus -detail {-awtmoninfo} {DSN | -connStr connection_string}
ttRepAdmin -showconfig {DSN | -connStr connection_string}
ttRepAdmin -bookmark {DSN | -connStr connection_string}
ttRepAdmin -wait [-name receiverName] [-host receiverHostName]
[-timeout seconds] {DSN | -connStr connection_string}
ttRepAdmin -duplicate -from srcDataStoreName
-host srcDataStoreHost
[-localIP localIPAddress] [-remoteIP remoteIPAddress]
[-setMasterRepStart | -noSetMasterRepStart] [-ramLoad] [-delXla]
[-UID userId] [-PWD pwd | -PWDCrypt encryptedPwd]
[-drop { [owner.]table ... | [owner.]sequence |ALL }]
[-truncate { [owner.]table ... | ALL }]
[-compression 0 | 1] [-bandwidthmax maxKbytesPerSec]
[ ( -activeDataGuard [-cacheUid cacheUid [-cachePwd cachePwd]]
| -initCacheDr [-cacheUid cacheUid [-cachePwd cachePwd]]
[-noDRTruncate] [-nThreads]
| ( -keepCG [-cacheUid cacheUid [-cachePwd cachePwd]]
( [-recoveringNode | -deferCacheUpdate] ))| -nokeepCG ) ]
[-remoteDaemonPort portNo] [-verbosity {0|1|2}]
[-localhost localHostName]
[-open | -close]
{destDSN | -connStr connection_string}ttRepAdmin Operations
Use the ttRepAdmin utility 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 |
|---|---|
|
|
Display help information. |
|
|
Display TimesTen version information. |
Database Information
Use this form of ttRepAdmin to obtain summary information about a database.
ttRepAdmin -self -list [-scheme [owner.]schemeName] {DSN | -connStr connection_string}
Options
ttRepAdmin has the options:
| Option | Description |
|---|---|
|
|
Data source name of a master or subscriber database. |
|
|
Connection string of a master or subscriber database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings. |
|
|
Specified database. |
|
|
Lists database name, host, port number, and bookmark position. |
|
- |
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 database my_dsn.
Subscriber Database Operations
Use this form of ttRepAdmin to check the status or reset the state of a subscriber (receiver) database.
ttRepAdmin -receiver [-name receiverName] [-host receiverHostName] [-state receiverState] [-reset] [-list] [-scheme [owner.]schemeName] {DSN | -connStr connection_string}
Options
ttRepAdmin -receiver has the options:
| Option | Description |
|---|---|
|
|
Data source name of the master database. |
|
|
Connection string of the master database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings. |
|
|
Subscriber databases receiving updates from the master. Use |
|
|
A specific subscriber (receiving) database. The |
|
|
Host name or TCP/IP address of the subscriber host. |
|
|
Sets the state of replication for the subscriber.
See Set the Replication State of Subscribers in Oracle TimesTen In-Memory Database Replication Guide for more information. |
|
|
Clears the bookmark in the master database 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 database is changed, such as when the database is re-created using |
|
|
Lists information about a replication definition. |
|
|
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 the subscribers of the master database, my_dsn.
% ttRepAdmin -receiver -name rep_dsn -list my_dsn
The above syntax lists replication information for the rep_dsn subscriber of the master database, 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 database. Should only be used when migrating a replicated database 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 database to the Start state with respect to the master database, my_dsn.
Duplicate a Database
Use this form of ttRepAdmin to create a new database with the same contents as the master database.
The following must be true for you to perform the ttRepAdmin -duplicate:
-
Only the instance administrator can run
ttRepAdmin -duplicate. -
The instance administrator must have the same operating system username on both source and target computer to run
ttRepAdmin -duplicate. -
You must provide the user name and password with the
-UIDand-PWDoptions for an internal user with theADMINprivilege on the source database. -
You must run
ttRepAdminon the target host. -
The DSN specified must be a direct-mode DSN, not a server DSN.
Before running the ttRepAdmin -duplicate command, use ttStatus to ensure the replication agent is started for the source database.
ttRepAdmin -duplicate -from srcDataStoreName -host srcDataStoreHost [-localIP localIPAddress] [-remoteIP remoteIPAddress] [-setMasterRepStart | -noSetMasterRepStart] [-ramLoad] [-delXla] -UID userId (-PWD pwd | -PWDCrypt encryptedPwd) [-drop { [owner.]table ... | [owner.]sequence |ALL }] [-truncate { [owner.]table ... | ALL }] [-compression 0 | 1] [-bandwidthmax maxKbytesPerSec] [ ( -activeDataGuard [-cacheUid cacheUid [-cachePwd cachePwd]] | -initCacheDr [-cacheUid cacheUid [-cachePwd cachePwd]] [-noDRTruncate] [-nThreads] | ( -keepCG [-cacheUid cacheUid [-cachePwd cachePwd]] ( [-recoveringNode | -deferCacheUpdate] ))| -nokeepCG ) ] [-remoteDaemonPort portNo] [-verbosity {0|1|2}] [-localhost localHostName] [-open | -close] {destDSN | -connStr connection_string}
Options
ttRepAdmin -duplicate has the options:
| Option | Description |
|---|---|
|
|
Closes a database to user connections. When a database is closed to user connections, new connection attempts will fail, but existing connections are unaffected. |
|
|
Specifies that the duplicate operation should not put more than |
|
|
Enables or disables compression during the duplicate operation. The default is |
|
|
Specifies the connection string of the destination database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings. |
|
|
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 database. |
|
|
Indicates the data source name of the destination database. |
|
|
Drops any tables or sequences that are copied as part of the |
|
|
Creates a duplicate of the specified database using replication to transmit the database contents across the network. See Duplicating a Database in Oracle TimesTen In-Memory Database Replication Guide. |
|
|
Used with |
|
|
Defines the host name or |
|
|
Initializes disaster recovery. Must provide the cache admin user id and password.
If no password is provided, |
|
|
If no password is provided, If you cannot connect to the Oracle database or the Oracle database is down, then specify the |
|
|
Use with |
|
|
Specifies the alias or IP ( |
|
|
Used with the |
|
|
Used with the |
|
|
Opens a database to user connections. A database is open to user connections by default upon creation. |
|
|
The password of the internal user specified in the |
|
|
The encrypted password of the user specified in the - |
|
|
Keeps the database in memory upon completion of the duplicate operation. This option avoids the /reload database cycle to improve the performance of the duplicate operation when copying large databases. After the duplicate option, RAM Policy for the database is set to |
|
|
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 |
|
|
Specifies the alias or IP ( |
|
|
This is on by default. When Set the |
|
|
Used with the |
|
|
Truncates any tables that are copied as part of the |
|
|
The user ID of a user having the |
|
|
Provide details of the communication steps within the duplicate process and reports progress information about the duplicate transfer.
|
Examples
Duplicating a Database
On the source database, create a user and grant the ADMIN privilege to the user:
CREATE USER sampleuser IDENTIFIED BY sampleuser; User created. GRANT admin TO sampleuser;
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 database on server1 to the ds2 database:
% ttRepAdmin -duplicate -from ds1 -host "server1"
-UID sampleuser -PWD sampleuser
-connStr "dsn=ds2;UID=sampleuser;PWD=sampleuser" Duplicating a Database with Cache Groups
Use the -keepCG option to keep cache group tables when you duplicate a database. 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 database dsn1 on host1:
% ttRepAdmin -duplicate -from dsn1 -host host1 -uid sampleuser -pwd sampleuser
-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 operating system 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=".
Setting the Replication State on the Source Database
The -setMasterRepStart option causes the replication state in the srcDataStoreName database to be set to the Start state before it is copied across the network and then keeps the database 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 database to the newly created or restored local database.
ttRepAdmin -duplicate -from srcDataStoreName -host srcDataStoreHost -setMasterRepStart -ramLoad -UID timesten_user -PWD timesten_user] -localhost localHostName [destDSN | -connStr connection_string ]
Notes
This utility can duplicate any temporary table definition in a database, but it does not replicate the contents of temporary tables.
You cannot use this utility to duplicate databases across major releases of TimesTen.
Wait for Updates to Complete
Use this form of ttRepAdmin to assure that all the updates in the log are replicated to all subscribers before call returns.
ttRepAdmin -wait [-name receiverName] [-host receiverHostName] [-timeout seconds] {DSN | -connStr connection_string}
Options
ttRepAdmin -wait has the options:
| Option | Description |
|---|---|
|
|
Indicates the data source name of the master database. |
|
|
Specifies the connection string of the master database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings. |
|
|
Waits for replication to become current before continuing. |
|
|
Identifies the database. The database name is the last component in the database path name. |
|
|
Defines the host name or TCP/IP address of the subscriber host. |
|
|
Specifies timeout value in seconds. |
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 database. 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 acknowledgment 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 database.
Replication Status
Use this form of ttRepAdmin to check the size of the transaction log files, bookmark position, or replication configuration of a master database.
ttRepAdmin -log {DSN | -connStr connection_string}
ttRepAdmin -showstatus -detail {-awtmoninfo} {DSN | -connStr connection_string}
ttRepAdmin -showconfig {DSN | -connStr connection_string}
ttRepAdmin -bookmark {DSN | -connStr connection_string}Options
The ttRepAdmin monitor operations have the options:
| Option | Description |
|---|---|
|
|
Indicates the data source name of the master database. |
|
|
If you have enabled monitoring for AWT cache groups by calling the If AWT monitoring is enabled,
|
|
|
Specifies the connection string of the master database, an ODBC connection string that specifies a database location, driver, and optionally other connection attribute settings. |
|
|
Indicates whether the replication agent transmitters and receivers are using TLS (indicated as SSL) |
|
|
Prints out number and size of transaction log files retained by replication to transmit updates to other databases. |
|
|
Lists the entire replication configuration. See Show the Configuration of Replicated Databases in Oracle TimesTen In-Memory Database Replication Guide Oracle TimesTen In-Memory Database Replication Guide for more information. |
|
|
Reports the current status of the specified replicated database. See Use ttRepAdmin to Show Replication Status in Oracle TimesTen In-Memory Database Replication Guide for more information. |
|
|
Reports the latest marker record from where replication must read the log, the most recently created log sequence number, and the latest log sequence number whose record has been flushed to disk. Bookmarks are not supported if you have configured parallel replication. See Show Replicated Log Records in Oracle TimesTen In-Memory Database 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.
-
TimesTen processing time: The total number of milliseconds spent in processing AWT transaction data since monitoring was enabled.
-
Oracle bookmark time: The total number of milliseconds spent in managing AWT metadata on Oracle since monitoring was enabled.
-
Oracle execute time: The total number of milliseconds spent in OCI preparation, binding and execution for AWT SQL operations since monitoring was enabled. This statistic includes network latency between TimesTen and the Oracle database.
-
Oracle commit time: The total number of milliseconds spent in committing AWT updates on Oracle since monitoring was enabled. This statistic includes network latency between TimesTen and the Oracle database.
-
Time since monitoring was started.
-
Total number of TimesTen row operations: The total number of rows updated in AWT cache groups since monitoring was enabled.
-
Total number of TimesTen transactions: The total number of transactions in AWT cache groups since monitoring was enabled.
-
Total number of flushes to Oracle: The total number of times that TimesTen data has been sent to the Oracle database.
The output also includes the percentage of time spent on TimesTen processing, Oracle bookmark, Oracle execution and Oracle commits.
See Use ttRepAdmin to Show Replication Status in Oracle TimesTen In-Memory Database Replication Guide for more information.
Examples
% ttRepAdmin -log DSN
The above syntax reports the number of transaction log files that replication is retaining to transmit updates to other databases. The replication agent retains a transaction log file until all updates in that transaction log file have been successfully transferred to each subscriber database.
% 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 database for the specified DSN. The output includes the state of all the threads in the replication agents for the replicated databases, bookmark locations, port numbers, and communication protocols.
For example, consider how to use the ttRepAdmin -showstatus utility to display status for a unidirectional replication scheme from the rep1 database to the rep2 database.
The first ttRepAdmin -showstatus output shows the status of the rep1 database and its TRANSMITTER thread. The second output shows the status of the rep2 database and its RECEIVER thread.
% ttRepAdmin -showstatus rep1
DSN : rep1
Process ID : 1980
Replication Agent Policy : MANUAL
Host : MYHOST
RepListener Port : 1113 (AUTO)
Last write LSN : 0.1487928
Last LSN forced to disk : 0.1487928
Replication hold LSN : 0.1486640
Replication Peers:
Name : rep2
Host : MYHOST
Port : 1154 (AUTO)
Replication State : STARTED
Communication Protocol : 12
TRANSMITTER thread(s):
For : rep2
Start/Restart count : 2
Send LSN : 0.1485960
Transactions sent : 3
Total packets sent : 10
Tick packets sent : 3
MIN sent packet size : 48
MAX sent packet size : 460
AVG sent packet size : 167
Last packet sent at : 17:41:05
Total Packets received: 9
MIN rcvd packet size : 48
MAX rcvd packet size : 68
AVG rcvd packet size : 59
Last packet rcvd'd at : 17:41:05
Earlier errors (max 5):
TT16060 in transmitter.c (line 3590) at 17:40:41 on 08-25-2004
TT16122 in transmitter.c (line 2424) at 17:40:41 on 08-25-2004
The replication status for the rep2 database should look similar to the following:
> ttRepAdmin -showstatus rep2 DSN : rep2 Process ID : 2192 Replication Agent Policy : MANUAL Host : MYHOST RepListener Port : 1154 (AUTO) Last write LSN : 0.416464 Last LSN forced to disk : 0.416464 Replication hold LSN : -1.-1 Replication Peers: Name : rep1 Host : MYHOST Port : 0 (AUTO) Replication State : STARTED Communication Protocol : 12 RECEIVER thread(s): For : rep1 Start/Restart count : 1 Transactions received : 0 Total packets sent : 20 Tick packets sent : 0 MIN sent packet size : 48 MAX sent packet size : 68 AVG sent packet size : 66 Last packet sent at : 17:49:51 Total Packets received: 20 MIN rcvd packet size : 48 MAX rcvd packet size : 125 AVG rcvd packet size : 52 Last packet rcvd'd at : 17:49:51
% 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 database1
[other -showstatus output]
...
AWT Monitoring statistics
--------------------------
TimesTen processing time : 0.689000 millisecs (0.164307 %)
Oracle bookmark 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 database.
Using SQL configuration, you can create multiple replication schemes in the same database. 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 databases with the same name on different hosts, you can indicate which database you want 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 Replication Guide.
- For upgrade examples, see Upgrades in TimesTen Classic in Oracle TimesTen In-Memory Database Installation, Migration, and Upgrade Guide.