Oracle produce synchronization intermediate Database

Source: Internet
Author: User

The oracle produce synchronization intermediate database is used as an Internet system on an existing system. Considering the server pressure or the absence of conditions, it can directly connect to the database of an existing system. You need to get an intermediate database to synchronize business data at a specific time. Note the Writing Method of SQL code INSERT INTO sy_api_c_meter (task_id, meter_id ,.....) SELECT in_task_id, meter_id ,.... FROM c_meter a, c_mp B, c_meter_mp_rela c WHERE. meter_id = c. meter_id AND B. mp_id = c. mp_id AND B. cons_id = v_cons_id AND B .org _ no = v_org_no the select query statement in the preceding SQL statement has no performance problems. The partition conditions AND indexes can all be taken up, but the insert statement will become very difficult when executed together. This is an error that occurs at the beginning of the write process. The cursor should be used. The Modification result is as follows: SQL code FOR cur IN (SELECT c. meter_id FROM c_mp B, c_meter_mp_rela c WHERE B. mp_id = c. mp_id AND B. cons_id = v_cons_id AND B .org _ no = v_org_no) LOOP INSERT INTO sy_api_c_meter (task_id, meter_id, inst_loc ,....) SELECT in_task_id, meter_id ,.... FROM c_meter a WHERE. meter_id = cur. meter_id; end loop; in actual operations, batch operations on table data are much faster.

Related Article

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.