Duplicating a Master Database to a Subscriber
The simplest method for populating a subscriber database is to duplicate the contents of the master database.
Duplicating a database in this manner is also essential when
recovering a failed database, as described in Managing Database Failover and Recovery. You can use the
ttRepAdmin
-duplicate
utility or the ttRepDuplicateEx
C function to duplicate a database.
To duplicate a database, these conditions must be fulfilled:
-
The instance administrator performs the duplicate operation.
-
The instance administrator user name must be the same on both instances involved in the duplication.
-
You must provide the user name and password for a user with the
ADMIN
privilege on the source database. -
The target DSN cannot include client/server attributes.
Note:
Enable the Preallocate
attribute to ensure that there is sufficient
space for the new database. See Preallocate in the Oracle TimesTen In-Memory Database
Reference.
To duplicate the contents of a master database to a subscriber database, complete these tasks:
-
Create or alter a replication scheme to include the new subscriber database and its host. See Defining a Classic Replication Scheme or Creating and Adding a Subscriber Database to a Classic Replication Scheme.
-
Apply the replication scheme to the master database. See Applying a Classic Replication Scheme to a Database.
-
Start the replication agent for the master database. See Starting and Stopping the Replication Agents.
-
On the source database (the master), create a user and grant the
ADMIN
privilege to the user:CREATE USER ttuser IDENTIFIED BY ttuser; User created. GRANT admin TO ttuser;
-
Assume the user name of the instance administrator is
timesten
. Logged in astimesten
on the target host (the subscriber), duplicate databasemasterDSN
onhost1
tosubscriber1DSN
:ttRepAdmin -duplicate -from masterDSN -host host1 subscriber1DSN Enter internal UID at the remote datastore with ADMIN privileges: ttuser Enter password of the internal Uid at the remote datastore:
Enter
ttuser
when prompted for the password of the internal user at the remote database.Note:
The host entry can be identified with either the name of the remote host or its TCP/IP address. If you identify hosts using TCP/IP addresses, you must identify the address of the local host (
host1
in this example) by using the-localhost
option.You can specify the local and remote network interfaces for the source and target hosts by using the
-localIP
and-remoteIP
options ofttRepAdmin -duplicate
. If you do not specify one or both network interfaces, TimesTen Classic chooses them.See ttRepAdmin in Oracle TimesTen In-Memory Database Reference.
-
Start the replication agent on the subscriber database.