Method, system and computer program for loading data into a target database system

The method for data synchronization in database systems using load and replication programs with a trigger mechanism addresses the challenge of controlling data loading time, enhancing performance by optimizing data access speed and accuracy.

JP2024539861AActive Publication Date: 2024-10-31INTERNATIONAL BUSINESS MACHINE CORPORATION
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2024521373
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Priority Date
2021-11-17
Filing Date
2022-11-15
Publication Date
2024-10-31
Estimated Expiration
2042-11-15

AI Technical Summary

Technical Problem

Controlling the time required for data loading in database systems is a challenging task, which affects the overall performance of the database system.

Method used

A method for data synchronization between a source and target database system using load and replication programs, with a query view that selects records based on partition IDs, and a trigger mechanism to switch between different modes of operation for the replication program based on the completion of update execution.

Benefits of technology

This approach optimizes data loading by balancing data access speed and accuracy, reducing replication latency while ensuring consistent data access before and after partition completion.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024539861000001_ABST
    Figure 2024539861000001_ABST
Patent Text Reader

Abstract

The method includes identifying a query view of the target database system that enables access to the first source table stored in the first target table; executing a load program for a current version of the first source partition of the first source table, where executing the load program includes loading the first source partition into a second load target partition of the first target table; modifying the query view to select records of the first target table; executing an update program to assign records of the first replication target partition to the first load target partition; selecting an operation mode for the replication program based on determining whether execution of the update program has finished; running the replication program in accordance with the selected operation mode; and modifying the query view to further select records of the first replication target partition.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to the field of digital computer systems, and more particularly to a method for loading data into a target database system using different synchronization programs.

[0002] Data loading is one of the most frequently performed operations in a database system. Improving data loading can improve the overall performance of a database system. However, controlling the time it takes to perform such data loading can be a difficult task. Summary of the Invention

[0003] Various embodiments provide a method for loading data into a target database system using different synchronization programs, computer systems and computer program products as described by the subject matter of the independent claims. Advantageous embodiments are described in the dependent claims. The embodiments of the invention may be freely combined with one another if they are not mutually exclusive.

[0004] As disclosed herein, a computer-implemented method for synchronizing data between a source database system and a target database system includes identifying a query view in the target database system that provides access to a final version of a first source table stored in a first target table, the query view being configured to select records of the first target table, the first target table having a first load target partition with a first load partition ID and a first replication target partition with a first replication partition ID; and executing a load program for a current version of the first source partition of the first source table, the executing the load program loading the first source partition into a second load target partition of the first target table. the second load target partition having a second load partition ID, executing, modifying the query view to select records of the first target table having the second load partition ID, executing an update program to assign records of the first replication target partition to the first load target partition, determining whether execution of the update program has finished in response to receiving a replication request for one or more current records of the first source partition of the first source table, selecting an operation mode of the replication program based at least in part on determining whether execution of the update program has finished, executing the replication program in accordance with the selected operation mode, and modifying the query view to further select records of the first replication target partition. Also disclosed are computer program products and computer systems corresponding to the methods. [Brief description of the drawings]

[0005] [Figure 1] 1 is a diagram of a data analysis system in accordance with an example of the present subject matter.

[0006] [Diagram 2] 1 is a flowchart of a method for loading data into a target database system according to an example of the present subject matter.

[0007] [Figure 3A] 1 illustrates a transition of content between a source database system and a target database system in accordance with an example of the present subject matter. [Figure 3B] 1 illustrates a transition of content between a source database system and a target database system in accordance with an example of the present subject matter. [Figure 3C] 1 illustrates a transition of content between a source database system and a target database system in accordance with an example of the present subject matter. [Figure 3D] 1 illustrates a transition of content between a source database system and a target database system in accordance with an example of the present subject matter. [Figure 3E] 1 illustrates a transition of content between a source database system and a target database system in accordance with an example of the present subject matter. [Figure 3F] 1 illustrates a transition of content between a source database system and a target database system in accordance with an example of the present subject matter. [Figure 3G] 1 illustrates a transition of content between a source database system and a target database system in accordance with an example of the present subject matter.

[0008] [Figure 4] 4 is a flowchart of a method for executing a replication program according to a second operation mode.

[0009] [Diagram 5] 4 is a flowchart of a method for executing a replication program according to a second operation mode.

[0010] [Figure 6] FIG. 1 is a representation of a computerized system suitable for implementing one or more method steps involved in the subject matter of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0011] The description of various embodiments of the present invention is presented for illustrative purposes, but is not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, practical applications, or technical improvements to the technology found in the market, or to enable other skilled in the art to understand the embodiments disclosed herein.

[0012] The data analysis system includes a source database system and a target database system. The data analysis system may be, for example, a data warehousing system or a master data management system. The data analysis system may enable data warehousing, or master data management, or another technique using a source database system and a target database system, the target database system comprising a target database configured to receive / include a copy of the contents of the corresponding source database of the source database system. The source database system may be, for example, a transaction engine and the target database system may be an analytical engine. For example, the source database system may be an online transaction processing (OLTP) system and the target database system may be an online analytical processing (OLAP) system. The source database system may include a source dataset and the target database system may include a target dataset. The source dataset may be part of the source database and the target dataset may be part of the target database. The source dataset and the target dataset may be stored in the same format or in different formats. The formats may differ, such as encryption, compression, row-oriented or column-oriented storage, etc. For example, a source dataset may be stored in a row-oriented format and a target dataset may be stored in a column-oriented format (in other words, the target dataset may be stored in "columns" instead of "rows"). The contents of the source dataset may be modified by one or more database transactions.

[0013] A source table consists of one or more partitions, called source partitions, SP1…SP Nwhere N >= 1. A source table can be partitioned horizontally, which allows a complete row to be placed in a specific partition. Each source partition can contain a respective set of rows from the source table. Each source partition of a source table can have an identifier (ID) called source partition ID. The same type of source partition ID may be used for source partitions. Source partitions SP1…SP N For example,

number

number

number

number

number

number

[0014] However, to avoid data inconsistencies in the target table, the load program may treat the rows replicated by the replication program specially to perform a new load of the data, which can be achieved by executing an update program (for example, UPDATE SQL statement) to assign the load partition ID assigned at the end of the last bulk load to the replication target partition in the target table.

[0015] Therefore, synchronization between a source table and a target table involves the execution of three programs: a replication program, a load program, and an update program. As a result, the contents of at least one source partition of a source table may be stored in two target partitions, each with a load partition ID and a replication partition ID. The execution of the load program loads the entire source partition into the target partition with that load partition ID, and then the replication program can be executed against that source partition to replicate the records of the source partition into the target partition with the replication partition ID.

[0016] Therefore, at the current time t0, each source partition SP1…SP N A record may be stored in at least one of the target partitions. For example, K source partitions SP1…SP K Each source partition in is associated with two target partitions, each with a replication partition ID and a load partition ID, where K≦N. That is, the load program is executed followed by the replication program execution for these K source partitions. For example, each source partition SP i (where i=1,…K) are M target partitions TP1…TP M Replication (R) and Load (L) target partitions

number

number

number

number

number

number

[0017] But at a later time t1, you run the load program again and load the source partitions of the source table SP1…SP N Load each target partition of the target table

number

number

number

number

number

number

number

number

[0018] For example, after the execution of the load program at time t1, the source partitions SP1…SP K One or more source partitions of SP1…SP JIf one or more records (called changed records) in J source partitions SP1…SP2 are changed or inserted in the source partition, the replication program J (where 1≦J≦K). To do this, we need to determine whether the update program has finished. The end of the update program means that there are K replication target partitions.

number

number

number

number

number

[0019] The subject matter of the present invention can provide visibility to partitions that are already fully loaded while ensuring correct results for queries running simultaneously before and after the partition is completed. Replication latency may be reduced. Thus, the subject matter of the present invention can enable efficient execution of synchronization based on the timing of execution of the above three programs.

[0020] According to one embodiment, J source partitions SP1...SP J Load the records into each target partition

number

number

[0021] According to one embodiment, each load target partition

number

[0022] A replication program may be run against a replication view. In one example, the replication view is separate from the query view. In one example, the replication view may be a query view such that a replication program is run against the query view.

[0023] According to one embodiment, modifying the query view further includes deselecting the first load partition ID and the first replication partition ID, and running the replication program according to a default operating mode is performed after the query that uses the first modified query view has finished.

[0024] According to one embodiment, the load partition ID is greater than the replication partition ID, and the query view includes a selection of records having IDs less than the maximum load partition ID of the load partition ID.

[0025] FIG. 1 is a block diagram of a data analysis system 100 according to an example of the inventive subject matter. The data analysis system 100 may be configured for data synchronization between a source database system 101 and a target database system 103 according to an example of the inventive subject matter. The source database system 101 may be, for example, an online transaction processing (OLTP) system. The target database system 103 may be, for example, an online analytical processing (OLAP) system. The source database system 101 and the target database system 103 may be connected via a network, such as a fixed wireless network, a wireless local area network (WLAN), a wireless wide area network (WWAN), a personal area network (PAN), a virtual private network (VPN), an intranet, or other suitable network system. For example, communication between the source database system 101 and the target database system 103 may be performed via a TCP / IP communication layer.

[0026] A source database system 101 is comprised of one or more source tables 105 of a source database and a transaction recovery log 106. The source tables 105 may be relational tables of any number of database systems. Entries or log records in the transaction recovery log 106 describe changes to rows or records of the source tables 105 in the source database system 101. FIG. 1 illustrates example contents of a log record 130. The log record 130 may include a timestamp, a log record sequence number (LRSN), and attribute changes. More specifically, a log record in the transaction recovery log 106 may include information defining, for example, (1) the table being modified, (2) the values ​​of key columns of the row being modified, (3) the old and new values ​​of all columns of the modified row, and (4) the transaction (unit of work) that caused the change. By definition, an insert is a new data record and therefore does not have an old value. With a delete change, there is no new data record, only the old data record. Thus, a transaction log record for an inserted row may contain only new column values, and a transaction log record for a deleted row may contain only old column values. A transaction log record for an updated row may contain the old and new values ​​of all columns. The order of log records in the transaction recovery log may reflect the order of the modifying operations in a transaction, and the order of transaction commit records may reflect the order in which the transactions were completed. The type of row operation in a transaction log record may be, for example, delete, insert, or update.

[0027] The source database system 101 includes a log reader 104. The log reader 104 may read log records of the transaction recovery log 106 and provide changed records to a replication program 108 of the target database system 103. The log reader 104 may be configured to perform log shipping of the transaction recovery log 106 to the target database system 103 based on an incremental update strategy. This shipping may be performed, for example, by sending a stream of log records formed from the log records of the transaction recovery log 106 to the replication program 108. The shipped log stream may be associated, for example, with a stream ID. The stream of log records may be, for example, a stream of merged log records. This may enable efficient processing of the log records at the target database system. The target database system 103 may be equipped with a log streaming interface for receiving the log stream from the source database system 101. A replication program 108 may be configured to receive the stream of log records via a log streaming interface. The replication program 108 can apply the changes indicated in the change records to a target table 113 that corresponds to the source table 105 where the changes originated.

[0028] In another example, a bulk load may be performed of an entire partition of a source table 105. To that end, the target database system 103 includes a load program 110 that receives the partition to be loaded and loads it into a target table 113 that corresponds to the source table 105.

[0029] FIG. 2 is a flow chart of a method for data synchronization in a data analysis system. For convenience of explanation, the method illustrated in FIG. 2 may be implemented in the system illustrated in FIG. 1, but is not limited to this implementation. The method of FIG. 2 may be performed, for example, by a target database system 103. The synchronization may be described, for example, with reference to a source table and a corresponding target table. The transition of the contents of the target table is illustrated in FIG. 3A-FIG. 3G. FIG. 3A shows the initial state of the source table and the target table. The source table is a table of N source partitions SP1...SP2, and the target table is a table of N source partitions SP3...SP4, and the target table is a table of N source partitions SP5...SP6, and the target table is a table of N source partitions SP7...SP8, and the target table is a table of N source partitions SP9...SP10, and the target table is a table of N source partitions SP1...SP11. N The target table contains M target partitions. Each source partition SP1…SP N The records of K source partitions SP1…SP2 are stored in at least one of the target partitions. For example, K Each source partition SP i (where i=1,…K) are the replication (R) and load (L) target partitions of M target partitions.

number

number

number

number

number

number

number

[0030] After the initial state shown in Figure 3A, n source partitions SP1…SP N For example, a load program can be executed in step 201. The load program loads n source partitions SP1…SP N , respectively,

number

number

number

number

[0031] The update is available under ID

number

number

number

[0032] K J J

[0033] J i

[0034]

[0035] J J

[0036] ( J

[0037]

[0038]

[0039] <replication-view>AS SELECT * FROM <target-table>WHERE

number

number

[0040] A replication program may include an insert command to insert modified records into a replication view. For example, an insert command may be an SQL INSERT statement into a replication view such as the following: INSERT INTO <replication-view>

number

number

number

[0041] The method may further allow switching between the default mode of operation and the second mode of operation. To that end, a trigger, such as a temporary INSTEAD OF trigger, may be defined for the replication view in step 401. The trigger may be a database object that is associated with the replication view and that fires when a replication program is started while the update program is not yet finished. The trigger may only be needed while the update program is not yet completed. As soon as the update program is finished and committed, the trigger can be dropped. Thus, there is no negative impact on performance in the long term. Furthermore, there may be no performance impact on queries, since the trigger is only present on the replication-specific view, which may not be used for queries. An INSTEAD OF trigger may be defined, for example, as follows: CREATE TRIGGER <trigger-name>INSTEADOF INSERT ON <replication-view> REFERENCING NEW AS n FOR EACH ROW SET n.partitionID = CASE n.partitionID WHEN

数

数

[0042] The execution of the replication program in step 403 may include executing an insert command defined for the replication view. While the update program is not yet finished, the replication program may be executed according to a second operation mode using triggers. The target database system may receive an insert command, for example an SQL INSERT statement. The target database system may parse the insert command and compile it into some internal representation. During this phase, the target database system may check the existence of a replication view. The target database system may further check, for example, whether the user executing the insert command has the necessary privileges. In addition, the target database system may learn about triggers on the replication view. The triggers are therefore compiled into the internal representation of the statement. In particular, this compilation of the statement into the internal representation may lead to the inclusion of the above-mentioned additional SET statement of the trigger. Then, when the internal representation is processed, the value to be inserted is first retrieved, then the SET statement (originally from the trigger) is processed, and finally the value is inserted into the target table, i.e. the base table on which the replication view is built. Thus, in the second operation mode, the replication program may check the identity of the replication view.

number

number

number

number

number

number

number

[0043] 5 is a flow chart of a method for executing a replication program according to a second mode of operation. The method of FIG. 5 provides an example implementation of step 215 of FIG. 2. For purposes of illustration, the method described in FIG. 5 is implemented in the system illustrated in FIG. 1, but is not limited to this implementation. The method of FIG. 5 may be performed, for example, by the target database system 103. A replication view may be defined for the target table as illustrated in FIG. 3B as follows: CREATE VIEW <replication-view>AS SELECT * FROM <target-table> WHERE

number

number

[0044] The method of Figure 5 illustrates an alternative approach to the method of Figure 4. No triggers are used for the replication views. Instead, in step 501, each J source partition SP1...SP J Each changed record is sent to the staging table by its ID.

number

[0045] In step 503, the replication view definition can be modified to cover the staging table as follows: CREATE VIEW <replication-view>AS SELECT * FROM <target-table> WHERE

number

number

[0046] A staging table can be used to hold all the newly replicated rows for the partition that has just been reloaded. Source Partition ID

number

number

[0047] The query view in Eq(2) can also be adapted to cover a staging table, just like a replication view. This may make the newly replicated rows available to new queries. The view definition allows the database system to know the partition IDs.

number

number

[0048] After the update is complete, the use of the staging table can be phased out to restore normal replication and the default operation mode. This may require moving all rows from the staging table to the target table. INSERT / DELETE statements can be used in combination because all other techniques (using multiple SQL statements) may give inaccurate results for queries that run simultaneously. INSERT INTO <target-table> SELECT CASE ID WHEN

Number

Number

[0049] The data movement due to the INSERT / DELETE described above does not affect the partition ID because the moved rows are filtered by the WHERE clause of the replication view.

number

number

number

number

[0050] FIG. 6 illustrates a general computerized system 600 suitable for implementing at least some of the method steps involved in the present disclosure.

[0051] It should be appreciated that the methods described herein are at least partially non-interactive and automated by computerized systems such as servers and embedded systems. However, in exemplary embodiments, the methods described herein can be implemented in (partially) interactive systems. These methods can further be implemented in software 612, 622 (including firmware 622), hardware (processor) 605, or a combination thereof. In exemplary embodiments, the methods described herein are implemented in software as executable programs and executed by specialized or general-purpose digital computers such as personal computers, workstations, minicomputers, or mainframe computers. Thus, in the most general case, system 600 includes a general-purpose computer 601.

[0052] In an exemplary embodiment, from a hardware architecture perspective, as shown in FIG. 6, a computer 601 includes a processor 605, a memory (main memory) 610 coupled to a memory controller 615, and one or more input or output (I / O) devices (or peripherals) 10, 645, or both communicatively coupled via a local input / output controller 635. The input / output controller 635 can be, but is not limited to, one or more buses or other wired or wireless connections, as known in the art. The input / output controller 635 can have additional elements omitted for simplicity, such as controllers, buffers (caches), drivers, repeaters, and receivers, to enable communication. Additionally, the local interface can include address, control, or data connections, or combinations thereof, to enable appropriate communication between the aforementioned components. As described herein, the I / O devices 10, 645 can generally include generalized crypto cards or smart cards, as known in the art.

[0053] The processor 605 is a hardware device for executing software, particularly software stored in the memory 610. The processor 605 may be a custom-made or commercially available processor, a central processing unit (CPU), a coprocessor among multiple processors associated with the computer 601, a semiconductor-based microprocessor (in the form of a microchip or chipset), or generally any device for executing software instructions. The processor 605 may be, for example, a multi-core processor.

[0054] The memory 610 may include any one or combination of volatile memory elements (e.g., random access memory (RAM, such as DRAM, SRAM, SDRAM, etc.)) and non-volatile memory elements (e.g., ROM, erasable programmable read only memory (EPROM), electronically erasable programmable read only memory (EEPROM), programmable read only memory (PROM). It should be noted that the memory 610 may have a distributed architecture where various components are remote from each other but accessible by the processor 605.

[0055] The software in memory 610 may include one or more separate programs, each of which includes an ordered enumeration of executable instructions for implementing logical functions, particularly functions involved in embodiments of the present invention. In the example of Figure 6, the software in memory 610 includes instructions 612 for managing a database, such as a database management system.

[0056] The software in memory 610 also typically includes a suitable operating system (OS) 411. The OS 611 essentially controls the execution of other computer programs, possibly including software 612 for implementing the methods described herein.

[0057] The methods described herein may be in the form of a source program, an executable program (object code), a script, or any other entity consisting of a set of instructions 612 to be executed. In the case of a source program, the program must be translated via a compiler, assembler, interpreter, etc., to run properly with respect to the OS 611, which may or may not be contained within the memory 610. Furthermore, the methods may be described as an object-oriented programming language with classes and methods for data, or a procedural programming language with routines, subroutines, or functions, or a combination thereof.

[0058] In an exemplary embodiment, a conventional keyboard 650 and mouse 655 may be coupled to the input / output controller 635. Other output devices, such as I / O device 645, may include, but are not limited to, input devices, such as, for example, a printer, a scanner, a microphone, and the like. Finally, the I / O device 10, 645 may further include devices that communicate both input and output, such as, but are not limited to, a network interface card (NIC) (for accessing other files, devices, systems, or networks) or a modulator / demodulator (for accessing other files, devices, systems, or networks), a radio frequency (RF) or other transceiver, a telephone interface, a bridge, a router, and the like. The I / O device 10, 645 may be a common cryptographic card or a smart card known in the art. The system 600 may further include a display controller 625 coupled to the display 630. In an exemplary embodiment, the system 600 may further include a network interface for coupling to a network 665. The network 665 may be an IP-based network for communicating between the computer 601 and any external servers, clients, and the like over a broadband connection. The network 665 transmits and receives data between the computer 601 and the external systems 30, which may be involved in performing some or all of the steps of the methods described herein. In an exemplary embodiment, the network 665 may be a managed IP network operated by a service provider. The network 665 may be implemented in a wireless manner, for example, using wireless protocols and technologies such as WiFi, WiMax, etc. The network 665 may also be a packet-switched network, such as a local area network, a wide area network, a metropolitan area network, an Internet network, or other similar type of network environment.The network 665 may be a fixed wireless network, a wireless local area network (WLAN), a wireless wide area network (WWAN), a personal area network (PAN), a virtual private network (VPN), an intranet, or other suitable network system and includes equipment for transmitting and receiving signals.

[0059] If computer 601 is a PC, workstation, intelligent device, etc., the software in memory 610 may further include a basic input output system (BIOS). The BIOS is a set of basic software routines that initializes and tests hardware at power-up, starts the OS 611, and supports the transfer of data between hardware devices. The BIOS is stored in ROM so that the BIOS can be executed when computer 601 powers up.

[0060] When computer 601 is operating, processor 605 is configured to execute software 612 stored in memory 610, to communicate data to and from memory 610, and to generally control the operation of computer 601 in accordance with the software. The methods and OS 611 described herein, in whole or in part, typically the latter, are read by processor 605, possibly buffered within processor 605, and then executed.

[0061] As shown in FIG. 6, when the systems and methods described herein are implemented in software 612, the methods can be stored in any computer-readable medium, such as storage 620, for use by or in connection with any computer-related system or method. Storage 620 can include disk storage, such as HDD storage. For example, program code implementing the methods can reside on one or more computer-readable storage media. System 600 includes, for example, target database system 103 or source database system 101. The computer program code / methods can be executed / performed, for example, on one or more processors, particularly processors of different systems, such as the source database system and the target database system. The one or more processors can receive the program code / method elements as instructions.

[0062] The present invention may be a system, a method, or a computer program product, or a combination thereof, in any possible level of integration of technical detail. The computer program product may include one or more computer readable storage media having computer readable program instructions for causing a processor to perform aspects of the present invention. As used herein, a "processor" encompasses a program or machine executable instructions, or an electronic component capable of executing computer executable code. A processor may be, for example, a multi-core processor. A processor may also refer to a collection of processors within a single computer system or distributed among multiple computer systems. The computer executable code may be executed by multiple processors within the same computing device or may be distributed across multiple computing devices.

[0063] A computer readable storage medium may be a tangible device capable of holding and storing instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of computer readable storage media includes: portable computer diskettes, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards or grooved structures on which instructions are recorded, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium should not be construed as a transitory signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses passing through a fiber optic cable), or electrical signals transmitted over electrical wires.

[0064] The computer readable program instructions described herein may be downloaded from a computer readable storage medium to an individual computing / processing device or to an external computer or storage device over a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network may comprise copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, or edge servers, or a combination thereof. A network adapter card or network interface of each computing / processing device receives the computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the individual computing / processing device.

[0065] The computer readable program instructions for carrying out the operations of the present invention may be either source code or object code written in any combination of one or more programming languages, including assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state configuration data, configuration data for integrated circuits, or object oriented programming languages ​​such as Smalltalk®, C++, and procedural programming languages ​​such as the “C” programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partly on the user's computer as a standalone software package, partly on the user's computer and partly on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or wide area network (WAN), or the connection may be made to an external computer (e.g., via the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) can execute computer readable program instructions to individualize the electronic circuitry by utilizing state information of the computer readable program instructions to perform aspects of the invention.

[0066] Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, are implemented by computer readable program instructions.

[0067] These computer readable program instructions may be provided to a processor of a computer or other programmable data processing apparatus to produce a machine, such that the instructions, which execute on the processor of the computer or other programmable data processing apparatus, create means for implementing the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams. These computer readable program instructions may also be stored on a computer readable storage medium having instructions stored thereon to instruct a computer, programmable data processing apparatus, or other device, or combination thereof, to function in a particular manner, such that the computer readable storage medium having the instructions stored thereon comprises an article of manufacture including instructions for implementing aspects of the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.

[0068] The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause the computer, other programmable apparatus, or other device to perform a series of operable steps to create a computer-implemented process such that the instructions, which execute on the computer, other programmable apparatus, or other device, implement the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams.

[0069] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowcharts or block diagrams may represent a module, segment, or portion of instructions, including one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions shown in the blocks may occur out of the order shown in the figures. For example, two blocks shown in succession may actually be performed as one step, or may be executed simultaneously, substantially simultaneously, partially or fully in a time-overlapping manner, or the blocks may sometimes be executed in reverse order depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowchart illustrations, and combinations of blocks in the block diagrams and / or flowchart illustrations, are implemented by a special-purpose hardware-based system that performs the specified functions or actions or executes a combination of special-purpose hardware and computer instructions. SET [number] where [number]. The resulting target table after the execution of the update program is finished is shown in Figure 3C. In this figure, for example, the load target partition associated with source partition SP1 contains contents [number] and [number]. A replication request can be received in step 207. The replication request contains one or more modified records of one or more source partitions SP1…SP of K source partitions SP1…SP, where 1≦J≦K for the modified or inserted ones. This may require running a replication program on such J source partitions SP1…SP. To that end, step 209 includes determining whether the execution of the update program is finished (step 209). If the execution of the update program is finished, then in step 211, a replication program can be executed according to the default operation mode to copy the modified records of J source partitions SP1…SP to the respective replication target partitions with ID [number]. The resulting status of the target table is shown in Figure 3D. The contents of the modified records of source partitions SP (where i=1,..J) are denoted by [number]. Again, the query view of expression Eq(2) may be modified or updated in step 213 to the current contents of the target table, indicated by version number v1, as shown in FIG. 3D. The modification may be performed to cancel the deselection of ID [number], so that the query view becomes: [number]. The query view may be updated, for example, before the start of replication program execution. The replication program execution may start after the query that is still running against the query view of expression Eq(2) is completed. The replication program may, for example, include an insert command to insert the modified record into the replication view, which is the query of the view of expression Eq(3).FIG. 3D shows the status of the target table after the replication program has finished, and the update program has finished before the replication program has started. FIG. 3C shows the status of the target table after the update program has finished and before the replication program has started. If the execution of the update program has not yet finished, in step 215, the replication program can be executed according to the second operating mode to copy the modified records of the J source partitions SP1…SP (directly or indirectly) to the load target partitions having IDs [number]. However, the replication of the records of the J source partitions SP1…SP may or may not finish before the update program has finished. FIG. 3E and FIG. 3F show the status of the target table of FIG. 3B if the replication has not finished by the end of the update program. FIG. 3E shows the intermediate state of the target table, and FIG. 3F shows the final state of the target table. FIG. 3E shows the status of the target table after the execution of the update program and after the replication has been performed according to the second operating mode. FIG. 3F shows the status of the target table after the execution of the update program and after the replication has been performed according to both the default operating mode and the second operating mode. Figure 3G shows the status of the target table if the replication is not completed by the end of the update program. For example, consider the case where the update program ends without the replication program running according to the second operating mode being completed, i.e. only a part of the target partition (e.g. F target partition [number]) is copied to the respective load target partition with ID [number] before the end of the update program. In this case, when the update program is completed, the replication program reverts to the default operating mode and can copy the remaining change records of source partition SPF+1)…SP to the replication target partition with ID [number].The resulting target table is shown in Figure 3F. In this case, the query view of formula Eq(2) can be updated to obtain the query view of formula Eq(3) to select the records of version v1 of the target table of Figure 3F, and the newly inserted rows by the replication program according to the default operating mode are visible. If the execution of the replication program finishes according to the second operating mode before the update program is finished, the J target partitions [number] have been copied to the respective load target partitions with ID [number]. The resulting target table is shown in Figure 3G. In this case, the query view of formula Eq(2) can still be used, but to select the records of version v1 of the target table of Figure 3G. As mentioned above, the execution of the replication program may or may not require a change to the (initial) query view of formula Eq(2). If the query view of formula Eq(2) has to be adapted, the replication program can start only after all queries still running against the query view of formula Eq(2) have completed. 4 is a flow chart of a method for executing a replication program according to a second mode of operation. The method of FIG. 4 provides an example implementation of step 215 of FIG. 2. For purposes of illustration, the method described in FIG. 4 is implemented in the system illustrated in FIG. 1, but is not limited to this implementation. The method of FIG. 4 may be performed, for example, by the target database system 103. A replication view may be defined for the target table of FIG. 3B as follows: CREATE VIEW.

Claims

1. 1. A computer-implemented method for data synchronization between a source database system and a target database system, the method comprising: identifying a query view of the target database system that provides access to a final version of a first source table stored in a first target table, the query view being configured to select records of the first target table, the first target table having a first load target partition with a first load partition ID and a first replication target partition with a first replication partition ID; executing a load program for a current version of a first source partition of the first source table, the executing the load program including loading the first source partition into a second load target partition of the first target table, the second load target partition having a second load partition ID; modifying the query view to select records of the first target table having the second load partition ID; executing an update program to assign records of the first replication target partition to the first load target partition; determining whether the execution of the update program has finished in response to receiving a replication request for one or more current records of the first source partition of the first source table; selecting an operating mode of a replication program based at least in part on determining whether said execution of said update program has completed; executing the replication program in accordance with the selected mode of operation; and modifying the query view to further select the records of the first replication target partition.

2. 2. The computer-implemented method of claim 1, wherein selecting the operational mode of the replication program comprises selecting a default operational mode that copies the record to the first replication target partition in response to determining that the execution of the update program has finished.

3. The replication program executes the replication process according to the default mode of operation. Copying the changed records of the source partition; and and associating the source partition with one or more load target partitions and replication target partitions.

4. 4. The computer-implemented method of claim 1, wherein the target database system includes a first target table associated with the first source table of the source database system, the first source table includes at least one source partition, a current version of the source partition is stored in the first load target partition, the first replication target partition of the first target table uses the load program and the replication program, respectively, and the first load target partition has a unique first load partition ID and a unique first replication partition ID.

5. 5. The computer-implemented method of claim 2, further comprising providing a replication view including the query view, the replication program including an insert command for the replication view to insert the record, and wherein executing the replication program according to the default operating mode is performed by modifying the replication view.

6. 6. The computer-implemented method of claim 1, wherein selecting the operating mode of the replication program comprises selecting an alternative operating mode for copying the record to a given target partition of the first target table in response to determining that the update program is not finished.

7. 7. The computer-implemented method of claim 6, wherein the given partition is the second load target partition.

8. executing the replication program according to the alternative mode of operation to copy the record to the given target partition; storing the record in a staging table distinct from the first target table; and modifying the query view to further select the records of the staging table.

9. Verifying that the update program has finished; and The computer-implemented method of claim 1 , further comprising: moving the staging table to the given partition of the first target table.

10. 10. The computer-implemented method of claim 6, wherein the given partition is different from the second load partition or the first load target partition or both, the method further comprising modifying the query view to further select the records of the given partition.

11. executing the replication program according to the alternative mode of operation to copy the record to the second load target partition; 11. The computer-implemented method of claim 6, further comprising: implementing a trigger to switch from a default mode of operation of the replication program to the alternate mode of operation, the trigger comprising an SQL INSTEAD OF trigger that skips the copying of the record to the first replication target partition and executes another command defined in the trigger to copy the record to the second load target partition, the trigger being invoked in response to determining that the update program has not finished.

12. Verifying that the update program has finished; and Deleting the trigger; and and completing the execution of the replication program according to the default mode of operation.

13. 13. The computer-implemented method of claim 1, wherein modifying the query view further comprises deselecting the first load partition ID and the first replication partition ID, and wherein running the replication program according to the selected operating mode is performed after a query using the initially modified query view has finished.

14. 14. The computer-implemented method of claim 1, wherein the query view includes a selection of records having an ID less than a maximum load partition ID of the load partition ID.

15. The loading program comprises:

15. The computer-implemented method of claim 1, configured to load one or more distinct versions of a source partition of a source table of a source database system into distinct target partitions of a corresponding target table of a target database system, each distinct target partition having a unique load partition ID.

16. 1. A computer program product for data synchronization between a source database system and a target database system, said computer program product comprising: one or more computer readable storage media; and program instructions stored on the one or more computer readable storage media, the program instructions comprising: identifying a query view of the target database system that provides access to a final version of a first source table stored in a first target table, the query view being configured to select records of the first target table, the first target table having a first load target partition with a first load partition ID and a first replication target partition with a first replication partition ID; executing a load program for a current version of a first source partition of the first source table, the executing the load program including loading the first source partition into a second load target partition of the first target table, the second load target partition having a second load partition ID; modifying the query view to select records of the first target table having the second load partition ID; executing an update program to assign records of the first replication target partition to the first load target partition; determining whether the execution of the update program has finished in response to receiving a replication request for one or more current records of the first source partition of the first source table; selecting an operating mode of a replication program based at least in part on determining whether said execution of said update program has completed; executing the replication program in accordance with the selected mode of operation; and modifying the query view to further select the records of the first replication target partition. A computer program product comprising said program instructions.

17. 17. The computer program product of claim 16, wherein the instructions for selecting the operating mode of the replication program comprise instructions for selecting an alternate operating mode for copying the record to a given target partition of the first target table in response to determining that the update program is not finished.

18. 18. The computer program product of claim 16 or 17, wherein the instructions for selecting the operational mode of the replication program comprise instructions for selecting a default operational mode that copies the record to the first replication target partition in response to determining that the execution of the update program has finished.

19. 1. A computer system comprising: one or more computer processors; one or more computer readable storage media; program instructions stored on the computer-readable storage medium for execution by at least one of the one or more processors, the program instructions comprising: identifying a query view of the target database system that provides access to a final version of a first source table stored in a first target table, the query view being configured to select records of the first target table, the first target table having a first load target partition with a first load partition ID and a first replication target partition with a first replication partition ID; executing a load program for a current version of a first source partition of the first source table, the executing the load program including loading the first source partition into a second load target partition of the first target table, the second load target partition having a second load partition ID; modifying the query view to select records of the first target table having the second load partition ID; executing an update program to assign records of the first replication target partition to the first load target partition; determining whether the execution of the update program has finished in response to receiving a replication request for one or more current records of the first source partition of the first source table; selecting an operating mode of a replication program based at least in part on determining whether said execution of said update program has completed; executing the replication program in accordance with the selected mode of operation; and modifying the query view to further select the records of the first replication target partition. A computer system including said program instructions.

20. 20. The computer system of claim 19, wherein the instructions for selecting the operating mode of the replication program comprise instructions for selecting an alternate operating mode for copying the record to a given target partition of the first target table in response to determining that the update program is not finished.

Citation Information

Patent Citations

  • Method and system of performing incremental SQL server database backups

    EP2474909A2

  • Data recording system

    JP1999194964A

  • Backup method, system therefor, and restoration method

    JP2004341840A

  • Exclusive control method and information processor

    JP2006277634A

  • Method and system for executing increment SQL server database backup

    JP2012146301A