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.