DB2 experience in data synchronization _DB2

Source: Internet
Author: User
Tags db2
The DB2 tutorial you're looking at is: DB2 data synchronization experience. Planning programme:
Assume that you will use a report-generating application. This application requires data that exists in the DEPARTMENT table of the SAMPLE database. Instead of using data that comes directly from the source table, you want to copy the changes to the target table that can only be read by the application that generated the report. For ease of administration, you save the target table on the same machine as the source table. It can also be another database on a network that has been cataloged as a local machine.
Data replication Scenario Implementation steps:
 Before starting
1. First determine that the DB2 has been installed on the machine on which the replication plan will be implemented, and an instance has been established.
2. Identify the source and target databases that you will be replicating to the user, either on the same machine or on the network, and need to be cataloged locally.
3. Determine that you have access to the source and destination databases. Suppose the source database is a sample library, and the target database is the Copydb library.
4. Set up the Copydb library on your machine.
Planning this Program
1. Copy Source
You already know that the copy source is the schema in the sample database. DEPARTMENT table. Before setting up your environment, you must decide what you want to copy from the table, and you decide to register all columns and subscribe to all columns.
2. Copy target
You decide that you want to replicate the target is a copydb database that was created before you started. Currently, there are no target tables in the database; you want the replication center to create a target table based on your specifications. This method of automatically generating the target table is preferable because it ensures that it is mapped correctly to the source of the replication. You can also use an existing target table, but this scenario assumes that the target table does not exist.
3. Replication Options
For the purposes of this scenario, you decide to store the CD table, the target table, and the Replication control table in their default table space, respectively. Although the SAMPLE and Copydb databases exist on the same machine, their table spaces are in different containers.


Setting up the environment for this project planning
Step 1: Create a control table for the capture program
The Capture program reads the current registration information from the Replication control table and stores its status in these tables. Any database that will act as the Capture control server must contain the Capture control table.
1. Open the Replication Center and expand the SQL Replication folder.
2. Expand the definition folder.
3. Right-click the Capture Control server folder and choose Create Capture Control Table-> fast. Alternatively, you can customize the Capture control table by choosing to create a Capture control table-> customization.
4. In the Select Server window, select the SAMPLE database. This database will be used as the Capture control server. Click OK.
5. In the Create control table-Quick-Server Information window, select the source that the supervisor uses to copy and capture changes to those sources. Then, click Next.
6. In the Create control table-Quick-Copy Details window, click Next. You do not need to change any of the information in this window.
7. In the Create control table-quick-tablespace window, enter the table space specification for the Tsasnca table space. For example, set the buffer pool to IBMDEFAULTBP. For this scenario, accept the default Capture mode-ASN.
8. In the Create control table-quick-tablespace window, enter the table space specification for the TSASNUOW table space.
9. After you enter information about the two tablespaces in the Create control table-quick-tablespace window, click OK.
10. Click Close on the Message dialog window. This window shows the results of the SQL script that will create the Capture control table. If any errors occur, these errors appear in this window.
11. Enter a valid user ID and password in the run Now or Save SQL window, and click OK to run the SQL script immediately.
12. You should see a message in the DB2 message window indicating that the script was successfully run. Click Close.
13. Expand the Capture Control server folder. The SAMPLE database should appear in this folder.
Step 2: Enable the database for replication
The Capture program reads the DB2 log to obtain a log record that includes changes to the registered table. The log must be an archive log so that DB2 will no longer use the log file until the Capture program can read the log. For UNIX (R) and Windows environments, the DB2 default is circular logging, so you must change this setting to archive logging.
Step 3: Register the replication source
After you have created the Capture control table and enabled the database for replication, register the DEPARTMENT table as the replication source.

This news total 3 pages, current in 1th page 1 2 3


<

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.