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:

  1. 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.

  2. Apply the replication scheme to the master database. See Applying a Classic Replication Scheme to a Database.

  3. Start the replication agent for the master database. See Starting and Stopping the Replication Agents.

  4. 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;
  5. Assume the user name of the instance administrator is timesten. Logged in as timesten on the target host (the subscriber), duplicate database masterDSN on host1 to subscriber1DSN:

    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 of ttRepAdmin -duplicate. If you do not specify one or both network interfaces, TimesTen Classic chooses them.

    See ttRepAdmin in Oracle TimesTen In-Memory Database Reference.

  6. Start the replication agent on the subscriber database.