Kettle------Multi-table data replication

Source: Internet
Author: User
Requirements: The n tables in a library are extracted into B library, the table structure is the same or just add a uniform number of fields, filter conditions are basically similar.

Workaround:
We split the above into two steps to solve the problem.
1, the corresponding table name and filter condition are read from a preparation table, which is stored in a result.
2, according to the results of the first step, a loop to take the number of interpolation process.
The above process is fairly simple, and the following are the ways to implement the discussion.
1, if it is ORACLE with the character set, with the Dblink combined with stored procedures, write a common program is easy to handle, only need to create a table name and filter the conditions of the preparation table (here is not much to say).
2, with the ETL tool to achieve, as far as I know, take Infa as an example, it is the corresponding relationship with the field, and its internal circulation of the process is very difficult, once we have a project, Infa is abruptly painted one hundred or two hundred mapping (indeed, will not kill people, but looked quite uncomfortable, of course, welcome to provide a good plan) ,
Here, we take kettle as an example to analyze how to solve this problem (put aside the performance first, kettle is really a good thing)

1), the main flow is probably the following

Here, let's take a look at the contents of the first component (get multiple table names), and we'll take a look at the contents of the table name.
This SQL is just a simulation of a table name of the SQL, flexible to use, this component actually completes the table to be extracted into a result set.
Let's look at the second Component (table migration)
Is the process of taking a number of interpolation.
And take a look at their contents.

This is done, however, when the main job setting (table Migration) component is to loop through the previous contents when the following parameters are executed.

Basically is so, another, remember in each main flow and two conversion of all set Tt_tab this parameter.
Say so much, actually very simple. If you are doing database table replication, kettle has other ways to do this, depending on the tool-Wizard-Copy Table Wizard.
The above adaptation is, you can achieve some of the concatenation of SQL, and to increase the reduction of the table only need to maintain the configuration table, relatively will change the simple.

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.