WO2014153940A1 - 处理数据库重做数据的方法和装置 - Google Patents
处理数据库重做数据的方法和装置 Download PDFInfo
- Publication number
- WO2014153940A1 WO2014153940A1 PCT/CN2013/084687 CN2013084687W WO2014153940A1 WO 2014153940 A1 WO2014153940 A1 WO 2014153940A1 CN 2013084687 W CN2013084687 W CN 2013084687W WO 2014153940 A1 WO2014153940 A1 WO 2014153940A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- queue
- redo
- data
- application thread
- timing
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 230000004048 modification Effects 0.000 description 7
- 238000012986 modification Methods 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 2
- 230000011664 signaling Effects 0.000 description 2
- 208000000044 Amnesia Diseases 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 231100000863 loss of memory Toxicity 0.000 description 1
- 230000014759 maintenance of location Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1415—Saving, restoring, recovering or retrying at system level
- G06F11/1435—Saving, restoring, recovering or retrying at system level using file system or storage system metadata
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1464—Management of the backup or restore process for networked environments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1471—Saving, restoring, recovering or retrying involving logging of persistent data for recovery
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2308—Concurrency control
- G06F16/2336—Pessimistic concurrency control approaches, e.g. locking or multiple versions without time stamps
- G06F16/2343—Locking methods, e.g. distributed locking or locking implementation details
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
- G06F16/2358—Change logging, detection, and notification
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/80—Database-specific techniques
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/825—Indexing scheme relating to error detection, to error correction, and to monitoring the problem or solution involving locking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2201/00—Indexing scheme relating to error detection, to error correction, and to monitoring
- G06F2201/84—Using snapshots, i.e. a logical point-in-time copy of the data
Definitions
- the present invention relates to the field of communication network technologies, and in particular, to a method and apparatus for processing database redo data.
- the redo log is an important guarantee for data reliability in database operations, providing more data security than file systems.
- the basic principle is that when the database modification operation is submitted, the data is not immediately written to the data file of the disk, but is stored in the memory, so that each time the database update request is written to the data file, thereby improving the database. Updated performance; and generate redo data according to the modification operation (redo da ta) and write to disk to become redo log, to avoid data loss due to loss of memory data in case of failure.
- redo da ta redo data according to the modification operation
- the data can be recovered through a persistent redo log.
- the database provides access methods for multi-threaded concurrent processing.
- multiple threads can access the database concurrently
- multiple redo data needs to be cached in the redo queue and then written to the disk before being written to the disk.
- redo data because of the time-limited limitation of redo data, when multiple threads copy redo data into the redo queue, it needs to guarantee the timing within the global redo queue lock protection scope, that is, each time the redo data is written, it needs to preempt the redo. Do a time-consuming copy of the data after the queue lock.
- Embodiments of the present invention provide a method and apparatus for processing database redo data, which are used to improve processing performance of redo data.
- an embodiment of the present invention provides a method for processing database redo data, which is applied to a server, where the server runs a data reading thread and a plurality of application threads, and the multiple application threads are concurrent.
- the method modifies the database, the method includes: generating, by each application thread, the redo data according to the operation of modifying the database, and saving the redo data to the cache allocated for each application thread.
- the identifier of the application thread is saved to the timing queue, and the timing queue lock is released after the saving is completed; the data reading thread determines that the data reading condition is satisfied, and reads the application thread from the timing queue.
- the order of the identifiers is sequentially read from the cache of the application thread corresponding to the identifier of the application thread in the timing queue, and a redo data is written into the redo queue.
- the data reading condition is that a predetermined time period is reached, or the length of the timing queue reaches a predetermined value, or the amount of cached data of the application thread reaches a predetermined value.
- the user sequentially reads one from a cache of an application thread corresponding to an identifier of an application thread in the timing queue Before the redo data is written into the redo queue, the method further includes: obtaining a queue lock of the redo queue to obtain write permission to the redo queue; and sequentially, corresponding to the identifier of the application thread in the time series queue After reading a redo data into the redo queue in the cache of the application thread, the method further includes releasing the queue lock of the redo queue.
- the redo queue After reading a redo data in the cache, the redo queue is also included in the cache of the timed queue, and a redo data is read into the redo queue before the redo queue is written to the tail element of the time series queue. Add a read end identifier.
- the method further includes: applying the thread from the timing queue
- the second aspect of the rewritable data is written in the cache of the corresponding application thread.
- the embodiment of the present invention provides a server for processing database redo data, where the server runs multiple application threads. The plurality of application threads modify the database in a concurrent manner, the server comprising:
- a timing queue processing unit configured to repair each application thread in the plurality of application threads
- the operation of changing the database generates redo data, and saves the redo data to the cache allocated for each application thread, and saves the identifier of the application thread to the redo queue after obtaining the timing queue lock. unit;
- the redo queue processing unit is configured to receive the timing queue from the timing queue processing unit, and after determining that the data reading condition is satisfied, read an order of the identifier of the application thread from the timing queue, A redo data is written into the redo queue from the cache of the application thread corresponding to the identifier of the application thread in the sequence queue.
- the determining, by the redo queue processing unit, that the data read condition is met specifically includes: determining, by the redo queue processing unit, that a predetermined time period or a length of the time series queue is reached A predetermined value is reached or the amount of cached data of the thread reaches a predetermined value.
- the redo queue processing unit is further configured to: sequentially apply from the timing queue The thread of the application thread corresponding to the application thread reads a redo data before writing the redo queue, acquiring the queue lock of the redo queue, to obtain a heavy read in the write cache of the redo queue After the data is written into the redo queue, the queue lock of the redo queue is released.
- the method further includes: the redo queue processing And the unit is further configured to: sequentially read a redo data from the cache of the application thread corresponding to the identifier of the application thread in the timing queue, and obtain a queue lock of the timing queue to lock the a timing queue, and a queue lock in which the redo data is read from the cache of the application thread corresponding to the identifier of the application thread in the timing queue, and the queue lock is released after the redo queue is written; or A read end identifier is added to the tail element of the time series queue before reading a redo data from the cache of the application thread corresponding to the identifier of the application thread in the sequence queue.
- the method further includes: the redo queue processing unit, Reading in the cache of the application thread corresponding to the identifier of the application thread in the time series queue After the redo data is written to the redo queue, it is further used to delete the identifier of the application thread from the timing queue.
- the embodiment of the present invention uses the application thread to generate redo data and saves it to the cache allocated for the application thread, and saves the identifier of the application thread to the timing queue, and satisfies the data reading condition.
- the order of reading the identifier of the application thread in the time series queue sequentially reads the redo data in the cache of the application thread into the redo queue, thereby improving the processing efficiency of the redo data and improving the concurrent throughput of the database system. .
- FIG. 1 is a flowchart of a method for processing database redo data according to an embodiment of the present invention
- FIG. 2 is a signaling flow chart of a method for processing database redo data according to another embodiment of the present invention
- FIG. 3 is a structural diagram of a processing device for processing database redo data according to an embodiment of the present invention
- FIG. 4 is a structural diagram of a processing device for processing database redo data based on a computer system according to an embodiment of the present invention.
- An embodiment of the present invention provides a method for processing database redo data, which is applied to a server, wherein the server runs a data reading thread and a plurality of application threads, and the plurality of application threads modify the database in a concurrent manner,
- the method includes:
- Step 101 Each application thread of the plurality of application threads generates redo data according to an operation of modifying a database, and saves the redo data to a buffer allocated for each application thread.
- the identifier of the application thread is saved to the timing queue, and the timing queue lock is released after the saving ends.
- Step 102 The data reading thread determines that the data reading condition is satisfied, and reads an order of the identifier of the application thread from the timing queue, and sequentially selects an application thread corresponding to the identifier of the application thread in the time series queue. A redo data is read from the cache and written to the redo queue.
- the data reading condition is specifically that the predetermined time period is reached, or the length of the timing queue reaches a predetermined value, or the amount of cached data of the application thread reaches a predetermined value.
- Reading a redo data in the cache before writing to the redo queue further includes acquiring a queue lock of the timing queue to lock the timing queue, and the application thread corresponding to the identifier of the application thread in the sequence queue Reading a redo data in the cache after the redo queue is written, further comprising: releasing the queue lock of the timing queue; or sequentially reading from the cache of the application thread corresponding to the identifier of the application thread in the timing queue Before a redo data is written to the redo queue, it also includes adding a read end identifier to the tail element of the timing queue.
- reading a redo data from the cache of the application thread corresponding to the identifier of the application thread in the timing queue further comprises deleting the identifier of the application thread from the timing queue after the redo data is written into the redo queue.
- Another embodiment of the present invention provides a signaling flowchart for processing database redo data. Referring to FIG. 2, the specific process includes:
- Step 201 After receiving the instruction of the terminal to access the database, the server starts multiple application threads to concurrently modify the database, allocates respective caches for each application thread, and starts a data reading thread.
- Step 202-1 The application thread 1 modifies the database, generates redo data according to the modification operation, and saves the redol to the application thread. 1 in the cache.
- Step 202-2 The application thread 1 locks the timing queue, that is, acquires the timing queue lock, so the write permission to the timing queue is obtained, and the identifier of the application thread 1 is saved in the sequence queue, and the sequence queue after the save only contains An application thread identifies SessionlDl, and unlocks the timing queue, that is, releases the timing queue lock; because the write permission of the timing queue is obtained by locking the timing queue, other application threads cannot simultaneously perform the write timing queue operation, thereby The timing of the application thread identifier saved in the timing queue is guaranteed, because only one integer data write operation is performed after the lock, so the lock time of the timing queue is very short, and the concurrency of multiple threads is high.
- Step 202-3 The application thread 2 modifies the database, generates redo data Redo2 according to the modification operation, and saves Redo2 to the cache of the application thread 2.
- Step 202-4 After the application thread 2 locks the timing queue, the application thread 2 identifier SessionID2 is saved to the timing queue. After saving, the application thread identifiers included in the sequence queue are SessionlDl and SessionID2, and the timing queue is interpreted because the queue has First-in-first-out step 202-5: Application thread 3 modifies the database, generates redo data Redo3 according to the modification operation, and saves Redo3 to the cache of application thread 3.
- Step 202-6 After the application thread 3 locks the timing queue, the thread ID3 of the thread 3 is saved to the timing queue. After saving, the application thread identifiers included in the sequence queue are SessionlDl, SessionID2 and SessionID3, and the timing queue is unlocked.
- Step 202-7 The application thread 2 modifies the database again, generates Redo4 according to the modification operation, and saves the Redo4 to the cache of the application thread 2, because the cache adopts the data structure of the queue, and has the characteristics of first in, first out.
- the redo data Redo2 and Redo4 are stored in the cache in the order of generation.
- Step 202-8 After the application thread 2 locks the timing queue, the identifier of the thread 2 is applied. Ses s ionID2 is saved to the timing queue. After saving, the timing queue contains application thread identifiers of Ses s ionlD Ses s ion ID2, Ses s ion ID3 and Ses s ion ID2, and unlocks the timing queue.
- Step 203 After the data reading thread determines that the data reading condition is met, the order of the identifier of the application thread is read from the timing queue, and sequentially from the cache of the application thread corresponding to the identifier of the application thread in the timing queue. Read a redo data into the redo queue.
- the data reading condition may be that a predetermined time period is reached, or the length of the timing queue reaches a predetermined value, or the amount of buffered data of the application thread reaches a predetermined value.
- the server can set multiple different types of data read conditions at the same time, and when any one of the conditions is satisfied, a data read operation is required.
- the first data reading condition may be set to a time period of 10 s
- the second data reading condition is that the amount of cached data of the application thread reaches 10, and the data is avoided in the cache by setting a time period to avoid inefficient database operations.
- the retention time is too long.
- the data reading condition is set to a length of the timing queue of 4.
- the order of the identifiers of the application threads is read from the timing queue, and a redo data is written into the redo queue from the cache of the application thread corresponding to the identifier of the application thread in the sequence queue.
- the step specific implementation method may be: traversing the time series queue, and reading a redo data in the cache of the application thread corresponding to the identifier of the application thread obtained by each traversal to the redo queue.
- a new application thread identifier may be saved to the timing queue. In order to reduce the interference to the sequential read redo data operation and improve the efficiency of data reading, it may be read sequentially.
- the timing queue is locked, that is, the timing queue lock is obtained, thereby obtaining the write permission of the timing queue, so as to prohibit the identification of the new application thread from being saved to the timing queue until the redo data operation is read this time.
- the application will wait until the timing queue lock is acquired before saving the identifier of the new application thread to the timing queue, or to the tail of the timing queue before the redo data operation is read sequentially.
- the element adds a read end identifier, and at this time, the identifier of the new application thread is allowed to be saved, but the operation of reading the redo data is stopped when the read end identifier is detected.
- the redo data is sequentially written into the redo queue, and the second data reading condition may be detected, in order to avoid the second data reading condition, causing new data to be read and written.
- the redo queue operation after determining that the first data read condition is satisfied, before performing the read redo data write redo queue operation, the redo queue is locked to obtain the write permission of the redo queue, thereby avoiding simultaneous New write redo queue operations. Only after the first execution of the sequential read redo data write redo queue operation ends and the redo queue lock is released, the data read thread can perform a new redo data read operation according to the second data read condition.
- a redo queue lock is allocated to perform a new redo data read and write to the redo queue operation.
- the redo data After reading a redo data from the cache of the application thread corresponding to the identifier of the application thread in the timing queue, the redo data is written into the redo queue, and the identifier of the application thread in the timing queue is included in the timing queue. delete.
- the detailed operation process of the data reading thread in step 203 is as follows: After the data reading thread determines that the length of the timing queue is 4, the tail element of the time series queue, that is, the fourth element is added to read After the end of the identification, the timing queue is traversed, so during the redo data reading process, the three application threads can continue to perform the database modification operation, that is, the redo data is added to the cache, and the identifier of the application thread is added to the timing queue.
- the read end identifier is added by adding a StopFlag attribute to each element in the queue and separately setting the S topFlag attribute value of the tail element to 1.
- a redo data in the cache of the application thread 1 corresponding to Ses s ionlDl is read into the redo queue, because the cache is first in, first out. Structure, so the first data is read, Redol. After reading, the second data will become the first data; and Ses s ionlDl will be deleted from the timing queue. At this time, the data contained in the redo queue is Redol.
- a redo data in the cache of the application thread 2 corresponding to the Ses s ion ID2, that is, Redo2 is read into the redo queue, after reading Redo4 It will become the first redo data in the cache of application thread 2; and remove Ses s ionID2 from the timing queue.
- the data contained in the redo queue is Redol, Redo2.
- a redo data in the cache of the application thread 3 corresponding to the Ses s ion ID3 is read, that is, Redo3 is read to the weight.
- the Ses s ion ID3 is deleted from the timing queue. At this time, the data contained in the redo queue is Redol, Redo2, Redo3.
- a redo data in the cache of the application thread 2 corresponding to Ses s ion ID2, that is, Redo4 is read into the redo queue, and Ses s ionID2 is deleted from the timing queue.
- the data contained in the redo queue is Redol, Redo2, Redo3, and Redo4.
- Step 204 Write the redo data in the redo queue to the disk.
- An embodiment of the present invention provides a server for processing database redo data.
- the server runs a plurality of application threads, and the plurality of application threads modify the database in a concurrent manner.
- the server 300 includes:
- the timing queue processing unit 301 is configured to generate redo data according to an operation of modifying the database in each of the plurality of application threads, and save the redo data to a cache allocated for each application thread. After obtaining the timing queue lock, saving the identifier of the application thread to the redo queue processing unit 302;
- the redo queue processing unit 302 is configured to receive the timing queue from the timing queue processing unit 301, and after determining that the data reading condition is satisfied, read the sequence of the identifier of the application thread from the timing queue, and sequentially A redo data is written into the redo queue in the cache of the application thread corresponding to the identifier of the application thread in the timing queue.
- the redo queue processing unit 302 determines that the data reading condition is met to specifically include determining that the predetermined time period has elapsed or the length of the timing queue reaches a predetermined value or the amount of cached data of the thread reaches a predetermined value.
- the redo queue processing unit 302 is further configured to: obtain a redo data from the cache of the application thread corresponding to the identifier of the application thread in the sequence queue, and then read a redo data before the redo queue is written, a queue lock of the redo queue to obtain a write to the redo queue A queue lock that reads the redo queue after reading a redo data in the cache and writing it to the redo queue.
- the redo queue processing unit 302 is further configured to: read a redo data from the cache of the application thread corresponding to the identifier of the application thread in the sequence queue, and write a retry data from the timing Querying, in the cache of the application thread corresponding to the identifier of the application thread in the queue, reading a queue data lock after the redo data is written into the redo queue; or sequentially determining the identifier of the application thread from the time series queue Adding a read end identifier to the tail element of the timing queue before reading a redo data in the cache of the application thread.
- the redo queue processing unit 302 reads a redo data into the redo queue after reading the redo data from the cache of the application thread corresponding to the identifier of the application thread in the time series queue.
- the server in the embodiment of the present invention can be implemented based on a computer system, and the methods shown in FIG. 1 and FIG. 2 can be implemented in a server based on a computer system.
- Figure 4 illustrates an embodiment of a server implemented based on a computer system.
- the server in this embodiment may include: a processor 401, a memory 402, and a communication interface 403, wherein:
- the communication interface 403 is configured to communicate with the terminal. Messages exchanged between the server and the terminal are transmitted and received through the communication interface 403. Specifically, the communication interface 403 is configured to receive an instruction to access the database from the terminal; the memory 402 is configured to store the program instruction; the processor 401 is configured to: after receiving the instruction to access the database from the terminal, invoke the program instruction stored in the memory 402, and perform the following operations: : starting a data read thread and a plurality of application threads, wherein the plurality of application threads modify the database in a concurrent manner, and each of the plurality of application threads generates redo data according to an operation of modifying the database, and the The redo data is correspondingly saved to the cache allocated for each application thread, and the identifier of the application thread is saved to the timing queue after the timing queue lock is acquired, and the timing queue lock is released after the saving is completed; The data reading thread determines that the data reading condition is satisfied, reads the order of the identification of the application thread from the timing queue, and sequentially
- the processor 401 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or the like.
- the server in this embodiment may include a bus 404.
- the processor 401, the memory 402, and the communication interface 403 can be connected and communicated via a bus 404.
- the memory 402 may include: a random access memory (RAM), a read-only memory (ROM), a disk and the like having a storage function.
- the processor 401 can also be used to perform the steps of the server described in FIG. 1 and FIG. 2 in the method embodiment, and the embodiments of the present invention are not described in detail herein.
- the foregoing provides a detailed description of the present invention.
- the principles and embodiments of the present invention are described herein with reference to specific examples. The description of the above embodiments is only to assist in understanding the method of the present invention and its core ideas; In the meantime, the present invention is not limited by the scope of the present invention.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例提供了一种处理数据库重做数据的方法和装置,所述方法包括:服务器包含的多个应用线程中每一应用线程根据修改数据库的操作生成重做数据,并将所述重做数据相应保存到为所述每一应用线程分配的緩存中,获取时序队列锁后将所述应用线程的标识保存到所述时序队列,保存结束后译放时序队列锁;数据读取线程确定数据读取条件得到满足,从所述时序队列中读取所述应用线程的标识的顺序,依次从所述时序队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据到重做队列。使用本发明,通过将时序队列和数据队列分离,能够提高重做数据的处理效率,从而提升数据库系统的并发吞吐量。
Description
处理数据库重做数据的方法和装置
技术领域
本发明涉及通信网络技术领域, 尤其涉及处理数据库重做数据的方法 和装置。
背景技术
重做日志 (redo log )是数据库操作中数据可靠性的重要保障, 能够 提供比文件系统更多的数据安全保护。 它的基本原理是当数据库修改操作 提交的时候, 数据并不会即时写入到磁盘的数据文件中, 而是保存在内存 中, 避免每次的数据库更新要求都写入数据文件, 从而提高数据库更新的 性能; 并根据修改操作生成重做数据 ( redo da ta ) 并写入到磁盘成为重做 日志, 避免在故障的情况下, 由于内存数据的丟失而导致数据丟失。 当数 据库操作过程出现故障时, 可以通过持久化的重做日志对数据进行恢复。
现有大多数数据库应用中, 为了提高系统并发吞吐性能, 数据库提供 多线程并发处理的访问方式。 虽然多个线程可以并发访问数据库, 为了提 高写磁盘的效率, 多个重做数据在写入磁盘前, 需要先緩存到重做队列 ( redo queue ) 中再依次写入磁盘。 因为重做数据存在时序性限制, 多个 线程往重做队列中拷贝重做数据时, 需要在全局的重做队列锁保护范围内 来保证时序, 即每次写重做数据都需要抢占重做队列锁后做耗时较大的数 据拷贝。
现有技术中多个线程只能以串行的方式生成和拷贝重做数据, 因此存 在重做数据处理效率低的缺陷, 影响了大业务量并发应用下系统的吞吐量。 发明内容
本发明实施例提供了一种处理数据库重做数据的方法和装置, 用于提 高重做数据的处理性能。
第一方面, 本发明实施例提供了一种处理数据库重做数据的方法, 应 用于服务器中, 所述服务器中运行有数据读取线程以及多个应用线程, 所 述多个应用线程以并发的方式修改数据库, 所述方法包括: 所述多个应用 线程中每一应用线程根据修改数据库的操作生成重做数据, 并将所述重做 数据相应保存到为所述每一应用线程分配的緩存中, 获取时序队列锁后将
所述应用线程的标识保存到时序队列, 所述保存结束后译放所述时序队列 锁; 所述数据读取线程确定数据读取条件得到满足, 从所述时序队列中读 取所述应用线程的标识的顺序, 依次从所述时序队列中应用线程的标识对 应的应用线程的緩存中读取一个重做数据写入重做队列。
在第一方面的第一种可能的实现方式中, 所述数据读取条件为到达预 定的时间周期, 或所述时序队列的长度达到预定值, 或所述应用线程的緩 存数据量达到预定值。
结合第一方面或第一方面的第一种可能的实现方式, 在第二种可能的 实现方式中: 所述依次从所述时序队列中应用线程的标识对应的应用线程 的緩存中读取一个重做数据写入重做队列之前, 进一步包括获取所述重做 队列的队列锁, 以获得对所述重做队列的写入权限; 所述依次从所述时序 队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据写入重 做队列之后, 进一步包括译放所述重做队列的队列锁。
结合第一方面或第一方面的第一种可能的实现方式或第一方面的第二 种可能的实现方式, 在第三种可能的实现方式中, 该方法还包括: 所述依 次从所述时序队列中应用线程的标识对应的应用线程的緩存中读取一个重
的緩存中读取一个重做数据写入重做队列之后还包括译放所述时序队列的 的緩存中读取一个重做数据写入重做队列之前还包括给所述时序队列的队 尾元素添加读取结束标识。
结合第一方面以及第一方面的第一至第三种可能的实现方式中的任意 一个, 在第四种可能的实现方式中, 该方法还包括: 所述从所述时序队列 中应用线程的标识对应的应用线程的緩存中读取一个重做数据写入重做队 第二方面, 本发明实施例提供了一种处理数据库重做数据的服务器, 所述服务器中运行有多个应用线程, 所述多个应用线程以并发的方式修改 数据库, 所述服务器包括:
时序队列处理单元, 用于在所述多个应用线程中每一应用线程根据修
改数据库的操作生成重做数据, 并将所述重做数据相应保存到为所述每一 应用线程分配的緩存中, 获取时序队列锁后将所述应用线程的标识保存到 到重做队列处理单元;
所述重做队列处理单元, 用于从所述时序队列处理单元接收所述时序 队列, 以及确定数据读取条件得到满足后, 从所述时序队列中读取所述应 用线程的标识的顺序, 依次从所述时序队列中应用线程的标识对应的应用 线程的緩存中读取一个重做数据写入重做队列。
在第一方面的第一种可能的实现方式中, 所述重做队列处理单元确定 满足数据读取条件具体包括: 所述重做队列处理单元确定到达预定的时间 周期或所述时序队列的长度达到预定值或所述线程的緩存数据量达到预定 值。
结合第一方面或第一方面的第一种可能的实现方式, 在第二种可能的 实现方式中,所述重做队列处理单元, 进一步的用于: 所述依次从所述时序 队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据写入重 做队列之前, 获取所述重做队列的队列锁, 以获得对所述重做队列的写入 緩存中读取一个重做数据写入重做队列之后译放所述重做队列的队列锁。
结合第一方面或第一方面的第一种可能的实现方式或第一方面的第二 种可能的实现方式, 在第三种可能的实现方式中, 该方法还包括, 所述重 做队列处理单元, 进一步的用于:所述依次从所述时序队列中应用线程的标 识对应的应用线程的緩存中读取一个重做数据写入重做队列之前获取所述 时序队列的队列锁以锁定所述时序队列, 以及所述依次从所述时序队列中 应用线程的标识对应的应用线程的緩存中读取一个重做数据写入重做队列 之后译放所述时序队列的队列锁; 或者所述依次从所述时序队列中应用线 程的标识对应的应用线程的緩存中读取一个重做数据写入重做队列之前给 所述时序队列的队尾元素添加读取结束标识。
结合第一方面以及第一方面的第一至第三种可能的实现方式中的任意 一个, 在第四种可能的实现方式中, 该方法还包括: 所述重做队列处理单 元, 在从所述时序队列中应用线程的标识对应的应用线程的緩存中读取一
个重做数据写入重做队列之后进一步的还用于将所述应用线程的标识从所 述时序队列中删除。
由以上技术方案可以看出, 由于本发明实施例利用应用线程生成重做 数据后保存到为应用线程分配的緩存, 并将应用线程的标识保存到时序队 列, 满足数据读取条件后才从所述时序队列中读取所述应用线程的标识的 顺序依次将应用线程的緩存中的重做数据读取到重做队列, 从而提高了重 做数据的处理效率, 提升了数据库系统的并发吞吐量。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对 实施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员 来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的 附图。
图 1为本发明一个实施例提供的数据库重做数据的处理方法流程图; 图 2 为本发明另一个实施例提供的数据库重做数据的处理方法信令流 程图;
图 3为本发明一个实施例提供的数据库重做数据的处理装置结构图; 图 4 为本发明一个实施例提供的基于计算机系统的数据库重做数据的 处理装置结构图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进 行清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没 有作出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的 范围。
本发明一个实施例提供了处理数据库重做数据的方法, 应用于服务器 中, 所述服务器中运行有数据读取线程以及多个应用线程, 所述多个应用 线程以并发的方式修改数据库, 请参照图 1 , 该方法包括:
步骤 101 :所述多个应用线程中每一应用线程根据修改数据库的操作生 成重做数据, 并将所述重做数据相应保存到为所述每一应用线程分配的緩
存中, 获取时序队列锁后将所述应用线程的标识保存到时序队列, 所述保 存结束后译放所述时序队列锁。
步骤 102: 所述数据读取线程确定数据读取条件得到满足,从所述时序 队列中读取所述应用线程的标识的顺序, 依次从所述时序队列中应用线程 的标识对应的应用线程的緩存中读取一个重做数据写入重做队列。
其中, 数据读取条件具体为到达预定的时间周期, 或所述时序队列的 长度达到预定值, 或所述应用线程的緩存数据量达到预定值。 的緩存中读取一个重做数据写入重做队列之前, 进一步包括获取所述重做 队列的队列锁, 以获得对所述重做队列的写入权限; 所述依次从所述时序 队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据写入重 做队列之后, 进一步包括译放所述重做队列的队列锁。 的緩存中读取一个重做数据写入重做队列之前还包括获取所述时序队列的 队列锁以锁定所述时序队列, 以及所述依次从所述时序队列中应用线程的 标识对应的应用线程的緩存中读取一个重做数据写入重做队列之后还包括 译放所述时序队列的队列锁; 或者所述依次从所述时序队列中应用线程的 标识对应的应用线程的緩存中读取一个重做数据写入重做队列之前还包括 给所述时序队列的队尾元素添加读取结束标识。
可选的, 从所述时序队列中应用线程的标识对应的应用线程的緩存中 读取一个重做数据写入重做队列之后还包括将所述应用线程的标识从所述 时序队列中删除。
本发明另一个实施例提供了处理数据库重做数据的信令流程图, 请参 照图 2 , 具体流程包括:
步骤 201 : 服务器接收到终端访问数据库的指令后, 启动多个应用线程 并发修改数据库, 并为每个应用线程分配各自的緩存, 并启动数据读取线 程。
具体的, 本实施例中, 有三个并发修改数据库的应用线程, 其线程标 i只分别为 Ses s ionIDl、 Ses s ionID2和 Ses s ionID3。
步骤 202: 任一应用线程根据修改数据库的操作生成重做数据后, 将所 述重做数据保存到为该应用线程分配的緩存, 获取时序队列锁后将所述应 用线程的标识保存到时序队列, 保存结束后译放该时序队列锁。
具体的, 本实施例中, 步骤 202中三个应用线程的操作子步骤如下: 步骤 202-1: 应用线程 1对数据库进行修改,根据该修改操作生成重做 数据 Redol , 将 Redol保存到应用线程 1的緩存中。
步骤 202-2: 应用线程 1锁定时序队列、 即获取时序队列锁, 因此获取 到对所述时序队列的写入权限, 将应用线程 1的标识 SessionlDl保存到时 序队列中, 保存后时序队列只包含一个应用线程标识 SessionlDl, 并对时 序队列解锁, 即译放时序队列锁; 因为通过锁定时序队列而获取到所述时 序队列的写入权限后, 其他应用线程无法同时执行写时序队列的操作, 从 而保证了在时序队列中保存的应用线程标识的时序性, 因为加锁后只要执 行一个整形数据的写入操作, 所以对时序队列的锁定时间非常短, 多个线 程的并发性高。
步骤 202-3: 应用线程 2对数据库进行修改,根据该修改操作生成重做 数据 Redo2, 将 Redo2保存到应用线程 2的緩存中。
步骤 202-4: 应用线程 2 锁定时序队列后, 将应用线程 2 的标识 SessionID2 保存到时序队列中, 保存后时序队列包含的应用线程标识为 SessionlDl和 SessionID2, 并对时序队列解译, 因为队列具有先进先出的 步骤 202-5: 应用线程 3对数据库进行修改,根据该修改操作生成重做 数据 Redo3, 将 Redo3保存到应用线程 3的緩存中。
步骤 202-6:应用线程 3锁定时序队列后,将线程 3的标识 SessionID3 保存到时序队列中, 保存后时序队列包含的应用线程标识为 SessionlDl, SessionID2和 SessionID3, 并对时序队列解锁。
步骤 202-7: 应用线程 2对数据库再次进行修改,根据该修改操作生成 重做数据 Redo4, 将 Redo4保存到应用线程 2的緩存中, 因为緩存采用队列 的数据结构, 具有先进先出的特点, 重做数据 Redo2和 Redo4按生成先后 顺序在緩存中存放。
步骤 202-8: 应用线程 2 锁定时序队列后, 将应用线程 2 的标识
Ses s ionID2 保存到时序队列中, 保存后时序队列包含的应用线程标识为 Ses s ionlD Ses s ionID2、 Ses s ionID3和 Ses s ionID2 , 并对时序队列解锁。
步骤 203: 数据读取线程确定满足数据读取条件后,从所述时序队列中 读取所述应用线程的标识的顺序, 依次从所述时序队列中应用线程的标识 对应的应用线程的緩存中读取一个重做数据写入重做队列。
其中, 数据读取条件可以是到达预定的时间周期、 或者时序队列的长 度达到预定值、 或者应用线程的緩存数据量达到预定值。 可选的, 服务器 可以同时设置多个不同类型的数据读取条件, 当任意一个条件满足时, 都 需要进行数据读取操作。 例如, 可以同时设置第一数据读取条件为时间周 期为 10s , 第二数据读取条件为应用线程的緩存数据量达到 10个, 通过设 置时间周期避免数据库操作不频繁时重做数据在緩存中保留时间过长, 通 过设置应用线程的緩存阈值避免数据库操作频繁时緩存中的数据得不到及 时处理。 具体的, 在本实施例中, 将数据读取条件设置为时序队列的长度 达到 4。
其中, 从所述时序队列中读取所述应用线程的标识的顺序, 依次从所 述时序队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据 写入重做队列, 该步骤具体实现方法的可以是: 遍历时序队列, 将每个遍 历得到的应用线程的标识对应的应用线程的緩存中一个重做数据读取到重 做队列。 存读取重做数据的过程中可能有新的应用线程的标识保存到时序队列, 为 了减少对本次依次读取重做数据操作的干扰、 提高数据读取的效率, 可以 在本次依次读取重做数据操作之前, 锁定时序队列、 即获得时序队列锁, 从而获取时序队列的写入权限, 以禁止有新的应用线程的标识保存到时序 队列中, 直到本次读取重做数据操作结束之后译放时序队列锁, 应用程序 将等待、 直到获取时序队列锁后才能将新的应用线程的标识保存到时序队 列, 或者在本次依次读取重做数据操作之前给时序队列的队尾元素添加读 取结束标识, 此时允许保存新的应用线程的标识, 但检测到该读取结束标 识时停止本次读取重做数据的操作。
可选的, 因为允许同时设置多个不同类型的数据读取条件, 在确定满
足第一数据读取条件后依次读取重做数据写入重做队列的过程中可能检测 到满足第二数据读取条件, 为了避免第二数据读取条件引起新的数据读取 并写入重做队列操作, 在确定满足第一数据读取条件后, 执行依次读取重 做数据写入重做队列操作之前, 锁定重做队列以获取重做队列的写入权限, 从而避免了同时有新的写重做队列操作。 只有当第一次执行的依次读取重 做数据写入重做队列操作结束并译放重做队列锁之后, 数据读取线程才能 根据第二数据读取条件为新的重做数据读取操作分配重做队列锁, 从而执 行新的重做数据读取并写入重做队列操作。
其中, 从所述时序队列中应用线程的标识对应的应用线程的緩存中读 取一个重做数据写入重做队列之后, 还包括将所述时序队列中应用线程的 标识从所述时序队列中删除。
具体的, 本实施例中, 步骤 203中数据读取线程的详细操作过程如下: 数据读取线程确定时序队列的长度为 4后, 在时序队列的队尾元素, 即第四个元素添加读取结束标识后遍历该时序队列, 因此在重做数据读取 过程中三个应用线程还可以继续执行数据库修改操作, 即将重做数据添加 到緩存中, 以及将应用线程的标识添加到时序队列中。 其中, 通过为队列 中每个元素添加一个 StopFlag属性, 且单独将队尾元素的 S topFlag属性 值设置为 1的方式来添加读取结束标识。
数据读取线程遍历得到第一个应用线程的标识为 Ses s ionlDl 后, 将 Ses s ionlDl对应的应用线程 1的緩存中一个重做数据读取到重做队列中, 因为緩存是先进先出的结构, 所以读取到的是第一个数据即 Redol ,读取过 后第二个数据将成为第一个数据; 并将 Ses s ionlDl从时序队列中删除, 此 时重做队列中包含的数据为 Redol。
数据读取线程遍历得到第二个应用线程的标识为 Ses s ionID2 后, 将 Ses s ionID2对应的应用线程 2的緩存中一个重做数据、 即 Redo2读取到重 做队列中, 读取过后 Redo4将成为应用线程 2的緩存中第一个重做数据; 并将 Ses s ionID2从时序队列中删除,此时重做队列中包含的数据为 Redol , Redo2。
数据读取线程遍历得到第三个应用线程的标识为 Ses s ionID3 后, 将 Ses s ionID3对应的应用线程 3的緩存中一个重做数据、 即 Redo3读取到重
做队列中, 并将 Ses s ionID3从时序队列中删除, 此时重做队列中包含的数 据为 Redol , Redo2 , Redo3。
数据读取线程遍历得到第四个应用线程的标识为 Ses s ionID2 后, 将 Ses s ionID2对应的应用线程 2的緩存中一个重做数据、 即 Redo4读取到重 做队列中, 并将 Ses s ionID2从时序队列中删除, 此时重做队列中包含的数 据为 Redol , Redo2 , Redo3 , Redo4。 因为遍历到第四个元素时, 检测到读 取结束标识, 停止本次重做数据读取操作。
步骤 204: 将所述重做队列中的重做数据写入到磁盘中。
具体的, 可以是数据读取线程执行完本次读取重做数据的操作后立即 将重做队列中的重做数据一次性全部写入到磁盘中。
本发明一个实施例提供了处理数据库重做数据的服务器, 服务器中运 行有多个应用线程, 所述多个应用线程以并发的方式修改数据库, 请参照 图 3 , 该服务器 300包括:
时序队列处理单元 301 ,用于在所述多个应用线程中每一应用线程根据 修改数据库的操作生成重做数据, 并将所述重做数据相应保存到为所述每 一应用线程分配的緩存中, 获取时序队列锁后将所述应用线程的标识保存 送到重做队列处理单元 302 ;
重做队列处理单元 302 ,用于从时序队列处理单元 301接收所述时序队 列, 以及确定数据读取条件得到满足后, 从所述时序队列中读取所述应用 线程的标识的顺序, 依次从所述时序队列中应用线程的标识对应的应用线 程的緩存中读取一个重做数据写入重做队列。
可选的, 重做队列处理单元 302确定满足数据读取条件具体包括确定 到达预定的时间周期或所述时序队列的长度达到预定值或所述线程的緩存 数据量达到预定值。
可选的, 重做队列处理单元 302 , 进一步的用于: 所述依次从所述时序 队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据写入重 做队列之前, 获取所述重做队列的队列锁, 以获得对所述重做队列的写入
緩存中读取一个重做数据写入重做队列之后译放所述重做队列的队列锁。 可选的, 重做队列处理单元 302 , 进一步的用于:所述依次从所述时序 队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据写入重 次从所述时序队列中应用线程的标识对应的应用线程的緩存中读取一个重 做数据写入重做队列之后译放所述时序队列的队列锁; 或者所述依次从所 述时序队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据 写入重做队列之前给所述时序队列的队尾元素添加读取结束标识。
可选的, 重做队列处理单元 302 , 在从所述时序队列中应用线程的标识 对应的应用线程的緩存中读取一个重做数据写入重做队列之后进一步的还
本发明实施例中的服务器可以基于计算机系统来实现, 图 1、 图 2所示 的方法均可在基于计算机系统的服务器来实现。 图 4 示出了基于计算机系 统来实现的服务器的实施例。 本实施例中服务器可以包括: 处理器 401、 存 储器 402和通信接口 403 , 其中:
通信接口 403 , 用于与终端通信。服务器与终端之间交互的消息均通过 通信接口 403发送和接收。 具体地, 通信接口 403用于从终端接收访问数 据库的指令; 存储器 402用于存储程序指令; 处理器 401用于从终端接收 访问数据库的指令之后, 调用存储器 402 中存储的程序指令, 执行如下操 作: 启动数据读取线程以及多个应用线程, 所述多个应用线程以并发的方 式修改数据库, 所述多个应用线程中每一应用线程根据修改数据库的操作 生成重做数据, 并将所述重做数据相应保存到为所述每一应用线程分配的 緩存中, 获取时序队列锁后将所述应用线程的标识保存到时序队列, 所述 保存结束后译放所述时序队列锁; 所述数据读取线程确定数据读取条件得 到满足, 从所述时序队列中读取所述应用线程的标识的顺序, 依次从所述 时序队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据写 入重做队列。
其中,处理器 401可以是中央处理器( centra l proces s ing uni t, CPU ), 专用集成电路 ( appl ica t ion-spec if i c integrated c i rcui t, AS IC )等。
其中, 本实施例中的服务器可以包括总线 404。 处理器 401、 存储器 402以 及通信接口 403之间可通过总线 404连接并通信。 其中, 存储器 402可以 包括: 随机存取存储器 ( random acces s memory, RAM ) , 只读存储器 ( read-only memory, ROM ), 磁盘等具有存储功能的实体。
处理器 401还可以用于执行方法实施例中图 1、图 2描述的服务器的各 步骤, 本发明实施例在此不再详述。 以上对本发明所提供的一种进行了详细介绍, 本文中应用了具体个例 对本发明的原理及实施方式进行了阐述, 以上实施例的说明只是用于帮助 理解本发明的方法及其核心思想; 同时, 对于本领域的一般技术人员, 依 据本发明的思想, 在具体实施方式及应用范围上均会有改变之处, 综上所 述, 本说明书内容不应理解为对本发明的限制。
Claims
1、 一种处理数据库重做数据的方法, 应用于服务器中, 所述服务器中 运行有数据读取线程以及多个应用线程, 所述多个应用线程以并发的方式 修改数据库, 其特征在于, 所述方法包括:
所述多个应用线程中每一应用线程根据修改数据库的操作生成重做数 据, 并将所述重做数据相应保存到为所述每一应用线程分配的緩存中, 获 取时序队列锁后将所述应用线程的标识保存到时序队列, 所述保存结束后 译放所述时序队列锁;
所述数据读取线程确定数据读取条件得到满足, 从所述时序队列中读 取所述应用线程的标识的顺序, 依次从所述时序队列中应用线程的标识对 应的应用线程的緩存中读取一个重做数据写入重做队列。
2、 根据权利要求 1所述的方法, 其特征在于:
所述数据读取条件为到达预定的时间周期, 或所述时序队列的长度达 到预定值, 或所述应用线程的緩存数据量达到预定值。
3、 根据权利要求 1或 2所述的方法, 其特征在于: 读取一个重做数据写入重做队列之前, 进一步包括获取所述重做队列的队 列锁, 以获得对所述重做队列的写入权限; 读取一个重做数据写入重做队列之后, 进一步包括译放所述重做队列的队 列锁。
4、 根据权利要求 1、 2或 3所述的方法, 其特征在于: 读取一个重做数据写入重做队列之前还包括获取所述时序队列的队列锁以 的应用线程的緩存中读取一个重做数据写入重做队列之后还包括译放所述 时序队列的队列锁; 存中读取一个重做数据写入重做队列之前还包括给所述时序队列的队尾元 素添加读取结束标识。
5、 根据权利要求 1-4任一所述的方法, 其特征在于, 所述从所述时序 队列中应用线程的标识对应的应用线程的緩存中读取一个重做数据写入重 做队列之后还包括:
将所述应用线程的标识从所述时序队列中删除。
6、 一种处理数据库重做数据的服务器, 所述服务器中运行有多个应用 线程, 所述多个应用线程以并发的方式修改数据库, 其特征在于, 所述服 务器包括:
时序队列处理单元, 用于在所述多个应用线程中每一应用线程根据修 改数据库的操作生成重做数据, 并将所述重做数据相应保存到为所述每一 应用线程分配的緩存中, 获取时序队列锁后将所述应用线程的标识保存到 到重做队列处理单元;
所述重做队列处理单元, 用于从所述时序队列处理单元接收所述时序 队列, 以及确定数据读取条件得到满足后, 从所述时序队列中读取所述应 用线程的标识的顺序, 依次从所述时序队列中应用线程的标识对应的应用 线程的緩存中读取一个重做数据写入重做队列。
7、 根据权利要求 6所述的服务器, 其特征在于, 所述重做队列处理单 元确定满足数据读取条件具体包括:
所述重做队列处理单元确定到达预定的时间周期或所述时序队列的长 度达到预定值或所述线程的緩存数据量达到预定值。
8、 根据权利要求 6或 7所述的服务器, 其特征在于,
所述重做队列处理单元, 进一步的用于: 读取一个重做数据写入重做队列之前, 获取所述重做队列的队列锁, 以获 得对所述重做队列的写入权限; 以及所述依次从所述时序队列中应用线程 的标识对应的应用线程的緩存中读取一个重做数据写入重做队列之后译放 所述重做队列的队列锁。
9、 根据权利要求 6、 7或 8所述的服务器, 其特征在于, 所述重做队 列处理单元, 进一步的用于: 读取一个重做数据写入重做队列之前获取所述时序队列的队列锁以锁定所
线程的緩存中读取一个重做数据写入重做队列之后译放所述时序队列的队 列锁; 存中读取一个重做数据写入重做队列之前给所述时序队列的队尾元素添加 读取结束标识。
10、根据权利要求 6-9任一所述的服务器, 其特征在于, 所述重做队列 读取一个重做数据写入重做队列之后进一步的还用于:
将所述应用线程的标识从所述时序队列中删除。
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016504452A JP2016517102A (ja) | 2013-03-26 | 2013-09-30 | データベースにおいて再実行データを処理するための方法および装置 |
EP13880562.7A EP2945072A4 (en) | 2013-03-26 | 2013-09-30 | METHOD AND DEVICE FOR PROCESSING RECOVERY DATA OF A DATABASE |
US14/828,146 US10387258B2 (en) | 2013-03-26 | 2015-08-17 | Method and apparatus for processing redo data in database |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310101317.XA CN103150149B (zh) | 2013-03-26 | 2013-03-26 | 处理数据库重做数据的方法和装置 |
CN201310101317.X | 2013-03-26 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US14/828,146 Continuation US10387258B2 (en) | 2013-03-26 | 2015-08-17 | Method and apparatus for processing redo data in database |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2014153940A1 true WO2014153940A1 (zh) | 2014-10-02 |
Family
ID=48548251
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2013/084687 WO2014153940A1 (zh) | 2013-03-26 | 2013-09-30 | 处理数据库重做数据的方法和装置 |
Country Status (5)
Country | Link |
---|---|
US (1) | US10387258B2 (zh) |
EP (1) | EP2945072A4 (zh) |
JP (1) | JP2016517102A (zh) |
CN (1) | CN103150149B (zh) |
WO (1) | WO2014153940A1 (zh) |
Families Citing this family (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103150149B (zh) | 2013-03-26 | 2015-11-25 | 华为技术有限公司 | 处理数据库重做数据的方法和装置 |
CN105912479B (zh) * | 2016-04-07 | 2023-05-05 | 合肥锐世数字科技有限公司 | 一种并发数据的缓存方法及装置 |
US10282361B2 (en) * | 2016-04-29 | 2019-05-07 | Salesforce.Com, Inc. | Transforming time series data points from concurrent processes |
CN106341345B (zh) * | 2016-08-18 | 2019-12-20 | 北京奇虎科技有限公司 | 一种并发请求的处理方法及装置 |
CN108009049B (zh) * | 2017-11-28 | 2020-12-01 | 厦门市美亚柏科信息股份有限公司 | Myisam存储引擎删除记录离线恢复方法、存储介质 |
CN108874588A (zh) * | 2018-06-08 | 2018-11-23 | 郑州云海信息技术有限公司 | 一种数据库实例恢复方法和装置 |
CN109088950A (zh) * | 2018-10-25 | 2018-12-25 | 珠海格力电器股份有限公司 | 数据传输方法、装置、系统和计算机可读存储介质 |
CN111259205B (zh) * | 2020-01-15 | 2023-10-20 | 北京百度网讯科技有限公司 | 一种图数据库遍历方法、装置、设备及存储介质 |
CN112181902B (zh) * | 2020-11-30 | 2021-08-31 | 阿里云计算有限公司 | 数据库的存储方法、装置及电子设备 |
CN113656444B (zh) * | 2021-08-26 | 2024-02-27 | 友安云(厦门)数据科技有限公司 | 一种数据持久化方法、服务器及管理设备 |
CN115905268B (zh) * | 2023-01-03 | 2023-09-29 | 北京力控元通科技有限公司 | 一种基于队列的电表数据处理方法、系统及电子设备 |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7412460B2 (en) * | 2003-06-19 | 2008-08-12 | International Business Machines Corporation | DBMS backup without suspending updates and corresponding recovery using separately stored log and data files |
CN101794247A (zh) * | 2010-03-26 | 2010-08-04 | 天津理工大学 | 嵌套事务模型下实时数据库故障恢复方法 |
CN102195795A (zh) * | 2010-03-19 | 2011-09-21 | Tcl集团股份有限公司 | 智能小区日志系统及其日志记录方法 |
CN102945278A (zh) * | 2012-11-09 | 2013-02-27 | 华为技术有限公司 | 一种数据库记录重做日志的方法和装置 |
CN103150149A (zh) * | 2013-03-26 | 2013-06-12 | 华为技术有限公司 | 处理数据库重做数据的方法和装置 |
Family Cites Families (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05316309A (ja) * | 1992-05-08 | 1993-11-26 | Matsushita Electric Ind Co Ltd | ファクシミリ電子メールシステム |
JPH08235042A (ja) * | 1995-02-28 | 1996-09-13 | N T T Data Tsushin Kk | 複数ジャーナル一括取得方式 |
EP0758114A4 (en) | 1995-02-28 | 1998-08-26 | Ntt Data Tsushin Kk | COOPERATIVE DISTRIBUTED SYSTEM, NEWSPAPER PROCESSING AND RECOVERY PROCESSING IN THE SAME |
US7415466B2 (en) * | 1996-03-19 | 2008-08-19 | Oracle International Corporation | Parallel transaction recovery |
JPH09282296A (ja) * | 1996-04-10 | 1997-10-31 | Hitachi Ltd | 多重化ノード間通信制御方式 |
EP1407359B1 (en) * | 2001-07-16 | 2009-09-30 | Sap Ag | Parallelized redo-only logging and recovery for highly available main memory database systems |
US6842848B2 (en) * | 2002-10-11 | 2005-01-11 | Sandbridge Technologies, Inc. | Method and apparatus for token triggered multithreading |
JP4041002B2 (ja) | 2003-03-24 | 2008-01-30 | 株式会社三菱東京Ufj銀行 | データベース更新処理システム、データベース更新のための更新データ入力方法、更新データ処理方法、およびプログラム |
US7146386B2 (en) * | 2004-03-29 | 2006-12-05 | Microsoft Corporation | System and method for a snapshot query during database recovery |
WO2007129287A1 (en) * | 2006-05-09 | 2007-11-15 | Fleetmatics Patents Limited | A vehicle tracking system |
CN100476738C (zh) * | 2006-08-15 | 2009-04-08 | 杭州华三通信技术有限公司 | 访问临界区的方法和系统 |
US8650155B2 (en) * | 2008-02-26 | 2014-02-11 | Oracle International Corporation | Apparatus and method for log based replication of distributed transactions using globally acknowledged commits |
US20110282850A1 (en) * | 2010-05-11 | 2011-11-17 | Microsoft Corporation | Concurrently Accessing Data |
-
2013
- 2013-03-26 CN CN201310101317.XA patent/CN103150149B/zh active Active
- 2013-09-30 EP EP13880562.7A patent/EP2945072A4/en not_active Withdrawn
- 2013-09-30 JP JP2016504452A patent/JP2016517102A/ja active Pending
- 2013-09-30 WO PCT/CN2013/084687 patent/WO2014153940A1/zh active Application Filing
-
2015
- 2015-08-17 US US14/828,146 patent/US10387258B2/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7412460B2 (en) * | 2003-06-19 | 2008-08-12 | International Business Machines Corporation | DBMS backup without suspending updates and corresponding recovery using separately stored log and data files |
CN102195795A (zh) * | 2010-03-19 | 2011-09-21 | Tcl集团股份有限公司 | 智能小区日志系统及其日志记录方法 |
CN101794247A (zh) * | 2010-03-26 | 2010-08-04 | 天津理工大学 | 嵌套事务模型下实时数据库故障恢复方法 |
CN102945278A (zh) * | 2012-11-09 | 2013-02-27 | 华为技术有限公司 | 一种数据库记录重做日志的方法和装置 |
CN103150149A (zh) * | 2013-03-26 | 2013-06-12 | 华为技术有限公司 | 处理数据库重做数据的方法和装置 |
Non-Patent Citations (1)
Title |
---|
See also references of EP2945072A4 * |
Also Published As
Publication number | Publication date |
---|---|
CN103150149B (zh) | 2015-11-25 |
US10387258B2 (en) | 2019-08-20 |
EP2945072A1 (en) | 2015-11-18 |
EP2945072A4 (en) | 2016-06-29 |
CN103150149A (zh) | 2013-06-12 |
US20150355975A1 (en) | 2015-12-10 |
JP2016517102A (ja) | 2016-06-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2014153940A1 (zh) | 处理数据库重做数据的方法和装置 | |
TWI549060B (zh) | Access methods and devices for virtual machine data | |
CN102945278B (zh) | 一种数据库记录重做日志的方法和装置 | |
CN108572876B (zh) | 一种读写锁的实现方法及装置 | |
US9952783B2 (en) | Data processing method and apparatus, and shared storage device | |
WO2020024408A1 (zh) | 测试装置、测试的方法及存储介质 | |
WO2021052169A1 (zh) | 分布式数据的均衡处理方法、装置、计算终端和存储介质 | |
US8190857B2 (en) | Deleting a shared resource node after reserving its identifier in delete pending queue until deletion condition is met to allow continued access for currently accessing processor | |
CN106155839B (zh) | 一种用于备份数据的方法与设备 | |
WO2016101165A1 (zh) | 事务处理的方法、装置及计算机系统 | |
US9846626B2 (en) | Method and apparatus for computer memory management by monitoring frequency of process access | |
WO2020025049A1 (zh) | 数据同步的方法、装置、数据库主机及存储介质 | |
US11803447B2 (en) | Transaction processing method, apparatus, and electronic device for blockchain | |
WO2019076102A1 (zh) | 一种数据回滚方法、系统、设备及计算机可读存储介质 | |
CN111061690B (zh) | 一种基于rac的数据库日志文件读取方法和装置 | |
CN110196835B (zh) | 元数据的处理方法、元数据的处理装置以及电子设备 | |
WO2022048358A1 (zh) | 数据处理方法、装置及存储介质 | |
WO2023124422A1 (zh) | 一种数据读写的控制方法及电子设备 | |
CN106033422A (zh) | 一种数据库操作控制方法、装置及系统 | |
Luo et al. | {SMART}: A {High-Performance} Adaptive Radix Tree for Disaggregated Memory | |
US20170300255A1 (en) | Method and Apparatus for Detecting Transaction Conflict and Computer System | |
CN112241398A (zh) | 一种数据迁移方法和系统 | |
WO2021159608A1 (zh) | 一种基于Protocol Buffer的镜像缓存方法 | |
KR20210058613A (ko) | 단일 파일의 병렬 읽기/쓰기를 위한 락킹 방법 및 이를 구현하는 컴퓨팅 장치 | |
CN112559457A (zh) | 数据访问方法及装置 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 13880562 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2013880562 Country of ref document: EP |
|
ENP | Entry into the national phase |
Ref document number: 2016504452 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |