Steps for Replicating Using One-way Mirroring
Set up source database connection>Enable transactional replication>Set up target database connection>Create a target table>Define the Replication>Run the Replication |
One-way mirroring provides a continuous update of a replicated table based on changes to the source database that have been recorded in the database server log. Typically, this involves an initial refresh operation, as described above, to set up the target table. Then you can define the replication settings to check the transaction log on the source database at regular intervals. Any changes found in the log are applied to the target database.
1. Set Up Source Database Connection
-
Make sure you have database connections via a .NET data provider to the supported databases for source database tables and target database tables.
-
Start the Management Center.
Syniti Replicate provides a default database (Microsoft SQL Server CE) for your metadata, all the information that Syniti Replicate needs to store about your replication setup.
-
In the Metadata Explorer, expand the metadata node to view the Sources and Targets nodes.
-
Select the Sources node.
-
From the right mouse button menu, choose Add New Connection.
-
In the Add Source Connection Wizard, follow steps to add a connection string and test the connection to the database.
Check the Supported Provider List in the Help Center before entering a value in the Assembly field. -
In the Select Tables screen, choose the tables that you plan to replicate.
-
In the Actions screen, check the option Launch the Enable Transactional Setup Wizard.
-
Complete the wizard.
2. Enable Transactional Replication
This section assumes you have checked the Source Connection wizard option to launch the Enable Transactional Replication wizard. To open the wizard from the Management Center, choose the connection in the Metadata Explorer, then right-click to choose Transactional Setup > Enable...
In the Enable Transactional Replication wizard:
- Select the type of transactional replication to use.
The options depend on the source database and can include log
reader, log server agent, triggers, plus log reader API (for IBM
Db2 for i only)
- Click Next to
enter the log settings. The fields and appropriate values depend on
the database
and log type.
- Click Next to verify your settings against the source connection to the database. If any information is missing, you will not be able to proceed.
-
In the Actions screen, check the option to launch the Add Target Connection wizard.
-
Click Next to review your changes.
-
Click Finish to complete the wizard.
The source connection is now set up for transactional replications.
3. Set Up Target Database Connection
This section assumes you have checked the Enable
Transactional Replication wizard option to launch the Add Target
Connection wizard. If not, to open the wizard from the Management Center,
choose Targets in the Metadata
Explorer, then right-click to choose Add
New Connection...
-
In the Target Connection Wizard, follow steps to add a connection string and test the connection to the database. Check the Supported Provider List in the Help Center before entering a value in the Assembly field.
-
Choose the tables to which you plan to replicate.
If the table does not exist, continue to the next screen without selecting a table. Create a target table once the wizard is complete. -
Complete the wizard.
4. Create a Target Table
If the target table does not exist, use the Create Target Table wizard to create the table.
- In the Metadata Explorer, drag the source table to the
target connection to open the Create Target Table wizard.
The Select Source Connection screen is already filled out with the table you selected. -
In the Select Source Connection screen, the source table information has already been provided.
-
If you want more information about the table before proceeding, click Open Table....
-
The target connection details have been provided. Change the table name if needed.
-
Review the columns that will be created in the target table. You can add or remove columns as well as designate one or more columns as a primary key.
-
When you have finished editing the target table columns, click Next to go to the SQL Script screen.
-
If necessary, edit the SQL script that generates the table.
-
Click Next to display the Actions screen.
-
To create additional tables, check the Launch Create Target Table wizard option.
This opens another Create Target Table wizard when this wizard is complete. -
To go directly to creating a replication once this wizard is complete, check Launch Create Replication wizard option.
This opens the Replication wizard when the Create Target Table wizard is complete. -
Click Next to view a summary.
-
Click Finish to create the target table.
-
Note that the new table is not automatically displayed in the Metadata Explorer. Click Yes to add the newly created table to the list of target tables in the Metadata Explorer.
5. Define the Replication
This section assumes you have checked the Create Replication wizard option to launch the Create Replication wizard. If not, to open the wizard from the Management Center, choose the table you want to replicate in the Metadata Explorer, then right-click to choose Replication > Create New Replication...
-
In the Define Replication Type screen, type a name to identify the replication.
-
Optionally provide a description of the replication.
-
Choose the source name from the drop-down list that includes all the source connections you have created.
-
Choose the table that you want to replicate from the drop-down list.
-
If you want more information about the table before proceeding, click Open Table....
-
Click Next to go to the Source Log Info screen.
The first two fields on this screen depend on the source database you are using. In this explanation, we assume you are using IBM Db2 for i (iSeries or AS/400). Check the help for the Replication Wizard for details on the other databases.
The Journal field is automatically filled in by retrieving the information from Db2 for i. The Receiver field will be automatically filled in after setting the Transaction ID. You do not need to modify these fields. However, if the library that you have specified as a source is not journaled, you will need to ask your system administrator to journal the library. -
In the Transaction ID field, click Read to open the Read Point dialog.
-
Choose either the current transaction or a transaction ID based on a time and date.
-
Click OK to add the value to the Source Log Info screen.
-
Set the value of the Read Interval field to the frequency with which you want Syniti Replicate to check the transaction log for new events to mirror.
-
Choose a target source name from the drop-down list that includes all the target connections you have created.
-
Choose the table to which you want to replicate from the drop-down list.
If no tables are listed, you need to exit the wizard and add or create a target table. -
If you want more information about the table before proceeding, click Open Table....
-
Click Next to go to the Set Mapping Info screen.
Source and target columns with the same name are automatically mapped. You can also map columns by dragging the source column and dropping it on the target column, or you can map a column to an expression. For more information about mapping, check the Replication Wizard help topic. An alternative is to write a script to set mappings at runtime. -
Make sure the Enable Replication option is checked. This is required for the replication to run.
-
Set a start time for the replication. The Start Time field indicates the time at which the Replication Agent will begin considering the replication for execution.
-
Check the option to Execute Initial Refresh if needed.
If you check this option, a full replication will be performed from the source to the target table, prior to starting the mirroring process where only incremental changes will be replicated. -
Go to the Mirroring Schedule tab.
-
Select how you want to run the replication:
-
Run Continuously: the transaction log will be checked for changes to the table using the frequency that you specified on the Set Log Info tab. Any changes will be replicated to the target table.
-
Schedule Interruptions: the replication process will run as above, except for interruptions specified when you click the Add button in the Scheduler dialog.
-
-
Click Next to go to the Summary screen.
-
Click Finish to complete the wizard.
4. Run the Replication
If you installed The Replication Agent as a service during
setup, you just need to start the service using the Service Monitor
program in the Windows Notification
Area.
The replication that you have scheduled should start at the specified time. Use the Replication Monitor tab in the Management Center to track the progress of the replication.
If you would like to install the Replication Agent as a service:
-
From the Windows Desktop menu, choose Syniti Replicate, then Service Installer.
-
Manage the service from the Service Monitor program (located in the Windows Notification Area , or on the Windows menu under Syniti Replicate).
-
Use the Replication Monitor tab in the Management Center to track the progress of the replication.
To run the Replication Agent interactively:
-
In the Windows Notification Area, select the Service Monitor icon.
-
From the right mouse button menu, choose Replication Agent, then Start then Application.
The replication that you have scheduled should start at the specified time. -
Use the Replication Monitor tab in the Management Center to track the progress of the replication.