WO2017082520A1 - Database management system, and data modification and recovery method thereof - Google Patents

Database management system, and data modification and recovery method thereof Download PDF

Info

Publication number
WO2017082520A1
WO2017082520A1 PCT/KR2016/008849 KR2016008849W WO2017082520A1 WO 2017082520 A1 WO2017082520 A1 WO 2017082520A1 KR 2016008849 W KR2016008849 W KR 2016008849W WO 2017082520 A1 WO2017082520 A1 WO 2017082520A1
Authority
WO
WIPO (PCT)
Prior art keywords
log
page
file
record
database
Prior art date
Application number
PCT/KR2016/008849
Other languages
French (fr)
Korean (ko)
Inventor
장용일
김효성
박상현
신민철
이준희
Original Assignee
엘지전자 주식회사
연세대학교 산학협력단
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 엘지전자 주식회사, 연세대학교 산학협력단 filed Critical 엘지전자 주식회사
Publication of WO2017082520A1 publication Critical patent/WO2017082520A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to a database management system and a method for altering and recovering data thereof, which enable to change and recover data.
  • a database management system recovers data through its own logging method and log to maintain data consistency in the event of power failure or system failure. Can support the method.
  • the database management system may include a mechanism for recovering data when data is lost due to a failure of a transaction, a program, a system, or the like.
  • the data recovery method of the database management system has various methods.
  • various applications used in the mobile terminal use a rollback journal (RWB) method or a write ahead log (WAL) method.
  • RWB rollback journal
  • WAL write ahead log
  • the RBJ method is a method of backing up original data and applying it to a database when a write operation occurs
  • WAL method is a method of maintaining original data in a database file and storing changed pages in a WAL file.
  • the RBJ method and the WAL method have a problem of backing up data that does not change.
  • the WAL method has a problem that a log file must be searched every time a read operation is performed.
  • the WAL file since the latest modification exists in the WAL file, when a read operation is performed, the WAL file must be searched once.
  • the WAL method has a problem that the checkpoint operation is delayed.
  • the WAL method may not perform a checkpoint operation when a read lock is applied to data, and thus a WAL file may be tens or hundreds of times larger than a database file.
  • the conventional data recovery method has a problem that data recovery is too slow and takes a lot of time, and data recovery is unstable.
  • Another object is to provide a database management system and its data change and recovery method that can reduce the size of log files and lower the overall I / O load.
  • Another object is to provide a database management system capable of improving checkpoint speed and a method of data change and recovery thereof.
  • Another object is to provide a database management system and its data alteration and recovery method which can lower the cost of retrieval.
  • a database management system includes a database storing a database file configured in units of pages, a log file generating unit generating a log file for a database file on which a transaction is performed, and a database file. And a control unit for controlling a transaction, and a control unit for controlling a database, a log file generation unit, and a transaction execution unit, wherein the control unit controls the transaction execution unit to perform a transaction of the database file when a transaction of the database file is requested.
  • a log record of the change history is generated for each dirty page of contents of the database file, and when a transaction is committed to the database.
  • Generated full log levels The log file generator can be controlled to store code in a log file.
  • a data change method of a database management system includes receiving a change request of a database file, performing a transaction of a change requested database file, and dirty pages of a database file on which a transaction is performed. Checking the dirty page, for each dirty page whose contents have been changed, generating a log record of the change history, and when a transaction commit is requested, the generated whole log record is stored in the log file. Saving to a log page and committing the transaction to the database.
  • a data recovery method of a database management system includes the steps of receiving a data recovery request, checking the existence of a log file for a database file to be restored, and if the log file exists, Searching from the last log record in the file to the last commit log record in reverse order to determine if the original page exists for the database file to be recovered; if the original page exists, storing the original page in the database file; Retrieving log records that exist between them from the last checkpoint log record in the log file to the last commit log record, and deleting the log records that existed since the last commit log record in the log file. May include All.
  • the checkpoint speed may be improved as compared to the WAL method requiring an additional migration cost. In this way, it is possible to solve the problem of ANR (Application Not Responding).
  • ANR Application Not Responding
  • the WAL file in the case of the WAL method, at the time of reading, the WAL file must be searched once unconditionally, but it is disadvantageous to the select operation. Search costs can be lowered further.
  • FIG. 1 is a block diagram showing a database management system according to an embodiment of the present invention.
  • FIG. 2 is a diagram illustrating contents stored in a database.
  • 3 is a diagram showing the structure of a database file.
  • FIG. 4 is a diagram illustrating a dirty page according to a change of a database file.
  • FIG. 5 is a diagram illustrating a log record generation method according to the dirty page of FIG. 4.
  • FIG. 6 is a view for explaining a logging mode change process according to the size of a log record.
  • FIG. 7 is a diagram showing the structure of a log record.
  • FIG. 8 is a diagram illustrating the structure of a log file into which the log record of FIG. 7 is inserted.
  • 9 is a change command list showing change commands of a database file.
  • FIGS. 10 and 11 are diagrams for explaining the position of a log record inserted into a log page.
  • FIG. 12 is a diagram for describing a tone page of a log file.
  • FIG. 13 is a diagram illustrating a bitmap index for checking a change history of a dirty page.
  • FIG. 14 illustrates a log file according to a change history of a dirty page.
  • 16 is a flowchart illustrating a data recovery method of a database management system according to an embodiment of the present invention.
  • 17 to 20 are diagrams illustrating a recovery performance of a database management system according to an embodiment of the present invention.
  • FIG. 1 is a block diagram showing a database management system according to an embodiment of the present invention.
  • the database management system of the present invention may include a database 100, a log file generator 200, a transaction performer 300, and a controller 400. Can be.
  • the database 100 may store a database file (DB file) configured in units of pages.
  • DB file database file
  • the database 100 may include a database file in which data is stored as a file.
  • the database file is composed of pages, and each page may store a record, which is information stored in an actual database.
  • the log file generation unit 200 may generate a log file for a database file on which a transaction is performed.
  • the log file generating unit 200 may generate a log file in which information on the changed contents is stored when the database file is changed by performing a transaction.
  • the system of the present invention can recover damaged data by using a log file when recovering a database file.
  • the log file generating unit 200 generates a log record including the changed contents every time the contents of the database file are changed according to the execution of the transaction, accumulates the generated log records in the buffer memory, and then executes the transaction. After the completion of the commit command, the log records accumulated in the buffer memory may be inserted into the log page of the log file.
  • the system of the present invention can store the log file into which the log records are inserted in the database 100, and store the database file whose contents have been changed by the transaction.
  • the transaction execution unit 300 may perform a transaction of the database file.
  • the transaction execution unit 300 may select a page of the database file to be changed, perform a transaction on the page of the selected database file, and change the contents of the database file.
  • controller 400 may control the database 100, the log file generation unit 200, and the transaction execution unit 300.
  • the controller 400 may control the transaction execution unit 300 to perform the transaction of the database file.
  • the controller 400 checks a dirty page of the pages of the database file, and logs a record of the change history for each dirty page whose content has changed.
  • the log file generator 200 may be controlled to store the generated entire log record in a log file.
  • the dirty page of the database file may mean a page whose contents are changed by performing a transaction.
  • the controller 400 generates a log record for the change history every time a page of the database file is changed, accumulates the log record generated in the buffer memory, and then executes a commit command. You can save all accumulated log records at one time to a log file.
  • the present invention does not store the entire change page every time the page of the database file is changed, and generates only the log record for the change history and stores it in the log file, so that the change and recovery of the database file is quick and fast, You can reduce the size of log files.
  • the present invention can compress the log record and store it in the log file, thereby further reducing the size of the log file.
  • the controller 400 may compare the size of the generated full log record and the size of the dirty page.
  • the log file generator 200 may be controlled to store the data in the log file.
  • the number of log records for the dirty pages also increases, so that the total accumulated log record size may be larger than the dirty pages.
  • the first logging method for storing a log record having a size larger than the dirty pages in the log file may be lowered in speed or efficiency than the second logging method for storing dirty pages in the log file.
  • the present invention compares the size of the generated total log record with the size of the dirty page, and if the size of the generated total log record is smaller than the size of the dirty page, the present invention records the entire log record generated by the first logging method. If the size of the generated total log record is larger than the size of the dirty page, the second page may store the dirty page in the log file.
  • the present invention can improve the logging speed and efficiency by selecting the first logging method or the second logging method according to the result of comparing the size of the entire log record and the size of the dirty page.
  • controller 400 generates a new additional log page and adds an overflow flag in the log page header when the number of log records inserted in the log page exceeds the free space size of the log page.
  • the generation unit 200 may be controlled.
  • the present invention can reflect all the generated log records in the log file without losing the log records.
  • the controller 400 checks the change history of the dirty page, and if a change history exists in the dirty page, generates a log record of the change history of the dirty page.
  • the controller 400 may check the change history by using a bitmap index.
  • log files when a log file is stored in a database, some log records of the pages in the log file may be lost or corrupted.
  • the present invention checks the change history of the dirty page of the database file, and if there is no change history, stores the entire dirty page on which the transaction is performed in a log file without generating a log record of the current change history, and the change history. If present, you can create a log record of the current change history and save it to a log file.
  • the entire contents of the dirty pages changed by the transaction are stored in the log file without generating the log record, so that the data of the database file can be recovered even if the log record is lost later.
  • the process of storing the entire contents of the dirty pages can be omitted.
  • the controller 400 may store a checksum in a commit log record of the log file.
  • control unit 400 stores the first checksum at the last point of the first log page when a plurality of log records generated by the specific transaction are passed from the first log page to the second log page, and A second checksum can be stored in the commit log record.
  • the checksum may be performed on a log record and a log pointer indicating the log record.
  • the controller 400 compares the contents of the checksum and the log record at the time of restoring the database file. If the contents of the checksum and the log record are different, the controller 400 determines that the corresponding transaction has failed, and in the redo process. You can exclude log records.
  • a checksum is stored in a commit log record at the time of committing a transaction, so that a corruption of the log record can be confirmed in a data recovery process, thereby preventing a recovery error.
  • the controller 400 may compress the entire log record at once and store the compressed full log record in the log file.
  • controller 400 may compress each log record individually when storing the generated full log record in the log file, and store the individually compressed full log record in the log file.
  • the present invention can reduce the size of the log file by compressing the log record, so that the change and recovery speed is fast and the efficiency is excellent.
  • FIG. 2 is a diagram showing contents stored in a database
  • FIG. 3 is a diagram showing the structure of a database file.
  • a database stores a database file 120, and the database file 120 may be configured in units of pages.
  • Each page of the database file 120 may store a record, which is information stored in an actual database.
  • a number of records 122 may be stored in one page of the database file 120.
  • the customer information list 110 may include customer information 112 such as the name, age, and gender of the customer. have.
  • the customer information 112 may be sequentially stored in each page of the database file 120, as shown in FIG.
  • Each customer information 112 may be stored in a record 122 in a corresponding page.
  • FIG. 3 shows the structure of a database file 120 in which three records 122 are stored in one page.
  • FIG. 4 is a diagram illustrating a dirty page according to a change of a database file
  • FIG. 5 is a diagram illustrating a log record generation method according to the dirty page of FIG. 4.
  • the system when a command to add a table t1 is received within page 1 of a database file, the system inserts the table t1 into page 1 of the database file according to the received command. You can change the file.
  • the table t1 is inserted into page 1 of the database file, and the existing data on page 1 of the database file can be moved to page 2 of the database file.
  • the database file may generate two dirty pages whose contents are changed as a result of the change command.
  • log records for two dirty pages whose contents are changed may be generated.
  • the log file may be very large.
  • the logging method according to the system of the present invention is a page-oriented logical logging method, in which a change history is stored for each page along with each change type, and the size of a log file.
  • a change history is stored for each page along with each change type, and the size of a log file.
  • a table t1 is inserted into page 1 of a database file, and the existing data of page 1 is inserted into page 2 of the database file into a log file for each page. Can be.
  • FIG. 6 is a view for explaining a logging mode change process according to the size of a log record.
  • the system of the present invention may generate a log record of a change history of each dirty page for each dirty page whose content has changed.
  • the system of the present invention may compare the size of the generated total log record and the size of the dirty page when storing the generated total log record in the log file.
  • the system stores the generated total log record in the log file, and if the size of the generated total log record is larger than the size of the dirty page, You can save dirty pages to a log file.
  • log records for the change history of the dirty pages 13 and 17 may be generated.
  • the total size of the log records is five log pages
  • the total size of the log records may be larger than the size of the dirty pages.
  • the logging speed and efficiency can be improved by changing the logging mode to a second logging method that stores log pages in a log file rather than a first logging method that stores log records in a log file.
  • the number of log records for the dirty page is also increased, so that the size of the accumulated total log records may be larger than the dirty pages.
  • the first logging method for storing a log record having a size larger than the dirty pages in the log file may be lowered in speed or efficiency than the second logging method for storing dirty pages in the log file.
  • the system of the present invention compares the size of the generated total log record with the size of the dirty page, and if the size of the generated total log record is smaller than the size of the dirty page, the entire log generated by the first logging method If the record is stored in the log file, and the size of the generated total log record is larger than the size of the dirty page, the second logging method may store the dirty page in the log file.
  • the present invention can improve the logging speed and efficiency by selecting the first logging method or the second logging method according to the result of comparing the size of the entire log record and the size of the dirty page.
  • FIG. 7 is a view showing the structure of a log record
  • FIG. 8 is a view showing the structure of a log file into which the log record of FIG. 7 is inserted
  • FIG. 9 is a change command list showing change commands of a database file.
  • the log file 500 is configured in log page units, and may include a log file header 510 and a plurality of log pages 520.
  • Each log page 520 may include a log page header 610 including log page information, a log pointer 620 including position and length information of each log record, and a log. It may be configured as a log record 630 including log data.
  • the log page header 610 may include at least one of a log page number, the number of log records in the log page, available space, and a flag.
  • the log pointer 620 may include a first unit 622 for storing location information of the log record 630 and a second unit 624 for storing length information of the log record 630. .
  • the log record 630 includes data necessary to redo a command for changing a database file.
  • the system of the present invention can achieve a greater performance improvement in terms of processing speed and processing efficiency.
  • the log record 630 may include a first unit 632 for storing work instruction information, a second unit 634 for storing a dirty page number of the database file 120 on which the work is performed, and a dirty page.
  • the third unit 636 may store a cell number in which a work is performed, and the fourth unit 638 may store log data according to a work command.
  • the log pointer 620 and the log record 630 may be arranged in a one-to-one correspondence with each other.
  • the number of log pointers 620 and the number of log records 630 may be the same.
  • Log pointer 620 may be generated when log record 630 is inserted into log page 520.
  • the log pointer 620 may be generated when the log record 630 is generated before the log record 630 is inserted into the log page 520.
  • the log pointer 620 is generated when the log record 630 is created or when the log record 630 is inserted into the log page, so that for each log record 630, the corresponding log pointer 620 is used. May be present.
  • the present invention can perform a logical operation satisfying the two conditions as shown in FIG. 9.
  • one logical operation must correspond to one operation for changing a database file.
  • Logical tasks of the present invention are operations related to cells in a page (Cell_Insert, Cell_Drop), operations related to the page itself (Page_alloc, Page_empty, Page_erase, Page_ stressed), operations related to B-tree balancing (Copy_Cells, Assemble_Page), and database. It can be divided into header operations, commits, and checkpoints.
  • Page_stressed has a unique feature that does not appear in other work, which is closely related to the buffer management policy of the present invention.
  • the buffer manager of the present invention basically does not reflect dirty pages of a database file modified by a specific transaction to the database file until the transaction is committed.
  • the pages modified by the PagerStress function of the present invention can be written to a database file before the transaction is committed.
  • the present invention when the logical operation to change the database file is performed by the system, generates a log record and inserts it into the log page of the log file.
  • the log record 630 is data required to redo one logical task and may be configured as shown in FIG. 7.
  • the opcode of the log record 630 indicates which of the tasks defined in FIG. 9 is performed.
  • Page Number indicates the page number of the database changed by this operation
  • Cell index indicates the number of cells in the page.
  • Data after the cell index stores necessary data according to the characteristics of the opcode.
  • the invention Since it is inefficient to undo all operations related to the page, in order to prevent this, the invention stores the original page in the Data field of the log record 630 before the modification when the PagerStress function is called.
  • the log file 500 is made up of several pages together like a database file.
  • Each log page 520 may be implemented in a slotted-page structure.
  • the log page header exists in the foremost portion of the log page 520.
  • the log page header stores the page number, the number of log entries in the page, available space (lower, upper), other flags, and the like.
  • Pointers after the page header store the start address and size (offset, length) of the log entry stored from the end of the page.
  • the nth log entry can be accessed by getting the corresponding byte from the address pointed to by Pointer n.
  • the present invention supports overflow records to minimize internal fragmentation of log pages.
  • the log record to be inserted is larger than the free space of the log page, it can be stored over two or more log pages, and managed through the overflow flag of the page header.
  • FIG. 8 illustrates a process of inserting a log record of a log file when a record is inserted into a 'address book' table to change a database file.
  • the system of the present invention may change a database file by a transaction, generate a log record of a change history of the database file, and insert the generated log record into a log page of the log file.
  • the log file including the log page resides in the buffer memory, and when a commit command for a transaction is performed, a log file corresponding to a database may be stored.
  • FIGS. 10 and 11 are diagrams for explaining the position of a log record inserted into a log page.
  • the log file of the present invention can use log pages having various structures.
  • the log page of FIG. 10 is a slotted-page structure, in which an array of pointers storing the position and length of each log record is stored from one end of the log page, and the log record is stored in the log page. The other way is to save it.
  • the log page of FIG. 11 is an append-only log page structure that stores a log header having a length of a log record and a location of a previous log record, and sequentially stores log records. That's the way.
  • a log page header 710 may be stored at a start point of the log page 700.
  • the log pointer 720 may be sequentially stored from the log page header 720 toward the end point of the log page 700 according to the order in which the log record 730 is inserted into the log page 700.
  • the log pointer 720 may include length information and position information of a corresponding current log record.
  • the log pointer 720 may include flag 722, length 724, and offset 726 information.
  • the log record 730 may be sequentially stored from the end point of the log page 700 in the direction of the start point according to the order in which the log record 730 is inserted into the log page 700.
  • a log page header 810 may be stored at a start point of the log page 800.
  • the log pointer 820 and the log record 830 are moved from the log page header 810 to the end point of the log page 800 according to the order in which the log record 830 is inserted into the log page 800. Can be stored sequentially.
  • the log pointer 820 may include length information of a corresponding current log record and position information of a previous log record.
  • the log pointer 820 may include flag 822, length 824, and previous offset 826 information.
  • the system may generate a new additional log page and add an overflow flag in the log page header when the number of log records inserted into the log page exceeds the free space size of the log page.
  • the system of the present invention can compress the entire log record at once and store the compressed whole log record in the log file when storing the generated whole log record in the log file.
  • system of the present invention may compress each log record individually when storing the generated full log record in a log file, and store the individually compressed full log record in a log file.
  • the reason for storing in this way is that the recovery speed and recovery efficiency can be greatly improved during data recovery.
  • FIG. 12 illustrates a tone page of a log file
  • FIG. 13 illustrates a bitmap index for checking a change history of a dirty page
  • FIG. 14 illustrates a log according to a change history of a dirty page. The figure shows a file.
  • the system of the present invention may generate a log record every time a command to change a database file is performed.
  • the log record may be sequentially stored in the log page of the log file in the buffer memory.
  • first, second, and third log records 1021, 1022, and 1023 are sequentially stored in the first log page 1010 of the log file in the buffer memory.
  • the first log page 1010 may be stored in a database.
  • the second and third log records 1022 and 1023 may be lost due to a failure in execution.
  • the first log page 1010 becomes the tone page 1020 in which the second and third log records 1022 and 1023 are lost, and the first log page 1010 which is the tone page 1020 at the time of data recovery. ) Cannot be used.
  • the system of the present invention checks the change history for the dirty page of the database file when executing the change command of the database file, and if the change history exists in the dirty page, By creating a log record of the change history, you can save the entire log record created in a log file.
  • the system may store the entire dirty page in a log file without generating a log record of the change history of the dirty page.
  • the system of the present invention can check the change history using a bitmap index 1030 as shown in FIG. 13.
  • bitmap index 1030 consumes only 1 bit per page of the database file
  • bitmap index 1030 can cover 32768 pages with only 4 KB.
  • the system of the present invention can expand the bitmap.
  • Bitmaps are also implemented as shared memory files, which can be used to access a database file from multiple processes.
  • the system of the present invention generates a log record of the change history of the dirty page, stores the entire log record generated in the log file, and the change history does not exist in the dirty page. Otherwise, the entire dirty page can be stored in a log file without generating a log record of the change history of the dirty page.
  • a log entry corresponding thereto is generated and stored in a log page, and upon recovery, a log record of a log page is redoed.
  • the present invention stores the log differently according to the page state of the changed database file.
  • a log entry is generated and stored in the log page.
  • bitmap which is a dirty experience bit
  • bitmap requires only 1 bit per page (0 or 1)
  • 32768 DB pages can be represented by only 4 KB.
  • bitmap is implemented as a shared memory file to support access to a DB file from multiple processes and may be stored in the form of “ ⁇ DB filename> -shm”.
  • bitmap when a page of a database file is modified by a previous transaction and the page exists in the log file, the bitmap is stored as 1, otherwise, as 0, and the bitmap is 1 Log entries are only generated for in-page translations.
  • the system of the present invention may store a checksum 1052 in a commit log record 1050 of a log file when a transaction is committed.
  • the system of the present invention stores the first checksum 1054 at the last point of the first log page when a plurality of log records generated by a particular transaction follow from the first log page to the second log page,
  • the second checksum 1056 may be stored in a commit log record of a specific transaction.
  • the checksum may be performed on a log record and a log pointer indicating the log record.
  • the system of the present invention compares the contents of the checksum and the log record at the time of restoring the database file, and if the contents of the checksum and the log record are different, determines the corresponding transaction as a failure, and in the redo process. You can exclude log records.
  • the data change method of the database management system configured as follows.
  • the system of the present invention can receive a change request of a database file.
  • the system may then perform a transaction of the database file for which change is requested.
  • the system may extract a database file requested for change from the database, perform a transaction, and change a page of the database file.
  • the system checks the dirty pages of the database file whose contents are changed by performing a transaction, and generates a log record of the change history for each dirty page whose contents have been changed.
  • the system then stores the generated full log record in the log page of the log file when a commit of the transaction is requested.
  • the system can then commit the transaction to the database, store the changed database file in the database, and store the corresponding log file in the database.
  • the system can create a commit log record when committing a transaction to the database.
  • the system may insert the generated commit log record into the log page in which the log record is stored and store the log page in the log file.
  • the log page may be stored in the buffer memory.
  • the log pages stored in the buffer memory may be deleted.
  • the system then retrieves the remaining log pages that are not stored in the log file.
  • the system may then store the remaining log pages in the log file and commit the transaction to the database if there are remaining log pages that are not stored in the log file.
  • system may generate a checkpoint log record when storing the generated full log record in a log file.
  • the system may insert the generated checkpoint log record into a log page in which the log record is stored and store the log page in a log file.
  • the log page may be stored in the buffer memory.
  • the log pages stored in the buffer memory when the log pages stored in the buffer memory are stored in the log file, the log pages stored in the buffer memory may be deleted.
  • the system retrieves the remaining log pages that are not stored in the log file, if there are any remaining log pages that are not stored in the log file, the system stores the remaining log pages in the log file, and logs the entire log record generated. You can save it to a file.
  • 16 is a flowchart illustrating a data recovery method of a database management system according to an embodiment of the present invention.
  • the system of the present invention may receive a data recovery request.
  • the system searches for the reverse log from the last log record of the log file to the last commit log record (S30), and checks whether the original page for the database file to be recovered exists. S40)
  • the system stores the original page in the database file (S50).
  • the system of the present invention searches in order from the last checkpoint log record of the log file to the last commit log record (S60), and checks whether log records exist between them (S70).
  • the system of the present invention searches the log record of the log file (S90) and checks whether the log record exists after the last commit log record of the log file (S100).
  • the system deletes the corresponding log record (S110).
  • the present invention can log only the operation for changing the DB file for each page without logging the entire changed page, thereby reducing the size of the log file and lowering the overall I / O load.
  • a checkpoint speed is faster than that of a WAL method requiring an additional migration cost, and thus, an ANR (Appplication Not Responding) You can solve the problem.
  • the WAL method is disadvantageous in the selection operation because the WAL file is unconditionally searched at the time of reading, but in the present invention, the search cost is lower because only the DB file is searched.
  • the present invention shows superior performance than other methods, and can solve the problems of the existing methods.
  • the present invention can perform data recovery in various situations.
  • the present invention enables data recovery in a transaction failure situation.
  • Transaction failures are caused by overflows, resource shortages, deadlocks, etc. In this case, the transaction must be rolled back and returned to the state just before the start of the transaction.
  • the present invention reverses the search from the last record stored in the log page to the previous commit record when the transaction is rolled back.
  • the present invention enables data recovery in a system crash situation.
  • a system crash is a data malfunction of a volatile storage device due to a hardware malfunction, a bug in a database software or an operating system, etc., and interrupts execution of a transaction.
  • the present invention can cope with the following situations caused by a system crash.
  • the present invention processes the Pager_stressed log record and deletes the log record associated with the transaction.
  • a log file contains a commit log of a transaction in the event of a system crash
  • the log file contains all the data for redoing the transaction
  • the database file contains all the changes made by the transaction. It is not known whether it is reflected.
  • the present invention may redo all log records associated with the transaction while performing a recovery algorithm.
  • the present invention enables data recovery in a disk failure situation.
  • the data of the disc block may be lost.
  • the log file stores the page so that data can be recovered.
  • 17 to 20 are diagrams illustrating a recovery performance of a database management system according to an embodiment of the present invention.
  • FIG. 17 is a graph comparing execution times according to the number of checkpoints using RL benchmarks.
  • the DWAL method of the present invention shows that the execution time is reduced by about 13.4-22.85% compared to the conventional WAL method.
  • the recovery method of the present invention can reduce the recovery time as compared to the existing method.
  • 18 is a graph comparing the time taken to insert 1000 log records into a log file at one time without performing an initial commit.
  • 50, 1000, and 1000000 of the horizontal axis mean the range of execution of the checkpoint.
  • the DWAL method of the present invention has a faster execution processing time than the conventional WAL method. have.
  • the recovery method of the present invention has about 2 to about 6 times better performance than the conventional method.
  • 19 is a graph comparing the time taken to insert 25000 log records into a log file at a time when a plurality of transactions are performed.
  • 5, 10, 20, 50, and 100 on the horizontal axis mean the number of log records inserted per single transaction.
  • the DWAL method of the present invention has a faster execution processing time than the conventional WAL method. have.
  • the recovery method of the present invention shows better performance than the existing method.
  • 20 is a table in which the size of the log file generated is measured using an RL benchmark.
  • the present invention compares the size of a dirty page with the size of an entire log record, and if the size of the generated total log record is smaller than the size of the dirty page, a first logging method for storing the generated total log record in a log file If the size of the generated total log record is larger than the size of the dirty page, the second logging method of storing the dirty page in the log file may be performed.
  • the first logging method is a page-oriented logging only method for logging only the change history
  • the second logging method is based on a result of comparing the size of the dirty page with the size of the entire log record.
  • Bimodal logging method selects small logs among logs.
  • the present invention can reduce the size of the log file and lower the overall input / output load by logging only an operation for changing the database file for each page without logging the entire changed page.
  • the checkpoint speed can be improved compared to the WAL method that requires an additional migration cost. Application Not Responding).
  • the present invention is disadvantageous in the selection operation because the WAL file must be searched once unconditionally in the case of reading, but in the present invention, since only the database file is searched, the search cost can be lowered. have.
  • the present invention described above can be embodied as computer readable codes on a medium in which a program is recorded.
  • the computer-readable medium includes all kinds of recording devices in which data that can be read by a computer system is stored. Examples of computer-readable media include ROM, RAM, CD-ROM, magnetic tape, floppy disks, optical data storage devices, and the like, which are also implemented in the form of carrier waves (eg, transmission over the Internet). It also includes.
  • the computer may include a control unit of the terminal.
  • the present invention is used in the field related to a database management system that enables data to be changed and recovered.

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Library & Information Science (AREA)

Abstract

The present invention relates to a database management system which enables data to be modified and recovered, and a data modification and recovery method thereof. The database management system comprises: a database for storing a database file configured in units of pages; a log file generation unit for generating a log file of a database file for which transaction has been performed; a transaction performance unit for performing transaction of a database file; and a control unit for controlling the database, the log file generation unit, and the transaction performance unit, wherein the control unit can control the transaction performance unit to perform transaction of a database file when transaction of the database file is requested, and control the log file generation unit to generate a log record of modification details of each dirty page, a content of which has been modified, among pages of the database file when transaction of the database file is performed, and to store the entire generated log record in a log file when the transaction is committed to the database.

Description

데이터베이스 관리 시스템 및 그의 데이터 변경 및 복구 방법Database management system and its data change and recovery method
본 발명은 데이터를 변경 및 복구할 수 있도록 하는 데이터베이스 관리 시스템 및 및 그의 데이터 변경 및 복구 방법에 관한 것이다.The present invention relates to a database management system and a method for altering and recovering data thereof, which enable to change and recover data.
일반적으로, 데이터베이스 관리 시스템(database management system)은, 기본적으로 전력 이상이나 시스템 이상으로 문제가 생겼을 때, 데이터의 일관성을 유지할 수 있도록, 고유의 로깅(logging) 방식과 로그(log)를 통한 데이터 복구 방법을 지원할 수 있다.In general, a database management system recovers data through its own logging method and log to maintain data consistency in the event of power failure or system failure. Can support the method.
따라서, 데이터베이스 관리 시스템은, 트랜잭션(transaction), 프로그램, 시스템 등의 실패(failure)로 인하여 데이터가 손실될 경우, 데이터를 복구해 줄 수 있는 매커니즘을 포함할 수 있다.Accordingly, the database management system may include a mechanism for recovering data when data is lost due to a failure of a transaction, a program, a system, or the like.
데이터베이스 관리 시스템의 데이터 복구 방식은, 다양한 방식들을 가지고 있는데, 특히, 이동 단말기에서 사용되는 다양한 어플리케이션들은, RBJ(Rollback Journal) 방식이나 WAL(Write Ahead Log) 방식 등을 사용하고 있다.The data recovery method of the database management system has various methods. In particular, various applications used in the mobile terminal use a rollback journal (RWB) method or a write ahead log (WAL) method.
여기서, RBJ 방식은, 쓰기 연산이 발생하는 경우, 원본 데이터를 백업하고 이를 데이터베이스에 적용하는 방식이고, WAL 방식은, 원본 데이터를 데이터베이스 파일에 유지하고, 변경된 페이지를 WAL 파일에 저장하는 방식이다.Here, the RBJ method is a method of backing up original data and applying it to a database when a write operation occurs, and the WAL method is a method of maintaining original data in a database file and storing changed pages in a WAL file.
하지만, RBJ 방식과 WAL 방식은, 변경되지 않는 데이터까지도 백업해야 하는 문제가 있었다.However, the RBJ method and the WAL method have a problem of backing up data that does not change.
일 예로, RBJ 방식과 WAL 방식은, 페이지 내에서, 변경된 데이터는 일부분에 불과하지만, 변경된 데이터를 포함하는 페이지 전체를 저장해야 한다.For example, in the RBJ and WAL schemes, only a part of changed data is stored in the page, but the entire page including the changed data must be stored.
또한, WAL 방식은, 읽기 연산을 수행할 때마다, 로그 파일을 탐색해야 하는 문제가 있었다.In addition, the WAL method has a problem that a log file must be searched every time a read operation is performed.
일 예로, WAL 방식은, 최신 수정 사항이 WAL 파일에 존재하므로, 읽기 연산이 수행되면, WAL 파일을 무조건 한 번 검색해야 한다.For example, in the WAL method, since the latest modification exists in the WAL file, when a read operation is performed, the WAL file must be searched once.
또한, WAL 방식은, 체크 포인트 연산이 지연되는 문제가 있었다.In addition, the WAL method has a problem that the checkpoint operation is delayed.
일 예로, WAL 방식은, 데이터에 읽기 잠금이 걸려 있는 경우, 체크 포인트의 연산을 수행하지 못하므로, WAL 파일이 데이터베이스 파일보다 수십 배 또는 수백 배 이상 커지는 경우가 발생할 수 있다.For example, the WAL method may not perform a checkpoint operation when a read lock is applied to data, and thus a WAL file may be tens or hundreds of times larger than a database file.
이와 같이, 기존의 데이터 복구 방식은, 데이터를 복구하는 시간이 너무 느려 많은 시간이 소요되고, 데이터 복구가 불안정한 문제들이 있었다.As described above, the conventional data recovery method has a problem that data recovery is too slow and takes a lot of time, and data recovery is unstable.
본 발명은 전술한 문제 및 다른 문제를 해결하는 것을 목적으로 한다. 또 다른 목적은, 로그 파일의 크기를 줄이고 전체 입출력 부하를 낮출 수 있는 데이터베이스 관리 시스템 및 그의 데이터 변경 및 복구 방법을 제공하는 것을 목적으로 한다.It is an object of the present invention to solve the above and other problems. Another object is to provide a database management system and its data change and recovery method that can reduce the size of log files and lower the overall I / O load.
또 다른 목적은, 체크포인트 속도를 개선할 수 있는 데이터베이스 관리 시스템 및 그의 데이터 변경 및 복구 방법을 제공하는 것을 목적으로 한다.Another object is to provide a database management system capable of improving checkpoint speed and a method of data change and recovery thereof.
또 다른 목적은, 검색 비용을 낮출 수 있는 데이터베이스 관리 시스템 및 그의 데이터 변경 및 복구 방법을 제공하는 것을 목적으로 한다.Another object is to provide a database management system and its data alteration and recovery method which can lower the cost of retrieval.
본 발명에서 이루고자 하는 기술적 과제들은 이상에서 언급한 기술적 과제들로 제한되지 않으며, 언급하지 않은 또 다른 기술적 과제들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The technical problems to be achieved in the present invention are not limited to the technical problems mentioned above, and other technical problems not mentioned above will be clearly understood by those skilled in the art from the following description. Could be.
본 발명의 일 실시예에 의한 데이터베이스 관리 시스템은, 페이지 단위로 구성된 데이터베이스 파일을 저장하는 데이터베이스와, 트랜잭션(transaction)이 수행된 데이터베이스 파일에 대한 로그 파일을 생성하는 로그 파일 생성부와, 데이터베이스 파일의 트랜잭션을 수행하는 트랜잭션 수행부와, 데이터베이스, 로그 파일 생성부 및 트랜잭션 수행부를 제어하는 제어부를 포함하고, 제어부는, 데이터베이스 파일의 트랜잭션이 요청되면, 데이터베이스 파일의 트랜잭션을 수행하도록, 트랜잭션 수행부를 제어하고, 데이터베이스 파일의 트랜잭션이 수행되면, 데이터베이스 파일의 페이지들 중, 내용이 변경된 더티 페이지(dirty page) 별로, 변경 내역에 대한 로그 레코드(log record)를 생성하고, 데이터베이스에 트랜잭션이 커밋(commit)되면, 생성된 전체 로그 레코드를 로그 파일에 저장하도록, 로그 파일 생성부를 제어할 수 있다.A database management system according to an embodiment of the present invention includes a database storing a database file configured in units of pages, a log file generating unit generating a log file for a database file on which a transaction is performed, and a database file. And a control unit for controlling a transaction, and a control unit for controlling a database, a log file generation unit, and a transaction execution unit, wherein the control unit controls the transaction execution unit to perform a transaction of the database file when a transaction of the database file is requested. When a transaction of a database file is performed, a log record of the change history is generated for each dirty page of contents of the database file, and when a transaction is committed to the database. , Generated full log levels The log file generator can be controlled to store code in a log file.
본 발명의 일 실시예에 의한 데이터베이스 관리 시스템의 데이터 변경 방법은, 데이터베이스 파일의 변경 요청을 수신하는 단계와, 변경 요청된 데이터베이스 파일의 트랜잭션을 수행하는 단계와, 트랜잭션이 수행된 데이터베이스 파일의 더티 페이지(dirty page)를 확인하여, 내용이 변경된 더티 페이지 별로, 변경 내역에 대한 로그 레코드(log record)를 생성하는 단계와, 트랜잭션의 커밋(commit)이 요청되면, 생성된 전체 로그 레코드를 로그 파일의 로그 페이지에 저장하는 단계와, 트랜잭션을 데이터베이스에 커밋하는 단계를 포함할 수 있다.A data change method of a database management system according to an embodiment of the present invention includes receiving a change request of a database file, performing a transaction of a change requested database file, and dirty pages of a database file on which a transaction is performed. Checking the dirty page, for each dirty page whose contents have been changed, generating a log record of the change history, and when a transaction commit is requested, the generated whole log record is stored in the log file. Saving to a log page and committing the transaction to the database.
본 발명의 일 실시예에 의한 데이터베이스 관리 시스템의 데이터 복구 방법은, 데이터 복구 요청을 수신하는 단계와, 복구하고자 하는 데이터베이스 파일에 대한 로그 파일의 존재를 확인하는 단계와, 로그 파일이 존재하면, 로그 파일의 마지막 로그 레코드로부터 마지막 커밋 로그 레코드까지 역순서로 검색하여, 복구하고자 하는 데이터베이스 파일에 대한 원본 페이지가 존재하는지를 확인하는 단계와, 원본 페이지가 존재하면, 원본 페이지를 상기 데이터베이스 파일에 저장하는 단계와, 로그 파일의 마지막 체크포인트 로그 레코드로부터 마지막 커밋 로그 레코드까지 정순서로 검색하여, 그들 사이에 존재하는 로그 레코드를 재수행하는 단계와, 로그 파일의 마지막 커밋 로그 레코드 이후에 존재하는 로그 레코드를 삭제하는 단계를 포함할 수 있다.A data recovery method of a database management system according to an embodiment of the present invention includes the steps of receiving a data recovery request, checking the existence of a log file for a database file to be restored, and if the log file exists, Searching from the last log record in the file to the last commit log record in reverse order to determine if the original page exists for the database file to be recovered; if the original page exists, storing the original page in the database file; Retrieving log records that exist between them from the last checkpoint log record in the log file to the last commit log record, and deleting the log records that existed since the last commit log record in the log file. May include All.
본 발명에 따른 데이터베이스 관리 시스템 및 그의 데이터 변경 및 복구 방법의 효과에 대해 설명하면 다음과 같다.The effects of the database management system and the data change and recovery method thereof according to the present invention will be described below.
본 발명의 실시예들 중 적어도 하나에 의하면, 변경된 페이지 전체를 로깅하지 않고 페이지마다 데이터베이스 파일을 변경하는 연산만을 로깅함으로써, 로그 파일의 크기를 줄이고 전체 입/출력 부하를 낮출 수 있다.According to at least one of the embodiments of the present invention, by logging only the operation for changing the database file for each page without logging the entire changed page, it is possible to reduce the size of the log file and lower the overall input / output load.
본 발명의 실시예들 중 적어도 하나에 의하면, 체크 포인트 시, 데이터베이스 파일에 대한 싱크(sync) 연산만을 수행하므로, 추가적인 마이그레이션 비용(migration cost)가 필요한 WAL 방식에 비해, 체크포인트 속도를 개선할 수 있으며, 이를 통해 ANR(Application Not Responding)의 문제 해결이 가능하다.According to at least one of the embodiments of the present invention, since only a sync operation is performed on the database file at the checkpoint, the checkpoint speed may be improved as compared to the WAL method requiring an additional migration cost. In this way, it is possible to solve the problem of ANR (Application Not Responding).
본 발명의 실시예들 중 적어도 하나에 의하면, 읽기 시, WAL 방식의 경우, WAL 파일을 무조건 한 번 검색해야 하므로, 선택(select) 연산에 불리하지만, 본 발명의 경우, 데이터베이스 파일만을 검색하므로, 검색 비용을 더 낮출 수 있다.According to at least one of the embodiments of the present invention, in the case of the WAL method, at the time of reading, the WAL file must be searched once unconditionally, but it is disadvantageous to the select operation. Search costs can be lowered further.
본 발명의 적용 가능성의 추가적인 범위는 이하의 상세한 설명으로부터 명백해질 것이다. 그러나 본 발명의 사상 및 범위 내에서 다양한 변경 및 수정은 당업자에게 명확하게 이해될 수 있으므로, 상세한 설명 및 본 발명의 바람직한 실시 예와 같은 특정 실시 예는 단지 예시로 주어진 것으로 이해되어야 한다.Further scope of the applicability of the present invention will become apparent from the following detailed description. However, various changes and modifications within the spirit and scope of the present invention can be clearly understood by those skilled in the art, and therefore, specific embodiments, such as the detailed description and the preferred embodiments of the present invention, should be understood as given by way of example only.
도 1은 본 발명 일 실시예에 따른 데이터베이스 관리 시스템을 보여주는 블럭 구성도이다.1 is a block diagram showing a database management system according to an embodiment of the present invention.
도 2는 데이터베이스에 저장되는 컨텐츠를 보여주는 도면이다.2 is a diagram illustrating contents stored in a database.
도 3은 데이터베이스 파일의 구조를 보여주는 도면이다.3 is a diagram showing the structure of a database file.
도 4는 데이터베이스 파일의 변경에 따른 더티 페이지를 보여주는 도면이다.4 is a diagram illustrating a dirty page according to a change of a database file.
도 5는 도 4의 더티 페이지에 따른 로그 레코드 생성 방식을 보여주는 도면이다.5 is a diagram illustrating a log record generation method according to the dirty page of FIG. 4.
도 6은 로그 레코드의 크기에 따른 로깅 모드 변경 과정을 설명하기 위한 도면이다.6 is a view for explaining a logging mode change process according to the size of a log record.
도 7은 로그 레코드의 구조를 보여주는 도면이다.7 is a diagram showing the structure of a log record.
도 8은 도 7의 로그 레코드가 삽입되는 로그 파일의 구조를 보여주는 도면이다.8 is a diagram illustrating the structure of a log file into which the log record of FIG. 7 is inserted.
도 9는 데이터베이스 파일의 변경 명령들을 보여주는 변경 명령 리스트이다.9 is a change command list showing change commands of a database file.
도 10 및 도 11은 로그 페이지 내에 삽입되는 로그 레코드의 위치를 설명하기 위한 도면이다.10 and 11 are diagrams for explaining the position of a log record inserted into a log page.
도 12는 로그 파일의 톤 페이지(torn page)를 설명하기 위한 도면이다.12 is a diagram for describing a tone page of a log file.
도 13은 더티 페이지의 변경 이력을 체크하기 위한 비트맵 인덱스를 보여주는 도면이다.FIG. 13 is a diagram illustrating a bitmap index for checking a change history of a dirty page. FIG.
도 14는 더티 페이지의 변경 이력에 따른 로그 파일을 보여주는 도면이다.14 illustrates a log file according to a change history of a dirty page.
도 15는 체크섬이 저장된 로그 페이지를 보여주는 도면이다.15 illustrates a log page in which a checksum is stored.
도 16은 본 발명 일 실시예에 따른 데이터베이스 관리 시스템의 데이터 복구 방법을 설명하기 위한 흐름도이다.16 is a flowchart illustrating a data recovery method of a database management system according to an embodiment of the present invention.
도 17 내지 도 20은 본 발명 일 실시예에 따른 데이터베이스 관리 시스템의 복구 성능을 보여주는 도면이다.17 to 20 are diagrams illustrating a recovery performance of a database management system according to an embodiment of the present invention.
이하, 첨부된 도면을 참조하여 본 명세서에 개시된 실시 예를 상세히 설명하되, 도면 부호에 관계없이 동일하거나 유사한 구성요소는 동일한 참조 번호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 이하의 설명에서 사용되는 구성요소에 대한 접미사 "모듈" 및 "부"는 명세서 작성의 용이함만이 고려되어 부여되거나 혼용되는 것으로서, 그 자체로 서로 구별되는 의미 또는 역할을 갖는 것은 아니다. 또한, 본 명세서에 개시된 실시 예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 본 명세서에 개시된 실시 예의 요지를 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다. 또한, 첨부된 도면은 본 명세서에 개시된 실시 예를 쉽게 이해할 수 있도록 하기 위한 것일 뿐, 첨부된 도면에 의해 본 명세서에 개시된 기술적 사상이 제한되지 않으며, 본 발명의 사상 및 기술 범위에 포함되는 모든 변경, 균등물 내지 대체물을 포함하는 것으로 이해되어야 한다. Hereinafter, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings, and the same or similar components are denoted by the same reference numerals regardless of the reference numerals, and redundant description thereof will be omitted. The suffixes "module" and "unit" for components used in the following description are given or used in consideration of ease of specification, and do not have distinct meanings or roles from each other. In addition, in describing the embodiments disclosed herein, when it is determined that the detailed description of the related known technology may obscure the gist of the embodiments disclosed herein, the detailed description thereof will be omitted. In addition, the accompanying drawings are intended to facilitate understanding of the embodiments disclosed herein, but are not limited to the technical spirit disclosed herein by the accompanying drawings, all changes included in the spirit and scope of the present invention. It should be understood to include equivalents and substitutes.
제1, 제2 등과 같이 서수를 포함하는 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되지는 않는다. 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다.Terms including ordinal numbers such as first and second may be used to describe various components, but the components are not limited by the terms. The terms are used only for the purpose of distinguishing one component from another.
어떤 구성요소가 다른 구성요소에 "연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 그 다른 구성요소에 직접적으로 연결되어 있거나 또는 접속되어 있을 수도 있지만, 중간에 다른 구성요소가 존재할 수도 있다고 이해되어야 할 것이다. 반면에, 어떤 구성요소가 다른 구성요소에 "직접 연결되어" 있다거나 "직접 접속되어" 있다고 언급된 때에는, 중간에 다른 구성요소가 존재하지 않는 것으로 이해되어야 할 것이다.When a component is referred to as being "connected" or "connected" to another component, it may be directly connected to or connected to that other component, but it may be understood that other components may be present in between. Should be. On the other hand, when a component is said to be "directly connected" or "directly connected" to another component, it should be understood that there is no other component in between.
단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. Singular expressions include plural expressions unless the context clearly indicates otherwise.
본 출원에서, "포함한다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.In this application, the terms "comprises" or "having" are intended to indicate that there is a feature, number, step, operation, component, part, or combination thereof described in the specification, and one or more other features. It is to be understood that the present invention does not exclude the possibility of the presence or the addition of numbers, steps, operations, components, components, or a combination thereof.
도 1은 본 발명 일 실시예에 따른 데이터베이스 관리 시스템을 보여주는 블럭 구성도이다.1 is a block diagram showing a database management system according to an embodiment of the present invention.
도 1에 도시된 바와 같이, 본 발명의 데이터베이스 관리 시스템은, 데이터베이스(100), 로그 파일(log file) 생성부(200), 트랜잭션(transaction) 수행부(300) 및 제어부(400)를 포함할 수 있다.As shown in FIG. 1, the database management system of the present invention may include a database 100, a log file generator 200, a transaction performer 300, and a controller 400. Can be.
여기서, 데이터베이스(100)는, 페이지 단위로 구성된 데이터베이스 파일(DB file)을 저장할 수 있다.Here, the database 100 may store a database file (DB file) configured in units of pages.
데이터베이스(100)는, 데이터가 파일로 저장되는 데이터베이스 파일을 포함할 수 있다.The database 100 may include a database file in which data is stored as a file.
데이터베이스 파일은, 페이지 단위로 구성되는데, 각 페이지에는, 실제 데이터베이스에 저장되는 정보인 레코드(record)가 저장될 수 있다.The database file is composed of pages, and each page may store a record, which is information stored in an actual database.
따라서, 데이터베이스 파일의 하나의 페이지에는, 다수의 레코드들이 저장될 수 있다.Thus, in one page of the database file, multiple records can be stored.
그리고, 로그 파일 생성부(200)는, 트랜잭션(transaction)이 수행된 데이터베이스 파일에 대한 로그 파일을 생성할 수 있다.The log file generation unit 200 may generate a log file for a database file on which a transaction is performed.
여기서, 로그 파일 생성부(200)는, 트랜잭션의 수행에 의해, 데이터베이스 파일이 변경되면, 변경된 내용에 대한 정보들이 저장된 로그 파일을 생성할 수 있다.Here, the log file generating unit 200 may generate a log file in which information on the changed contents is stored when the database file is changed by performing a transaction.
따라서, 본 발명의 시스템은, 데이터베이스 파일의 복구시, 로그 파일을 이용하여, 손상된 데이터를 복구할 수 있다.Therefore, the system of the present invention can recover damaged data by using a log file when recovering a database file.
로그 파일 생성부(200)는, 트랜잭션의 수행에 따라, 데이터베이스 파일의 내용이 변경될 때 마다, 변경된 내용을 포함하는 로그 레코드를 생성하고, 생성된 로그 레코드를 버퍼 메모리에 축적한 다음, 트랜잭션 수행이 완료되고, 커밋(commit) 명령을 수행할 때, 버퍼 메모리에 축적된 로그 레코드들을 로그 파일의 로그 페이지에 삽입할 수 있다.The log file generating unit 200 generates a log record including the changed contents every time the contents of the database file are changed according to the execution of the transaction, accumulates the generated log records in the buffer memory, and then executes the transaction. After the completion of the commit command, the log records accumulated in the buffer memory may be inserted into the log page of the log file.
따라서, 본 발명의 시스템은, 로그 레코드들이 삽입된 로그 파일을 데이터베이스(100)에 저장하고, 트랜잭션 수행에 의해, 내용이 변경된 데이터베이스 파일을 데이터베이스(100)에 저장할 수 있다.Therefore, the system of the present invention can store the log file into which the log records are inserted in the database 100, and store the database file whose contents have been changed by the transaction.
다음, 트랜잭션 수행부(300)는, 데이터베이스 파일의 트랜잭션을 수행할 수 있다.Next, the transaction execution unit 300 may perform a transaction of the database file.
여기서, 트랜잭션 수행부(300)는, 변경하고자 하는 데이터베이스 파일의 페이지를 선택하고, 선택된 데이터베이스 파일의 페이지에 대한 트랜잭션을 수행하여, 데이터베이스 파일의 내용을 변경할 수 있다.Here, the transaction execution unit 300 may select a page of the database file to be changed, perform a transaction on the page of the selected database file, and change the contents of the database file.
이어, 제어부(400)는, 데이터베이스(100), 로그 파일 생성부(200) 및 트랜잭션 수행부(300)를 제어할 수 있다.Subsequently, the controller 400 may control the database 100, the log file generation unit 200, and the transaction execution unit 300.
여기서, 제어부(400)는, 데이터베이스 파일의 트랜잭션이 요청되면, 데이터베이스 파일의 트랜잭션을 수행하도록, 트랜잭션 수행부(300)를 제어할 수 있다.Herein, when the transaction of the database file is requested, the controller 400 may control the transaction execution unit 300 to perform the transaction of the database file.
그리고, 제어부(400)는, 데이터베이스 파일의 트랜잭션이 수행되면, 데이터베이스 파일의 페이지들 중, 더티 페이지(dirty page)를 확인하여, 내용이 변경된 더티 페이지 별로, 변경 내역에 대한 로그 레코드(log record)를 생성하고, 데이터베이스(100)에 트랜잭션이 커밋(commit)되면, 생성된 전체 로그 레코드를 로그 파일에 저장하도록, 로그 파일 생성부(200)를 제어할 수 있다.When the transaction of the database file is performed, the controller 400 checks a dirty page of the pages of the database file, and logs a record of the change history for each dirty page whose content has changed. When the transaction is committed to the database 100, the log file generator 200 may be controlled to store the generated entire log record in a log file.
여기서, 데이터베이스 파일의 더티 페이지는, 트랜잭션 수행에 의해, 내용이 변경된 페이지를 의미할 수 있다.Here, the dirty page of the database file may mean a page whose contents are changed by performing a transaction.
즉, 제어부(400)는, 트랜잭션이 수행되어, 데이터베이스 파일의 페이지가 변경될 때마다, 변경 내역에 대한 로그 레코드를 생성하여 버퍼 메모리에 생성된 로그 레코드를 축적한 다음, 커밋 명령 수행시에, 축적된 전체 로그 레코드를 한 번에 로그 파일에 저장할 수 있다.That is, the controller 400 generates a log record for the change history every time a page of the database file is changed, accumulates the log record generated in the buffer memory, and then executes a commit command. You can save all accumulated log records at one time to a log file.
따라서, 본 발명은, 데이터베이스 파일의 페이지가 변경될 때마다, 변경 페이지 전체를 저장하지 않고, 변경 내역에 대한 로그 레코드만을 생성하여 로그 파일에 저장하므로, 데이터베이스 파일의 변경 및 복구가 신속하고 빠르며, 로그 파일의 크기를 줄일 수 있다.Therefore, the present invention does not store the entire change page every time the page of the database file is changed, and generates only the log record for the change history and stores it in the log file, so that the change and recovery of the database file is quick and fast, You can reduce the size of log files.
또한, 본 발명은, 로그 레코드를 압축하여 로그 파일에 저장할 수 있으므로, 로그 파일의 크기를 더욱 줄일 수도 있다.In addition, the present invention can compress the log record and store it in the log file, thereby further reducing the size of the log file.
다음, 제어부(400)는, 생성된 전체 로그 레코드를 로그 파일에 저장할 때, 생성된 전체 로그 레코드의 크기와 더티 페이지의 크기를 비교할 수 있다.Next, when storing the generated full log record in the log file, the controller 400 may compare the size of the generated full log record and the size of the dirty page.
일 예로, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 작으면, 생성된 전체 로그 레코드를 로그 파일에 저장하고, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 크면, 더티 페이지를 로그 파일에 저장하도록, 로그 파일 생성부(200)를 제어할 수 있다.For example, if the size of the generated total log record is smaller than the size of the dirty page, store the generated total log record in the log file.If the size of the generated total log record is larger than the size of the dirty page, the dirty page The log file generator 200 may be controlled to store the data in the log file.
예를 들면, 하나의 더티 페이지에 대해 많은 변경이 있는 경우, 더티 페이지에 대한 로그 레코드의 개수도 많아져서, 축적된 전체 로그 레코드의 크기가 더티 페이지보다 더 클 수가 있다.For example, if there are many changes to one dirty page, the number of log records for the dirty pages also increases, so that the total accumulated log record size may be larger than the dirty pages.
이 경우, 더티 페이지보다 큰 크기의 로그 레코드를 로그 파일에 저장하는 제 1 로깅 방식은, 더티 페이지를 로그 파일에 저장하는 제 2 로깅 방식보다 속도면이나 효율면에서 저하될 수 있다.In this case, the first logging method for storing a log record having a size larger than the dirty pages in the log file may be lowered in speed or efficiency than the second logging method for storing dirty pages in the log file.
따라서, 본 발명은, 생성된 전체 로그 레코드의 크기와 더티 페이지의 크기를 비교하여, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 작으면, 제 1 로깅 방식으로 생성된 전체 로그 레코드를 로그 파일에 저장하고, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 크면, 제 2 로깅 방식으로, 더티 페이지를 로그 파일에 저장할 수 있다.Accordingly, the present invention compares the size of the generated total log record with the size of the dirty page, and if the size of the generated total log record is smaller than the size of the dirty page, the present invention records the entire log record generated by the first logging method. If the size of the generated total log record is larger than the size of the dirty page, the second page may store the dirty page in the log file.
그러므로, 본 발명은, 생성된 전체 로그 레코드의 크기와 더티 페이지의 크기를 비교 결과에 따라, 제 1 로깅 방식 또는 제 2 로깅 방식을 선택함으로써, 로깅 속도 및 효율을 향상시킬 수 있다.Therefore, the present invention can improve the logging speed and efficiency by selecting the first logging method or the second logging method according to the result of comparing the size of the entire log record and the size of the dirty page.
또한, 제어부(400)는, 로그 페이지 내에 삽입되는 로그 레코드의 개수가, 로그 페이지의 빈 공간 크기를 초과하면, 새로운 추가 로그 페이지를 생성하고, 로그 페이지 헤더 내에 오버플로우 플래그를 추가하도록, 로그 파일 생성부(200)를 제어할 수 있다.In addition, the controller 400 generates a new additional log page and adds an overflow flag in the log page header when the number of log records inserted in the log page exceeds the free space size of the log page. The generation unit 200 may be controlled.
따라서, 본 발명은, 로그 레코드의 개수가 로그 페이지를 초과하여도, 로그 레코드의 손실 없이, 생성된 모든 로그 레코드를 로그 파일에 모두 반영할 수 있다.Therefore, even if the number of log records exceeds the log page, the present invention can reflect all the generated log records in the log file without losing the log records.
그리고, 제어부(400)는, 데이터베이스 파일의 더티 페이지를 확인할 때, 더티 페이지에 대한 변경 이력을 확인하고, 더티 페이지에 변경 이력이 존재하면, 더티 페이지의 변경 내역에 대한 로그 레코드를 생성하여, 생성된 전체 로그 레코드를 로그 파일에 저장하고, 더티 페이지에 변경 이력이 존재하지 않으면, 더티 페이지의 변경 내역에 대한 로그 레코드 생성 없이, 더티 페이지 전체를 로그 파일에 저장하도록, 로그 파일 생성부(200)를 제어할 수 있다.When the dirty page of the database file is checked, the controller 400 checks the change history of the dirty page, and if a change history exists in the dirty page, generates a log record of the change history of the dirty page. The stored log file in the log file, and if there is no change history on the dirty page, the log file generator 200 to store the entire dirty page in the log file without generating a log record for the change history of the dirty page. Can be controlled.
여기서, 제어부(400)는, 더티 페이지에 대한 변경 이력을 확인할 때, 비트맵 인덱스(bitmap index)를 이용하여 변경 이력을 확인할 수 있다.In this case, when the change history on the dirty page is checked, the controller 400 may check the change history by using a bitmap index.
예를 들면, 로그 파일이 데이터베이스에 저장될 때, 로그 파일 내의 페이지 중, 일부 로그 레코드는, 손실되거나 손상될 수 있다.For example, when a log file is stored in a database, some log records of the pages in the log file may be lost or corrupted.
따라서, 본 발명은, 데이터베이스 파일의 더티 페이지에 대한 변경 이력을 확인하고, 변경 이력이 없으면, 현재 변경 내역에 대한 로그 레코드 생성 없이, 트랜잭션이 수행된 더티 페이지 전체를 로그 파일에 저장하고, 변경 이력이 있으면, 현재 변경 내역에 대한 로그 레코드를 생성하여 로그 파일에 저장할 수 있다.Therefore, the present invention checks the change history of the dirty page of the database file, and if there is no change history, stores the entire dirty page on which the transaction is performed in a log file without generating a log record of the current change history, and the change history. If present, you can create a log record of the current change history and save it to a log file.
즉, 본 발명은, 변경 이력이 없으면, 로그 레코드 생성 없이, 트랜젝션에 의해 변경된 더티 페이지의 전체 내용을, 로그 파일에 저장함으로써, 추후 로그 레코드의 손실이 있어도 데이터베이스 파일의 데이터 복구가 가능하다.That is, according to the present invention, if there is no change history, the entire contents of the dirty pages changed by the transaction are stored in the log file without generating the log record, so that the data of the database file can be recovered even if the log record is lost later.
또한, 본 발명은, 변경 이력이 있으면, 이전에 이미 더티 페이지의 전체 내용이 로그 파일에 저장되어 있으므로, 더티 페이지의 전체 내용을 저장하는 과정을 생략할 수 있다.In addition, according to the present invention, if there is a change history, since the entire contents of the dirty pages are previously stored in the log file, the process of storing the entire contents of the dirty pages can be omitted.
따라서, 본 발명은, 일부 로그 레코드가 손실된 톤 페이지(torn page)를 포함하는 로그 파일이 존재하여도, 최초 트랜잭션이 수행된 원본 페이지가 로그 파일에 존재하므로, 데이터베이스 파일의 데이터 복구가 가능하다.Therefore, in the present invention, even if there is a log file including a ton page in which some log records are lost, the original page on which the initial transaction is performed exists in the log file, thereby enabling data recovery of the database file. .
다음, 제어부(400)는, 트랜잭션이 커밋될 때, 로그 파일의 커밋 로그 레코드(commit log record)에 체크섬(checksum)을 저장할 수 있다.Next, when the transaction is committed, the controller 400 may store a checksum in a commit log record of the log file.
여기서, 제어부(400)는, 특정 트랜잭션에 의해 생성된 다수의 로그 레코드들이 제 1 로그 페이지로부터 제 2 로그 페이지로 이어질 때, 제 1 로그 페이지의 마지막 지점에 제 1 체크섬을 저장하고, 특정 트랜잭션의 커밋 로그 레코드에 제 2 체크섬을 저장할 수 있다.Herein, the control unit 400 stores the first checksum at the last point of the first log page when a plurality of log records generated by the specific transaction are passed from the first log page to the second log page, and A second checksum can be stored in the commit log record.
그리고, 체크섬은, 로그 레코드와 로그 레코드를 지시하는 로그 포인터를 대상으로 수행될 수 있다.The checksum may be performed on a log record and a log pointer indicating the log record.
이어, 제어부(400)는, 데이터베이스 파일의 복구 시에, 체크섬과 로그 레코드의 내용을 비교하고, 체크섬과 로그 레코드의 내용이 다르면, 해당하는 트랜잭션을 실패로 판정하고, 재수행(redo) 과정에서 로그 레코드를 제외시킬 수 있다.Subsequently, the controller 400 compares the contents of the checksum and the log record at the time of restoring the database file. If the contents of the checksum and the log record are different, the controller 400 determines that the corresponding transaction has failed, and in the redo process. You can exclude log records.
이와 같이, 본 발명은, 트랜잭션 커밋 시에, 커밋 로그 레코드에 체크섬을 저장하여, 데이터 복구 과정에서, 로그 레코드의 손상을 확인하여 복구 에러를 방지할 수 있다.As described above, according to the present invention, a checksum is stored in a commit log record at the time of committing a transaction, so that a corruption of the log record can be confirmed in a data recovery process, thereby preventing a recovery error.
또한, 제어부(400)는, 생성된 전체 로그 레코드를 로그 파일에 저장할 때, 전체 로그 레코드를 한 번에 압축하고, 압축된 전체 로그 레코드를 로그 파일에 저장할 수 있다.In addition, when the generated full log record is stored in the log file, the controller 400 may compress the entire log record at once and store the compressed full log record in the log file.
다른 경우로서, 제어부(400)는, 생성된 전체 로그 레코드를 로그 파일에 저장할 때, 각각의 로그 레코드를 개별적으로 압축하고, 개별적으로 압축된 전체 로그 레코드를 로그 파일에 저장할 수도 있다.As another case, the controller 400 may compress each log record individually when storing the generated full log record in the log file, and store the individually compressed full log record in the log file.
이와 같이, 본 발명은, 로그 레코드를 압축함으로써, 로그 파일의 크기를 줄일 수 있어, 변경 및 복구 속도가 빠르고 효율성이 우수하다.As described above, the present invention can reduce the size of the log file by compressing the log record, so that the change and recovery speed is fast and the efficiency is excellent.
도 2는 데이터베이스에 저장되는 컨텐츠를 보여주는 도면이고, 도 3은 데이터베이스 파일의 구조를 보여주는 도면이다.FIG. 2 is a diagram showing contents stored in a database, and FIG. 3 is a diagram showing the structure of a database file.
도 2 및 도 3에 도시된 바와 같이, 데이터베이스는, 데이터베이스 파일(DB file)(120)을 저장하고, 데이터베이스 파일(120)은, 페이지 단위로 구성될 수 있다.As illustrated in FIGS. 2 and 3, a database stores a database file 120, and the database file 120 may be configured in units of pages.
그리고, 데이터베이스 파일(120)의 각 페이지는, 실제 데이터베이스에 저장되는 정보인 레코드(record)가 저장될 수 있다.Each page of the database file 120 may store a record, which is information stored in an actual database.
따라서, 데이터베이스 파일(120)의 하나의 페이지에는, 다수의 레코드(122)들이 저장될 수 있다.Thus, a number of records 122 may be stored in one page of the database file 120.
일 예로, 도 2와 같이, 고객 정보 리스트(110)라는 정보가 데이터베이스에 저장되어 있는 경우, 고객 정보 리스트(110)에는, 고객의 이름, 나이, 성별 등과 같은 고객 정보(112)를 포함할 수 있다.For example, as shown in FIG. 2, when information called the customer information list 110 is stored in a database, the customer information list 110 may include customer information 112 such as the name, age, and gender of the customer. have.
여기서, 고객 정보(112)는, 도 3과 같이, 데이터베이스 파일(120)의 각 페이지 내에 순차적으로 저장될 수 있다.Here, the customer information 112 may be sequentially stored in each page of the database file 120, as shown in FIG.
각 고객 정보(112)는, 해당하는 페이지 내에 레코드(122) 형태로 저장될 수 있다.Each customer information 112 may be stored in a record 122 in a corresponding page.
도 3은, 하나의 페이지 내에 3개의 레코드(122)가 저장된 데이터베이스 파일(120)의 구조를 보여주고 있다.3 shows the structure of a database file 120 in which three records 122 are stored in one page.
도 4는 데이터베이스 파일의 변경에 따른 더티 페이지를 보여주는 도면이고, 도 5는 도 4의 더티 페이지에 따른 로그 레코드 생성 방식을 보여주는 도면이다.4 is a diagram illustrating a dirty page according to a change of a database file, and FIG. 5 is a diagram illustrating a log record generation method according to the dirty page of FIG. 4.
도 4에 도시된 바와 같이, 본 발명의 시스템은, 데이터베이스 파일의 페이지 1 내에, 테이블 t1을 추가하는 명령이 수신되면, 수신된 명령에 따라, 데이터베이스 파일의 페이지 1에 테이블 t1을 삽입하여, 데이터베이스 파일의 변경 과정을 수행할 수 있다.As shown in FIG. 4, in the system of the present invention, when a command to add a table t1 is received within page 1 of a database file, the system inserts the table t1 into page 1 of the database file according to the received command. You can change the file.
여기서, 데이터베이스 파일의 페이지 1 내에는, 테이블 t1이 삽입되고, 데이터베이스 파일의 페이지 1에 있던 기존의 데이터는, 데이터베이스 파일의 페이지 2로 이동될 수 있다.Here, the table t1 is inserted into page 1 of the database file, and the existing data on page 1 of the database file can be moved to page 2 of the database file.
따라서, 데이터베이스 파일은, 변경 명령을 수행한 결과, 내용이 변경된 2개의 더티 페이지(dirty page)를 생성할 수 있다.Therefore, the database file may generate two dirty pages whose contents are changed as a result of the change command.
다음, 도 5에 도시된 바와 같이, 내용이 변경된 2개의 더티 페이지에 대한 로그 레코드를 생성할 수 있다.Next, as shown in FIG. 5, log records for two dirty pages whose contents are changed may be generated.
일 예로, WAL 로깅 방식은, 변경된 2개의 더티 페이지에 대한 전체 내용을 로그 파일에 모두 저장하는 방식이므로, 로그 파일의 크기가 매우 클 수 있다.For example, since the WAL logging method stores all the contents of two changed dirty pages in a log file, the log file may be very large.
그리고, 논리적 로깅 방식은, 수행된 작업(modification operation)의 종류와 로그 레코드 자체만을 로그 파일에 저장하는 방식이므로, 데이터 복구 수행시, 질의 전체를 다시 수행해야 하는 문제들이 있었다.In addition, since the logical logging method stores only the type of modification operation and the log record itself in a log file, there are problems that the entire query must be executed again when performing data recovery.
일 예로, 논리적 로깅 방식은, 데이터베이스 파일의 페이지 1에 테이블 t1이 삽입되었다는 내용만이 로그 파일에 저장될 뿐이다.For example, in the logical logging method, only the fact that the table t1 is inserted into page 1 of the database file is stored in the log file.
다음, 본 발명의 시스템에 따른 로깅 방식은, 페이지 지향 논리적 로깅 방식(page-oriented logical logging method)으로서, 각 페이지 별로 변경 내역을 각각의 변경 작업의 종류와 함께 저장하는 방식으로서, 로그 파일의 크기도 작고, 데이터 복구 수행시, 각 페이지 별로 독립적인 복구가 가능하며 복구 속도가 빠르다.Next, the logging method according to the system of the present invention is a page-oriented logical logging method, in which a change history is stored for each page along with each change type, and the size of a log file In addition, when performing data recovery, independent recovery for each page is possible and the recovery speed is fast.
일 예로, 본 발명의 페이지 지향 논리적 로깅 방식은, 데이터베이스 파일의 페이지 1 내에, 테이블 t1이 삽입되고, 데이터베이스 파일의 페이지 2 내에, 페이지 1의 기존 데이터가 삽입되었다는 내용이 페이지 별로 각각 로그 파일에 저장될 수 있다.For example, in the page-oriented logical logging method of the present invention, a table t1 is inserted into page 1 of a database file, and the existing data of page 1 is inserted into page 2 of the database file into a log file for each page. Can be.
도 6은 로그 레코드의 크기에 따른 로깅 모드 변경 과정을 설명하기 위한 도면이다.6 is a view for explaining a logging mode change process according to the size of a log record.
본 발명의 시스템은, 내용이 변경된 더티 페이지 별로 각 더티 페이지의 변경 내역에 대한 로그 레코드를 생성할 수 있다.The system of the present invention may generate a log record of a change history of each dirty page for each dirty page whose content has changed.
여기서, 본 발명의 시스템은, 생성된 전체 로그 레코드를 로그 파일에 저장할 때, 생성된 전체 로그 레코드의 크기와 더티 페이지의 크기를 비교할 수 있다.Here, the system of the present invention may compare the size of the generated total log record and the size of the dirty page when storing the generated total log record in the log file.
그리고, 시스템은, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 작으면, 생성된 전체 로그 레코드를 로그 파일에 저장하고, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 크면, 더티 페이지를 로그 파일에 저장할 수 있다.And, if the size of the generated total log record is smaller than the size of the dirty page, the system stores the generated total log record in the log file, and if the size of the generated total log record is larger than the size of the dirty page, You can save dirty pages to a log file.
도 6에 도시된 바와 같이, 데이터베이스 파일의 페이지들 중, 내용이 변경된 더티 페이지로서, 더티 페이지 13과 더티 페이지 17이 있다면, 더티 페이지 13과 17의 변경 내역에 대한 로그 레코드들이 생성될 수 있다.As shown in FIG. 6, if there are dirty pages 13 and dirty pages 17 among the pages of the database file whose contents have been changed, log records for the change history of the dirty pages 13 and 17 may be generated.
여기서, 로그 레코드들의 전체 크기가, 로그 페이지 5개의 크기일 경우, 더티 페이지들의 크기보다 더 클 수 있다.Here, when the total size of the log records is five log pages, the total size of the log records may be larger than the size of the dirty pages.
이 경우, 로그 레코드를 로그 파일에 저장하는 제 1 로깅 방식보다 로그 페이지를 로그 파일에 저장하는 제 2 로깅 방식으로 로깅 모드를 변경함으로써, 로깅 속도와 효율을 향상시킬 수 있다.In this case, the logging speed and efficiency can be improved by changing the logging mode to a second logging method that stores log pages in a log file rather than a first logging method that stores log records in a log file.
일 예로, 하나의 더티 페이지에 대해 많은 변경이 있는 경우, 더티 페이지에 대한 로그 레코드의 개수도 많아져서, 축적된 전체 로그 레코드의 크기가 더티 페이지보다 더 클 수가 있다.For example, if there are many changes to one dirty page, the number of log records for the dirty page is also increased, so that the size of the accumulated total log records may be larger than the dirty pages.
이 경우, 더티 페이지보다 큰 크기의 로그 레코드를 로그 파일에 저장하는 제 1 로깅 방식은, 더티 페이지를 로그 파일에 저장하는 제 2 로깅 방식보다 속도면이나 효율면에서 저하될 수 있다.In this case, the first logging method for storing a log record having a size larger than the dirty pages in the log file may be lowered in speed or efficiency than the second logging method for storing dirty pages in the log file.
따라서, 본 발명의 시스템은, 생성된 전체 로그 레코드의 크기와 더티 페이지의 크기를 비교하여, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 작으면, 제 1 로깅 방식으로 생성된 전체 로그 레코드를 로그 파일에 저장하고, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 크면, 제 2 로깅 방식으로, 더티 페이지를 로그 파일에 저장할 수 있다.Accordingly, the system of the present invention compares the size of the generated total log record with the size of the dirty page, and if the size of the generated total log record is smaller than the size of the dirty page, the entire log generated by the first logging method If the record is stored in the log file, and the size of the generated total log record is larger than the size of the dirty page, the second logging method may store the dirty page in the log file.
그러므로, 본 발명은, 생성된 전체 로그 레코드의 크기와 더티 페이지의 크기를 비교 결과에 따라, 제 1 로깅 방식 또는 제 2 로깅 방식을 선택함으로써, 로깅 속도 및 효율을 향상시킬 수 있다.Therefore, the present invention can improve the logging speed and efficiency by selecting the first logging method or the second logging method according to the result of comparing the size of the entire log record and the size of the dirty page.
도 7은 로그 레코드의 구조를 보여주는 도면이고, 도 8은 도 7의 로그 레코드가 삽입되는 로그 파일의 구조를 보여주는 도면이며, 도 9는 데이터베이스 파일의 변경 명령들을 보여주는 변경 명령 리스트이다.7 is a view showing the structure of a log record, FIG. 8 is a view showing the structure of a log file into which the log record of FIG. 7 is inserted, and FIG. 9 is a change command list showing change commands of a database file.
도 7 및 도 8에 도시된 바와 같이, 로그 파일(500)은, 로그 페이지 단위로 구성되는데, 로그 파일 헤더(log file header)(510)와 다수의 로그 페이지(520)들을 포함할 수 있다.As illustrated in FIGS. 7 and 8, the log file 500 is configured in log page units, and may include a log file header 510 and a plurality of log pages 520.
그리고, 각 로그 페이지(520)는, 로그 페이지 정보를 포함하는 로그 페이지 헤더(log page header)(610), 각 로그 레코드의 위치 및 길이 정보를 포함하는 로그 포인터(log pointer)(620), 로그 데이터(log data)를 포함하는 로그 레코드(log record)(630)로 구성될 수 있다.Each log page 520 may include a log page header 610 including log page information, a log pointer 620 including position and length information of each log record, and a log. It may be configured as a log record 630 including log data.
여기서, 로그 페이지 헤더(610)는, 로그 페이지 번호, 로그 페이지 내의 로그 레코드 개수, 사용 가능한 공간, 그리고 플래그 중, 적어도 어느 하나의 정보를 포함할 수 있다.Here, the log page header 610 may include at least one of a log page number, the number of log records in the log page, available space, and a flag.
이어, 로그 포인터(620)는, 로그 레코드(630)의 위치 정보를 저장하는 제 1 유닛(622)과, 로그 레코드(630)의 길이 정보를 저장하는 제 2 유닛(624)을 포함할 수 있다.Subsequently, the log pointer 620 may include a first unit 622 for storing location information of the log record 630 and a second unit 624 for storing length information of the log record 630. .
그리고, 로그 레코드(630)는, 데이터베이스 파일을 변경하는 명령을 리두(redo)하는데, 필요한 데이터를 포함한다.The log record 630 includes data necessary to redo a command for changing a database file.
여기서, 로그 레코드(630)가 압축될 경우, 본 발명의 시스템은 처리 속도 및 처리 효율면에서, 더욱 큰 성능 향상을 이룰 수 있다.Here, when the log record 630 is compressed, the system of the present invention can achieve a greater performance improvement in terms of processing speed and processing efficiency.
일 예로, 로그 레코드(630)는, 작업 명령 정보를 저장하는 제 1 유닛(632), 작업이 수행된 데이터베이스 파일(120)의 더티 페이지 번호를 저장하는 제 2 유닛(634), 더티 페이지 내에서, 작업이 수행된 셀 번호를 저장하는 제 3 유닛(636), 작업 명령에 따른 로그 데이터를 저장하는 제 4 유닛(638)을 포함할 수 있다.For example, the log record 630 may include a first unit 632 for storing work instruction information, a second unit 634 for storing a dirty page number of the database file 120 on which the work is performed, and a dirty page. The third unit 636 may store a cell number in which a work is performed, and the fourth unit 638 may store log data according to a work command.
다음, 로그 포인터(620)와 로그 레코드(630)는, 서로 일대일 대응하여 배치될 수 있다.Next, the log pointer 620 and the log record 630 may be arranged in a one-to-one correspondence with each other.
여기서, 로그 포인터(620)의 개수와 로그 레코드(630)의 개수는, 서로 동일할 수 있다.Here, the number of log pointers 620 and the number of log records 630 may be the same.
로그 포인터(620)는, 로그 레코드(630)가 로그 페이지(520) 내에 삽입될 때, 생성될 수 있다. Log pointer 620 may be generated when log record 630 is inserted into log page 520.
경우에 따라, 로그 포인터(620)는, 로그 레코드(630)가 로그 페이지(520) 내에 삽입되기 전인 로그 레코드(630)가 생성될 때, 생성될 수도 있다.In some cases, the log pointer 620 may be generated when the log record 630 is generated before the log record 630 is inserted into the log page 520.
이처럼, 로그 포인터(620)는, 로그 레코드(630)가 생성되거나 또는 로그 페이지에 로그 레코드(630)가 삽입될 때, 생성되므로, 각 로그 레코드(630) 마다, 그에 상응하는 로그 포인터(620)가 존재할 수 있다.As such, the log pointer 620 is generated when the log record 630 is created or when the log record 630 is inserted into the log page, so that for each log record 630, the corresponding log pointer 620 is used. May be present.
본 발명의 시스템은, 각 페이지 별로 논리적 로깅을 하기 때문에 논리적 로깅과 마찬가지로 논리적 작업(logical operation)에 대한 정의가 필요하다.Since the system of the present invention performs logical logging for each page, a logical operation needs to be defined similarly to logical logging.
따라서, 본 발명은, 2가지 조건을 만족하는 논리적 작업을 도 9와 같이, 수행할 수 있다.Accordingly, the present invention can perform a logical operation satisfying the two conditions as shown in FIG. 9.
첫째, 하나의 논리적 작업은, 데이터베이스 파일을 변경하는 하나의 작업에 대응되어야 한다.First, one logical operation must correspond to one operation for changing a database file.
둘째, 데이터베이스 파일을 변경하는 작업은, 로그 레코드를 생성할 수 있는 논리적 작업으로 표현될 수 있어야 한다.Second, changing the database file must be able to be represented as a logical operation that can generate log records.
본 발명의 논리적 작업은, 크게 페이지 안의 셀과 관련된 작업(Cell_Insert, Cell_Drop), 페이지 자체에 관련된 작업(Page_alloc, Page_empty, Page_erase, Page_ stressed), B-트리 밸런싱에 관련된 작업(Copy_Cells, Assemble_Page), 데이터베이스 헤더에 관한 작업, 커밋, 그리고 체크포인트로 나눌 수 있다.Logical tasks of the present invention are operations related to cells in a page (Cell_Insert, Cell_Drop), operations related to the page itself (Page_alloc, Page_empty, Page_erase, Page_ stressed), operations related to B-tree balancing (Copy_Cells, Assemble_Page), and database. It can be divided into header operations, commits, and checkpoints.
이 중 Page_ stressed는, 다른 작업에서 나타나지 않는 없는 독특한 특징을 갖는데, 이는 본 발명의 버퍼 관리 정책(Buffer Management Policy)과 깊은 관련이 있다.Among these, Page_stressed has a unique feature that does not appear in other work, which is closely related to the buffer management policy of the present invention.
본 발명의 버퍼 관리자는, 기본적으로 특정 트랜잭션에 의해 수정된 데이터베이스 파일의 더티 페이지를 해당 트랜잭션이 커밋되기 전까지 데이터베이스 파일에 반영하지 않는다.The buffer manager of the present invention basically does not reflect dirty pages of a database file modified by a specific transaction to the database file until the transaction is committed.
그러나, 예외적으로 수정된 페이지의 수가 증가하여 이들이 차지하는 메모리가 본 발명이 정해놓은 한계를 넘어가게 되면, 본 발명의 PagerStress 함수에 의해 수정된 페이지가 트랜잭션이 커밋되기 전에 데이터베이스 파일에 쓰여질 수 있다.However, if the number of exceptionally modified pages increases and the memory they occupy exceeds the limits defined by the present invention, the pages modified by the PagerStress function of the present invention can be written to a database file before the transaction is committed.
따라서, 트랜잭션 롤백 및 데이터 복구 시에, 이에 대한 처리를 하기 위해 별도의 로그를 저장할 수 있다.Therefore, in transaction rollback and data recovery, a separate log can be stored for processing.
또한, 본 발명은, 데이터베이스 파일을 변경하는 논리적 작업이 시스템에 의해 수행되면, 로그 레코드를 생성하고, 이를 로그 파일의 로그 페이지에 삽입한다.In addition, the present invention, when the logical operation to change the database file is performed by the system, generates a log record and inserts it into the log page of the log file.
로그 레코드(630)는, 하나의 논리적 작업을 리두(Re-do)하는데 필요한 데이터로서, 도 7과 같이 구성될 수 있다.The log record 630 is data required to redo one logical task and may be configured as shown in FIG. 7.
도 7과 같이, 로그 레코드(630)의 Opcode는, 도 9에서 정의한 작업 중 어떤 작업이 수행되었는지를 나타낸다.As shown in FIG. 7, the opcode of the log record 630 indicates which of the tasks defined in FIG. 9 is performed.
그리고, Page Number는, 이 작업으로 인해 변경된 데이터베이스의 페이지 번호를, Cell index는 페이지 내의 몇 번째 셀에 관한 작업인지를 의미한다.Page Number indicates the page number of the database changed by this operation, and Cell index indicates the number of cells in the page.
다음, Cell index 뒤의 Data는, Opcode의 특성에 따라 필요한 데이터를 저장한다.Next, Data after the cell index stores necessary data according to the characteristics of the opcode.
대부분의 경우, 도 9에 명시된 함수를 호출하는데 필요한 파라미터를 저장하지만, 앞서 언급한 Page_stressed 및 Whole_page에 대해서는, 데이터베이스 페이지를 통째로 저장한다.In most cases, it stores the parameters necessary to call the function specified in Fig. 9, but for the aforementioned Page_stressed and Whole_page, the database page is stored as a whole.
본 발명은, 커밋되지 않은 트랜잭션의 작업을 데이터베이스 파일에 반영하지 않기 때문에, 논리적 로그 기반 복구를 할 때, 로그를 언두(undo)할 필요가 없다.Since the present invention does not reflect the work of uncommitted transactions in the database file, there is no need to undo the log when performing logical log-based recovery.
단, Pager Stress에 한해서, 변경된 페이지가 커밋 전에 데이터베이스 파일에 반영될 수 있고, 이후 해당 트랜잭션이 롤백되면, 미리 쓰여진 페이지 또한 트랜잭션 시작 전으로 돌아가야 한다.However, for Pager Stress only, changed pages can be reflected in the database file before committing, and if the transaction is rolled back afterwards, the prewritten pages must be returned to before the transaction begins.
해당 페이지에 연관된 모든 작업에 대해 언두(undo)를 수행하는 것은 비효율적이므로, 이것을 방지하기 위해서 봉 발명은, PagerStress 함수 호출 시, 수정되기 전 원본 페이지를 로그 레코드(630)의 Data 필드에 저장한다.Since it is inefficient to undo all operations related to the page, in order to prevent this, the invention stores the original page in the Data field of the log record 630 before the modification when the PagerStress function is called.
로그 파일(500)은, 데이터베이스 파일과 마찬가지로 여러 개의 페이지가 모여서 이루어진다.The log file 500 is made up of several pages together like a database file.
각각의 로그 페이지(520)는, slotted-page 구조로 구현될 수 있다.Each log page 520 may be implemented in a slotted-page structure.
도 8과 같이, 로그 페이지(520)의 가장 앞부분은, 로그 페이지 헤더가 존재한다.As shown in FIG. 8, the log page header exists in the foremost portion of the log page 520.
로그 페이지 헤더에는, 페이지 번호, 페이지 안의 로그 엔트리 개수, 사용 가능한 공간(lower, upper), 기타 플래그 등이 저장된다.The log page header stores the page number, the number of log entries in the page, available space (lower, upper), other flags, and the like.
페이지 헤더 뒤의 포인터들은, 페이지 끝에서부터 저장되어 있는 로그 엔트리의 시작 주소와 크기(offset, length)를 저장하고 있다.Pointers after the page header store the start address and size (offset, length) of the log entry stored from the end of the page.
따라서, Pointer n이 가리키고 있는 주소에서 해당 byte만큼을 가져옴으로써, n번째 로그 엔트리에 접근할 수 있다.Therefore, the nth log entry can be accessed by getting the corresponding byte from the address pointed to by Pointer n.
마찬가지로 로그 레코드(630)가 로그 페이지(520) 내에 삽입될 때는, ㅍ포퐁포인터(pointer)의 끝에 새로운 포인터가 만들어지고, 마지막 로그 엔트리가 저장된 주소 앞에, 삽입될 로그 엔트리가 저장된다.Similarly, when the log record 630 is inserted into the log page 520, a new pointer is made at the end of the pop point pointer, and the log entry to be inserted is stored before the address where the last log entry is stored.
또한, 본 발명은, 로그 페이지의 내부 단편화를 최소화하기 위해, 오버플로우 레코드를 지원한다.In addition, the present invention supports overflow records to minimize internal fragmentation of log pages.
삽입되는 로그 레코드가 로그 페이지의 빈 공간보다 클 경우, 2개 이상의 로그 페이지에 걸쳐서 저장될 수 있으며, 페이지 헤더의 오버플로우 플래그를 통해 이를 관리한다.If the log record to be inserted is larger than the free space of the log page, it can be stored over two or more log pages, and managed through the overflow flag of the page header.
도 8은, '주소록' 테이블에 레코드를 삽입하여, 데이터베이스 파일을 변경할 경우, 로그 파일의 로그 레코드 삽입 과정을 보여줄 수 있다.FIG. 8 illustrates a process of inserting a log record of a log file when a record is inserted into a 'address book' table to change a database file.
먼저, 본 발명의 시스템은, 트랜잭션에 의해 데이터베이스 파일이 변경되고, 데이터베이스 파일의 변경 내역에 대한 로그 레코드를 생성하며, 생성된 로그 레코드를 로그 파일의 로그 페이지 내에 삽입할 수 있다.First, the system of the present invention may change a database file by a transaction, generate a log record of a change history of the database file, and insert the generated log record into a log page of the log file.
그리고, 로그 페이지를 포함하는 로그 파일은, 버퍼 메모리에 상주하다가, 트랜잭션에 대한 커밋 명령이 수행되면, 데이터베이스에 해당하는 로그 파일이 저장될 수 있다.The log file including the log page resides in the buffer memory, and when a commit command for a transaction is performed, a log file corresponding to a database may be stored.
도 10 및 도 11은 로그 페이지 내에 삽입되는 로그 레코드의 위치를 설명하기 위한 도면이다.10 and 11 are diagrams for explaining the position of a log record inserted into a log page.
도 10 및 도 11과 같이, 본 발명의 로그 파일은, 다양한 구조의 로그 페이지를 사용할 수 있다.10 and 11, the log file of the present invention can use log pages having various structures.
도 10의 로그 페이지는, 스롯 페이지 구조(slotted-page structure)로서, 각 로그 레코드의 위치와 길이를 저장하는 포인터의 어레이(array)를 로그 페이지의 한쪽 끝에서부터 저장하고, 로그 레코드를 로그 페이지의 다른 끝에서부터 저장하는 방식이다.The log page of FIG. 10 is a slotted-page structure, in which an array of pointers storing the position and length of each log record is stored from one end of the log page, and the log record is stored in the log page. The other way is to save it.
또한, 도 11의 로그 페이지는, 어펜드 온리 로그 페이지 구조(append-only log page structure)로서, 로그 레코드의 길이와 이전 로그 레코드의 위치를 가지는 로그 헤더를 저장하고, 로그 레코드를 순차적으로 저장하는 방식이다.In addition, the log page of FIG. 11 is an append-only log page structure that stores a log header having a length of a log record and a location of a previous log record, and sequentially stores log records. That's the way.
도 10에 도시된 바와 같이, 스롯 페이지 구조의 로그 페이지(700)는, 로그 페이지 헤더(710)가, 로그 페이지(700)의 시작 지점에 저장될 수 있다.As shown in FIG. 10, in the log page 700 of the slot page structure, a log page header 710 may be stored at a start point of the log page 700.
그리고, 로그 포인터(720)는, 로그 레코드(730)가 로그 페이지(700)에 삽입되는 순서에 따라, 로그 페이지 헤더(720)로부터 로그 페이지(700)의 끝 지점 방향으로 순차 저장될 수 있다.The log pointer 720 may be sequentially stored from the log page header 720 toward the end point of the log page 700 according to the order in which the log record 730 is inserted into the log page 700.
여기서, 로그 포인터(720)는, 상응하는 현재 로그 레코드의 길이 정보와 위치 정보를 포함할 수 있다.Here, the log pointer 720 may include length information and position information of a corresponding current log record.
일 예로, 로그 포인터(720)는, 플래그(722), 길이(724), 오프셋(726) 정보를 포함할 수 있다.For example, the log pointer 720 may include flag 722, length 724, and offset 726 information.
다음, 로그 레코드(730)는, 로그 레코드(730)가 로그 페이지(700)에 삽입되는 순서에 따라, 로그 페이지(700)의 끝 지점으로부터 시작 지점 방향으로 순차 저장될 수 있다.Next, the log record 730 may be sequentially stored from the end point of the log page 700 in the direction of the start point according to the order in which the log record 730 is inserted into the log page 700.
도 11에 도시된 바와 같이, 어펜드 온리 로그 페이지 구조의 로그 페이지(800)는, 로그 페이지 헤더(810)가, 로그 페이지(800)의 시작 지점에 저장될 수 있다.As illustrated in FIG. 11, in the log page 800 of the append only log page structure, a log page header 810 may be stored at a start point of the log page 800.
그리고, 로그 포인터(820)와 로그 레코드(830)는, 로그 레코드(830)가 로그 페이지(800)에 삽입되는 순서에 따라, 로그 페이지 헤더(810)로부터 로그 페이지(800)의 끝 지점 방향으로 순차 저장될 수 있다.The log pointer 820 and the log record 830 are moved from the log page header 810 to the end point of the log page 800 according to the order in which the log record 830 is inserted into the log page 800. Can be stored sequentially.
여기서, 로그 포인터(820)는, 상응하는 현재 로그 레코드의 길이 정보와, 이전 로그 레코드의 위치 정보를 포함할 수 있다.Here, the log pointer 820 may include length information of a corresponding current log record and position information of a previous log record.
일 예로, 로그 포인터(820)는, 플래그(822), 길이(824), 이전 오프셋(826) 정보를 포함할 수 있다.For example, the log pointer 820 may include flag 822, length 824, and previous offset 826 information.
한편, 본 발명의 시스템은, 로그 페이지 내에 삽입되는 로그 레코드의 개수가, 로그 페이지의 빈 공간 크기를 초과하면, 새로운 추가 로그 페이지를 생성하고, 로그 페이지 헤더 내에 오버플로우 플래그를 추가할 수 있다.Meanwhile, the system may generate a new additional log page and add an overflow flag in the log page header when the number of log records inserted into the log page exceeds the free space size of the log page.
그리고, 본 발명의 시스템은, 생성된 전체 로그 레코드를 로그 파일에 저장할 때, 전체 로그 레코드를 한 번에 압축하고, 압축된 전체 로그 레코드를 로그 파일에 저장할 수 있다.The system of the present invention can compress the entire log record at once and store the compressed whole log record in the log file when storing the generated whole log record in the log file.
또한, 본 발명의 시스템은, 생성된 전체 로그 레코드를 로그 파일에 저장할 때, 각각의 로그 레코드를 개별적으로 압축하고, 개별적으로 압축된 전체 로그 레코드를 로그 파일에 저장할 수도 있다.In addition, the system of the present invention may compress each log record individually when storing the generated full log record in a log file, and store the individually compressed full log record in a log file.
이와 같이 저장하는 이유는, 데이터 복구 시, 복구 속도 및 복구 효율이 크게 향상될 수 있기 때문이다.The reason for storing in this way is that the recovery speed and recovery efficiency can be greatly improved during data recovery.
도 12는 로그 파일의 톤 페이지(torn page)를 설명하기 위한 도면이고, 도 13은 더티 페이지의 변경 이력을 체크하기 위한 비트맵 인덱스를 보여주는 도면이며, 도 14는 더티 페이지의 변경 이력에 따른 로그 파일을 보여주는 도면이다.FIG. 12 illustrates a tone page of a log file, FIG. 13 illustrates a bitmap index for checking a change history of a dirty page, and FIG. 14 illustrates a log according to a change history of a dirty page. The figure shows a file.
도 12에 도시된 바와 같이, 본 발명의 시스템은, 데이터베이스 파일을 변경하는 명령을 수행할 때마다, 로그 레코드를 생성할 수 있다.As shown in FIG. 12, the system of the present invention may generate a log record every time a command to change a database file is performed.
그리고, 로그 레코드는, 버퍼 메모리 내에 있는 로그 파일의 로그 페이지 내에 순차적으로 저장될 수 있다.The log record may be sequentially stored in the log page of the log file in the buffer memory.
일 예로, 버퍼 메모리 내에 있는 로그 파일의 제 1 로그 페이지(1010) 내에 제 1, 제 2, 제 3 로그 레코드(1021, 1022, 1023)이 순차적으로 저장되고, 커밋 명령이 수행되면, 로그 파일의 제 1 로그 페이지(1010)는, 데이터베이스 내에 저장될 수 있다.For example, first, second, and third log records 1021, 1022, and 1023 are sequentially stored in the first log page 1010 of the log file in the buffer memory. The first log page 1010 may be stored in a database.
여기서, 제 1 로그 페이지(1010)는, 데이터베이스에 저장될 때, 수행 실패로 인하여, 제 2, 제 3 로그 레코드(1022, 1023)가 손실되는 문제가 발생할 수 있다.Here, when the first log page 1010 is stored in the database, the second and third log records 1022 and 1023 may be lost due to a failure in execution.
따라서, 제 1 로그 페이지(1010)는, 제 2, 제 3 로그 레코드(1022, 1023)가 손실된 톤 페이지(1020)가 되어, 데이터 복구시, 톤 페이지(1020)인 제 1 로그 페이지(1010)를 사용할 수 없다.Accordingly, the first log page 1010 becomes the tone page 1020 in which the second and third log records 1022 and 1023 are lost, and the first log page 1010 which is the tone page 1020 at the time of data recovery. ) Cannot be used.
이러한 톤 페이지 문제를 해결하기 위하여, 본 발명의 시스템은, 데이터베이스 파일의 변경 명령을 수행할 때, 데이터베이스 파일의 더티 페이지에 대한 변경 이력을 확인하고, 더티 페이지에 변경 이력이 존재하면, 더티 페이지의 변경 내역에 대한 로그 레코드를 생성하여, 생성된 전체 로그 레코드를 로그 파일에 저장할 수 있다.In order to solve this tone page problem, the system of the present invention checks the change history for the dirty page of the database file when executing the change command of the database file, and if the change history exists in the dirty page, By creating a log record of the change history, you can save the entire log record created in a log file.
그리고, 본 발명의 시스템은, 더티 페이지에 변경 이력이 존재하지 않으면, 더티 페이지의 변경 내역에 대한 로그 레코드 생성 없이, 더티 페이지 전체를 로그 파일에 저장할 수 있다.If the change history does not exist in the dirty page, the system may store the entire dirty page in a log file without generating a log record of the change history of the dirty page.
여기서, 본 발명의 시스템은, 데이터베이스 파일의 더티 페이지에 대한 변경 이력을 확인할 때, 도 13과 같이, 비트맵 인덱스(bitmap index)(1030)를 이용하여 변경 이력을 확인할 수 있다.Here, when checking the change history of the dirty page of the database file, the system of the present invention can check the change history using a bitmap index 1030 as shown in FIG. 13.
여기서, 비트맵 인덱스(1030)는, 데이터베이스 파일의 각 페이지당 1비트만이 소모되므로, 4KB만으로 32768 페이지를 커버할 수 있다.Here, since the bitmap index 1030 consumes only 1 bit per page of the database file, the bitmap index 1030 can cover 32768 pages with only 4 KB.
만일, 데이터베이스 파일의 페이지가 32768개 이상이 될 경우, 본 발명의 시스템은, 비트맵을 확장시킬 수 있다.If there are more than 32768 pages of the database file, the system of the present invention can expand the bitmap.
또한, 비트맵은, 쉐어드 메모리 파일로도 구현되어, 여러 프로세스에서 한 데이터베이스 파일에 접근하는 경우도 지원이 가능하다.Bitmaps are also implemented as shared memory files, which can be used to access a database file from multiple processes.
이처럼, 본 발명의 시스템은, 더티 페이지에 변경 이력이 존재하면, 더티 페이지의 변경 내역에 대한 로그 레코드를 생성하여, 생성된 전체 로그 레코드를 로그 파일에 저장하고, 더티 페이지에 변경 이력이 존재하지 않으면, 더티 페이지의 변경 내역에 대한 로그 레코드 생성 없이, 더티 페이지 전체를 로그 파일에 저장할 수 있다.As such, if the change history exists in the dirty page, the system of the present invention generates a log record of the change history of the dirty page, stores the entire log record generated in the log file, and the change history does not exist in the dirty page. Otherwise, the entire dirty page can be stored in a log file without generating a log record of the change history of the dirty page.
따라서, 도 14와 같이, 로그 파일(1040)은, 각 페이지마다 데이터베이스 파일의 원본 페이지가 항상 저장되므로, 데이터베이스 내에 톤 페이지가 발생되어도, 로그 파일(1040) 내에 원본 페이지가 존재하여, 데이터 복구가 가능하다.Therefore, as shown in FIG. 14, since the original page of the database file is always stored for each page, even if a tone page is generated in the database, the original page exists in the log file 1040 so that data recovery is possible. It is possible.
본 발명은, 데이터베이스 파일을 변경하는 명령이 수행될 때마다, 이에 해당되는 로그 엔트리를 생성하여 로그 페이지에 저장하고, 복구(Recovery) 시에, 로그페이지의 로그 레코드를 리두(redo)한다.According to the present invention, whenever a command to change a database file is performed, a log entry corresponding thereto is generated and stored in a log page, and upon recovery, a log record of a log page is redoed.
그러나, 갑작스런 전원 차단 등으로 데이터베이스 파일의 페이지 일부만이 데이터베이스에 저장될 수 있다.However, only a part of the pages of the database file may be stored in the database due to sudden power off.
이를 톤 페이지 문제(torn-page problem)라고 하는데, 디바이스에 따라 자동 쓰기(automic-write)를 지원하지 않을 수 있기 때문에, 복구 시스템(recovery system)이 반드시 해결해야 할 문제 중 하나이다.This is called a ton-page problem, and since a device may not support auto-write, a recovery system is one of the problems to be solved.
본 발명은, 이러한 톤 페이지 문제를 해결하기 위해, 변경되는 데이터베이스 파일의 페이지 상태에 따라 로그를 다르게 저장한다.In order to solve this tone page problem, the present invention stores the log differently according to the page state of the changed database file.
예를 들면, 현재 변경되는 데이터베이스 파일의 페이지가 이전에 커밋된 트련잭션에 의해 변경 이력이 있는 경우, 로그 엔트리를 생성하여 로그 페이지에 저장한다.For example, if a page of a database file that is currently changed has a change history due to a previously committed transaction, a log entry is generated and stored in the log page.
그러나, 만약 현재 변경되는 데이터베이스 파일의 페이지가 과거에 변경된 이력이 없는 경우, 로그 엔트리를 생성하지 않고, 이후 과정인 트랜잭션이 커밋될 때, 변경된 페이지 전체(수행 명령 Opcode: Whole_Page)를 로그 페이지에 저장한다.However, if a page in the database file that is currently changed has no history of changes in the past, log entries are not generated, and when the subsequent transaction is committed, the entire changed page (execution command Opcode: Whole_Page) is stored in the log page. do.
따라서, 각 데이터베이스 파일의 페이지마다, 최초 한번 씩, 변경된 페이지 전체가 로그 파일에 저장되므로, 데이터 복구시, 이를 통해 원본 페이지를 복구할 수 있다.Therefore, since the entire changed page is stored in the log file once for each page of each database file, the original page can be recovered through the data recovery.
그리고, 데이터베이스 파일의 페이지별로 수정 이력을 확인하기 위해, 더티 익스피어리언스 비트(Dirty Experience-bit)인 비트맵을 사용할 수 있다.In order to check the modification history for each page of the database file, a bitmap, which is a dirty experience bit, may be used.
여기서, 비트맵은, 한 페이지 당 1bit 만을 필요로 하므로(0 or 1) 4KB 만으로 32768개의 DB 페이지를 표현할 수 있다.Here, since the bitmap requires only 1 bit per page (0 or 1), 32768 DB pages can be represented by only 4 KB.
또한, 비트맵은, 쉐어드 메모리 파일(Shared memory File)로 구현되어 여러 프로세스에서 한 DB파일에 접근하는 경우도 지원하며 “<DB파일명>-shm” 형태로 저장될 수 있다.In addition, the bitmap is implemented as a shared memory file to support access to a DB file from multiple processes and may be stored in the form of “<DB filename> -shm”.
일 예로, 도 13과 같이, 데이터베이스 파일의 페이지가 이전 트랜잭션에 의해 수정되어 그 페이지가 로그 파일에 존재하는 경우, 비트맵은, 1로, 그렇지 않은 경우, 0으로 저장되고, 비트맵은, 1인 페이지의 변정 작업에 대해서만 로그 엔트리가 생성된다.For example, as shown in FIG. 13, when a page of a database file is modified by a previous transaction and the page exists in the log file, the bitmap is stored as 1, otherwise, as 0, and the bitmap is 1 Log entries are only generated for in-page translations.
도 15는 체크섬이 저장된 로그 페이지를 보여주는 도면이다.15 illustrates a log page in which a checksum is stored.
도 15에 도시된 바와 같이, 본 발명의 시스템은, 트랜잭션이 커밋될 때, 로그 파일의 커밋 로그 레코드(commit log record)(1050)에 체크섬(checksum)(1052)을 저장할 수 있다.As shown in FIG. 15, the system of the present invention may store a checksum 1052 in a commit log record 1050 of a log file when a transaction is committed.
여기서, 본 발명의 시스템은, 특정 트랜잭션에 의해 생성된 다수의 로그 레코드들이 제 1 로그 페이지로부터 제 2 로그 페이지로 이어질 때, 제 1 로그 페이지의 마지막 지점에 제 1 체크섬(1054)을 저장하고, 특정 트랜잭션의 커밋 로그 레코드에 제 2 체크섬(1056)을 저장할 수 있다.Here, the system of the present invention stores the first checksum 1054 at the last point of the first log page when a plurality of log records generated by a particular transaction follow from the first log page to the second log page, The second checksum 1056 may be stored in a commit log record of a specific transaction.
이때, 체크섬은, 로그 레코드와 로그 레코드를 지시하는 로그 포인터를 대상으로 수행될 수 있다.In this case, the checksum may be performed on a log record and a log pointer indicating the log record.
따라서, 본 발명의 시스템은, 데이터베이스 파일의 복구 시에, 체크섬과 로그 레코드의 내용을 비교하고, 체크섬과 로그 레코드의 내용이 다르면, 해당하는 트랜잭션을 실패로 판정하고, 재수행(redo) 과정에서 로그 레코드를 제외시킬 수 있다.Therefore, the system of the present invention compares the contents of the checksum and the log record at the time of restoring the database file, and if the contents of the checksum and the log record are different, determines the corresponding transaction as a failure, and in the redo process. You can exclude log records.
이와 같이, 구성되는 본 발명에 따른 데이터베이스 관리 시스템의 데이터 변경 방법을 설명하면 다음과 같다.As described above, the data change method of the database management system according to the present invention configured as follows.
먼저, 본 발명의 시스템은, 데이터베이스 파일의 변경 요청을 수신할 수 있다.First, the system of the present invention can receive a change request of a database file.
그리고, 시스템은, 변경 요청된 데이터베이스 파일의 트랜잭션을 수행할 수 있다.The system may then perform a transaction of the database file for which change is requested.
여기서, 시스템은, 데이터베이스로부터 변경 요청된 데이터베이스 파일을 추출하고, 트랜잭션을 수행하여, 데이터베이스 파일의 페이지를 변경할 수 있다.Here, the system may extract a database file requested for change from the database, perform a transaction, and change a page of the database file.
다음, 시스템은, 트랜잭션이 수행되어 내용이 변경된 데이터베이스 파일의 더티 페이지(dirty page)를 확인하여, 내용이 변경된 더티 페이지 별로 변경 내역에 대한 로그 레코드(log record)를 생성한다.Next, the system checks the dirty pages of the database file whose contents are changed by performing a transaction, and generates a log record of the change history for each dirty page whose contents have been changed.
이어, 시스템은, 트랜잭션의 커밋(commit)이 요청되면, 생성된 전체 로그 레코드를 로그 파일의 로그 페이지에 저장한다.The system then stores the generated full log record in the log page of the log file when a commit of the transaction is requested.
그리고, 시스템은, 트랜잭션을 데이터베이스에 커밋하여, 변경된 데이터베이스 파일을 데이터베이스에 저장하고, 그에 상응하는 로그 파일을 데이터베이스에 저장할 수 있다.The system can then commit the transaction to the database, store the changed database file in the database, and store the corresponding log file in the database.
여기서, 시스템은, 트랜잭션을 데이터베이스에 커밋할 때, 커밋 로그 레코드를 생성할 수 있다.Here, the system can create a commit log record when committing a transaction to the database.
그리고, 시스템은, 생성된 커밋 로그 레코드를 로그 레코드가 저장된 로그 페이지에 삽입하고, 로그 페이지를 로그 파일에 저장할 수 있다.The system may insert the generated commit log record into the log page in which the log record is stored and store the log page in the log file.
여기서, 로그 페이지는, 버퍼 메모리에 저장될 수 있다.Here, the log page may be stored in the buffer memory.
이때, 버퍼 메모리에 저장된 로그 페이지를 로그 파일에 저장할 때, 버퍼 메모리에 저장된 로그 페이지는, 삭제될 수 있다.At this time, when the log pages stored in the buffer memory are stored in the log file, the log pages stored in the buffer memory may be deleted.
다음, 시스템은, 로그 파일에 저장되지 않는 잔여 로그 페이지를 검색한다.The system then retrieves the remaining log pages that are not stored in the log file.
이어, 시스템은, 검색 결과, 로그 파일에 저장되지 않는 잔여 로그 페이지가 있으면, 잔여 로그 페이지를 로그 파일에 저장하고, 트랜잭션을 데이터베이스에 커밋할 수 있다.The system may then store the remaining log pages in the log file and commit the transaction to the database if there are remaining log pages that are not stored in the log file.
또한, 시스템은, 생성된 전체 로그 레코드를 로그 파일에 저장할 때, 체크포인트 로그 레코드를 생성할 수 있다.In addition, the system may generate a checkpoint log record when storing the generated full log record in a log file.
그리고, 시스템은, 생성된 체크포인트 로그 레코드를 로그 레코드가 저장된 로그 페이지에 삽입하고, 로그 페이지를 로그 파일에 저장할 수 있다.The system may insert the generated checkpoint log record into a log page in which the log record is stored and store the log page in a log file.
여기서, 로그 페이지는, 버퍼 메모리에 저장될 수 있다.Here, the log page may be stored in the buffer memory.
이때 버퍼 메모리에 저장된 로그 페이지를 로그 파일에 저장할 때, 버퍼 메모리에 저장된 로그 페이지는, 삭제될 수 있다.In this case, when the log pages stored in the buffer memory are stored in the log file, the log pages stored in the buffer memory may be deleted.
다음, 시스템은, 로그 파일에 저장되지 않는 잔여 로그 페이지를 검색하고, 검색 결과, 로그 파일에 저장되지 않는 잔여 로그 페이지가 있으면, 잔여 로그 페이지를 로그 파일에 저장하며, 생성된 전체 로그 레코드를 로그 파일에 저장할 수 있다.Next, the system retrieves the remaining log pages that are not stored in the log file, if there are any remaining log pages that are not stored in the log file, the system stores the remaining log pages in the log file, and logs the entire log record generated. You can save it to a file.
도 16은 본 발명 일 실시예에 따른 데이터베이스 관리 시스템의 데이터 복구 방법을 설명하기 위한 흐름도이다.16 is a flowchart illustrating a data recovery method of a database management system according to an embodiment of the present invention.
도 16에 도시된 바와 같이, 본 발명의 시스템은, 데이터 복구 요청을 수신할 수 있다.(S10)As shown in FIG. 16, the system of the present invention may receive a data recovery request.
그리고, 본 발명의 시스템은, 복구하고자 하는 데이터베이스 파일에 대한 로그 파일의 존재를 확인한다.(S20)In addition, the system of the present invention checks the existence of a log file for the database file to be restored. (S20)
이어, 본 발명의 시스템은, 로그 파일이 존재하면, 로그 파일의 마지막 로그 레코드로부터 마지막 커밋 로그 레코드까지 역순서로 검색하여(S30), 복구하고자 하는 데이터베이스 파일에 대한 원본 페이지가 존재하는지를 확인한다.(S40)Then, if a log file exists, the system searches for the reverse log from the last log record of the log file to the last commit log record (S30), and checks whether the original page for the database file to be recovered exists. S40)
다음, 본 발명의 시스템은, 원본 페이지가 존재하면, 원본 페이지를 데이터베이스 파일에 저장한다.(S50)Next, if the original page exists, the system stores the original page in the database file (S50).
그리고, 본 발명의 시스템은, 로그 파일의 마지막 체크포인트 로그 레코드로부터 마지막 커밋 로그 레코드까지 정순서로 검색하여(S60), 그들 사이에 로그 레코드가 존재하는지를 확인한다.(S70)Then, the system of the present invention searches in order from the last checkpoint log record of the log file to the last commit log record (S60), and checks whether log records exist between them (S70).
다음, 본 발명의 시스템은, 확인 결과, 그들 사이에 로그 레코드가 존재하면, 로그 레코드를 재수행한다.(S80)Next, the system of the present invention re-executes the log record if the log record exists between them as a result of the confirmation. (S80)
이어, 본 발명의 시스템은, 로그 파일의 로그 레코드를 검색하여(S90), 로그 파일의 마지막 커밋 로그 레코드 이후에 로그 레코드가 존재하는지를 확인한다.(S100)Next, the system of the present invention searches the log record of the log file (S90) and checks whether the log record exists after the last commit log record of the log file (S100).
그리고, 본 발명의 시스템은, 로그 파일의 마지막 커밋 로그 레코드 이후에 로그 레코드가 존재하면, 해당하는 로그 레코드를 삭제한다.(S110)If the log record exists after the last commit log record of the log file, the system deletes the corresponding log record (S110).
이와 같이, 본 발명은, 변경된 페이지 전체를 로깅하지 않고, 페이지마다 DB파일을 변경하는 연산만을 로깅하므로, 로그 파일의 크기를 줄이고 전체 I/O 부하를 낮출 수 있다.As described above, the present invention can log only the operation for changing the DB file for each page without logging the entire changed page, thereby reducing the size of the log file and lowering the overall I / O load.
그리고, 본 발명은, 체크포인트 시, DB 파일에 대한 싱크(sync) 연산만을 수행하므로 추가적인 마이그레이션 비용(migration cost)이 필요한 WAL 방식에 비해 체크포인트 속도가 빠르고, 이를 통해 ANR(Appplication Not Responding)의 문제를 해결할 수 있다.In addition, since the present invention performs only a sync operation on a DB file at checkpoint, a checkpoint speed is faster than that of a WAL method requiring an additional migration cost, and thus, an ANR (Appplication Not Responding) You can solve the problem.
또한, WAL 방식의 경우, 읽기 시, WAL 파일을 무조건 한번 검색하므로 선택(Select) 연산에 불리하지만, 본 발명은, DB 파일만 검색하므로 검색 비용이 더 저렴하다.In addition, the WAL method is disadvantageous in the selection operation because the WAL file is unconditionally searched at the time of reading, but in the present invention, the search cost is lower because only the DB file is searched.
이어, 본 발명은, 다른 방식보다 월등한 성능을 보이고 있어, 기존 방식의 문제점을 해결할 수 있다.Subsequently, the present invention shows superior performance than other methods, and can solve the problems of the existing methods.
한편, 본 발명은, 다양한 상황에서 데이터 복구를 수행할 수 있다.Meanwhile, the present invention can perform data recovery in various situations.
첫째, 본 발명은, 트랜잭션 실패(Transaction Failure) 상황에서, 데이터 복구가 가능하다.First, the present invention enables data recovery in a transaction failure situation.
실행중인 트랜잭션이 특정한 원인에 인해 더 이상 수행될 수 없는 경우, 트랜잭션 실패가 발생한다.If a running transaction can no longer be executed for some reason, a transaction failure occurs.
트랜잭션 실패는, 오버플로우, 자원 부족, 교착상태 등으로 인해 발생하는데, 이러한 경우 해당 트랜잭션은, 롤백되어 트랜잭션 시작 직전의 상태로 되돌아가야 한다.Transaction failures are caused by overflows, resource shortages, deadlocks, etc. In this case, the transaction must be rolled back and returned to the state just before the start of the transaction.
본 발명은, 트랜잭션이 롤백될 때, 로그 페이지 내에 마지막으로 저장된 레코드부터 이전 커밋 레코드까지 역 탐색을 한다.The present invention reverses the search from the last record stored in the log page to the previous commit record when the transaction is rolled back.
탐색 도중, Pager_stressed 로그 레코드를 만나는 경우, 원본 페이지를 데이터베이스 페이지에 덮어쓴다.During a search, if a Pager_stressed log record is encountered, the original page is overwritten with the database page.
Pager_stressed 로그 레코드 이외의 로그 레코드는, 데이터베이스에 아직 반영되기 전이므로 무시한다.Log records other than Pager_stressed log records are ignored before they are reflected in the database.
이어, 커밋 레코드에 도달하면, 커밋 레코드 이후의 모든 로그 레코드를 삭제한다.Then, when a commit record is reached, all log records after the commit record are deleted.
둘째, 본 발명은, 시스템 충돌(System Crash) 상황에서, 데이터 복구가 가능하다.Secondly, the present invention enables data recovery in a system crash situation.
시스템 충돌은, 하드웨어 오작동, 데이터베이스 소프트웨어 또는 운영체제의 버그 등으로 인해 휘발성 저장장치의 데이터 손실이 발생하고, 트랜잭션 수행을 중단되는 것을 뜻한다.A system crash is a data malfunction of a volatile storage device due to a hardware malfunction, a bug in a database software or an operating system, etc., and interrupts execution of a transaction.
단, 비휘발성 저장장치의 데이터베이스 파일 및 로그 파일은, 손실되지 않는 것을 가정한다.However, it is assumed that database files and log files of the nonvolatile storage device are not lost.
시스템 충돌이 발생한 시점에 따라, 데이터베이스 파일 및 로그 파일의 상태가 다르기 때문에 복구 기법은, 각 상황에 유동적으로 대처할 수 있어야 한다.Since the state of database files and log files are different depending on when a system crash occurs, recovery techniques must be able to handle each situation flexibly.
본 발명은, 시스템 충돌에 의해 발생하는 다음과 같은 상황에 대처할 수 있다.The present invention can cope with the following situations caused by a system crash.
일 예로, 로그 파일에 시스템 충돌 시, 수행 중이던 트랜잭션의 커밋 로그가 존재하지 않는 경우, 트랜잭션에 의해 수정된 페이지가 데이터베이스 파일에 반영되기 이전에는, 커밋 로그가 없으므로, 해당 트랜잭션이 수행되기 이전 상태로 돌아가야 한다.For example, if there is no commit log of the transaction being executed when the system crashed in the log file, there is no commit log before the page modified by the transaction is reflected in the database file. I have to go back.
따라서, 본 발명은, Pager_stressed 로그 레코드에 대한 처리를 하고, 트랜잭션과 관련된 로그 레코드를 삭제한다.Accordingly, the present invention processes the Pager_stressed log record and deletes the log record associated with the transaction.
다른 예로, 로그 파일에 시스템 충돌 시, 수행 중이던 트랜잭션의 커밋 로그가 존재하는 경우, 로그 파일에는, 트랜잭션을 리두(redo)하기 위한 모든 데이터가 들어있으나, 데이터베이스 파일에는, 트랜잭션에 의해 변경된 사항이 전부 반영되었는지 알 수 없다.As another example, if a log file contains a commit log of a transaction in the event of a system crash, the log file contains all the data for redoing the transaction, but the database file contains all the changes made by the transaction. It is not known whether it is reflected.
따라서, 본 발명은, 복구 알고리즘을 수행하면서, 해당 트랜잭션과 관련된 로그 레코드를 모두 리두(redo)할 수 있다.Accordingly, the present invention may redo all log records associated with the transaction while performing a recovery algorithm.
셋째, 본 발명은, 디스크 실패(Disk Failure) 상황에서, 데이터 복구가 가능하다.Third, the present invention enables data recovery in a disk failure situation.
디스크 자체의 손상으로 인해, 디스크 블록의 데이터는, 소실될 수도 있다.Due to the damage of the disc itself, the data of the disc block may be lost.
따라서, 본 발명은, 데이터베이스 파일과 로그 파일이 같은 경로에 저장되므로, 동일한 디스크에 저장된다.Therefore, in the present invention, since the database file and the log file are stored in the same path, they are stored on the same disk.
디스크 실패가 발생하여 특정 DB페이지가 손상을 입더라도, 로그 파일에는, 해당 페이지가 저장되어 있으므로, 데이터를 복구할 수 있다.Even if a disk failure occurs and a particular DB page is damaged, the log file stores the page so that data can be recovered.
도 17 내지 도 20은 본 발명 일 실시예에 따른 데이터베이스 관리 시스템의 복구 성능을 보여주는 도면이다.17 to 20 are diagrams illustrating a recovery performance of a database management system according to an embodiment of the present invention.
도 17은, RL 벤치마크(benchmark)를 이용하여, 체크포인트 수행 횟수에 따른 수행 시간을 비교한 그래프이다.FIG. 17 is a graph comparing execution times according to the number of checkpoints using RL benchmarks.
도 17에 도시된 바와 같이, 체크포인트 수행 횟수에 따른 수행 시간을 비교한 결과, 본 발명의 DWAL 방식은, 기존의 WAL 방식에 비해, 수행 시간이 약 13.4 - 22.85% 감소한 것을 알 수 있다.As shown in FIG. 17, as a result of comparing the execution time according to the number of checkpoints, the DWAL method of the present invention shows that the execution time is reduced by about 13.4-22.85% compared to the conventional WAL method.
따라서, 본 발명의 복구 방식이, 기존 방식에 비해, 복구 시간을 줄일 수 있다는 것을 알 수 있다.Therefore, it can be seen that the recovery method of the present invention can reduce the recovery time as compared to the existing method.
도 18은 최초의 커밋 수행 없이, 1000개의 로그 레코드를 한 번에 로그 파일에 삽입하는데 걸리는 시간을 비교한 그래프이다.18 is a graph comparing the time taken to insert 1000 log records into a log file at one time without performing an initial commit.
여기서, 가로축의 50, 1000, 1000000은, 체크포인트의 수행 범위를 의미한다.Here, 50, 1000, and 1000000 of the horizontal axis mean the range of execution of the checkpoint.
도 18에 도시된 바와 같이, 1000개의 로그 레코드를 한 번에 로그 파일에 삽입하는데 걸리는 시간을 비교한 결과, 본 발명의 DWAL 방식은, 기존의 WAL 방식에 비해, 수행 처리 시간이 빠른 것을 알 수 있다.As shown in FIG. 18, as a result of comparing the time taken to insert 1000 log records into a log file at a time, it can be seen that the DWAL method of the present invention has a faster execution processing time than the conventional WAL method. have.
따라서, 본 발명의 복구 방식이, 기존 방식에 비해, 약 2배 내지 약 6배 정도 좋은 성능을 보인다는 것을 알 수 있다.Therefore, it can be seen that the recovery method of the present invention has about 2 to about 6 times better performance than the conventional method.
도 19는 다수의 트랜잭션 수행 시, 25000개의 로그 레코드를 한 번에 로그 파일에 삽입하는데 걸리는 시간을 비교한 그래프이다.19 is a graph comparing the time taken to insert 25000 log records into a log file at a time when a plurality of transactions are performed.
여기서, 가로축의 5, 10, 20, 50, 100은, 하나의 트랜잭션당 삽입되는 로그 레코드의 개수를 의미한다.Here, 5, 10, 20, 50, and 100 on the horizontal axis mean the number of log records inserted per single transaction.
도 19에 도시된 바와 같이, 25000개의 로그 레코드를 한 번에 로그 파일에 삽입하는데 걸리는 시간을 비교한 결과, 본 발명의 DWAL 방식은, 기존의 WAL 방식에 비해, 수행 처리 시간이 빠른 것을 알 수 있다.As shown in FIG. 19, as a result of comparing the time taken to insert 25000 log records into a log file at a time, it can be seen that the DWAL method of the present invention has a faster execution processing time than the conventional WAL method. have.
따라서, 본 발명의 복구 방식이, 기존 방식에 비해, 좋은 성능을 보인다는 것을 알 수 있다.Therefore, it can be seen that the recovery method of the present invention shows better performance than the existing method.
도 20은, RL 벤치마크(benchmark)를 이용하여, 생성되는 로그 파일의 크기를 측정한 도표이다.20 is a table in which the size of the log file generated is measured using an RL benchmark.
본 발명은, 더티 페이지의 크기와 전체 로그 레코드의 크기를 비교하여, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 작으면, 생성된 전체 로그 레코드를 로그 파일에 저장하는 제 1 로깅 방식을 수행하고, 생성된 전체 로그 레코드의 크기가 더티 페이지의 크기보다 더 크면, 더티 페이지를 로그 파일에 저장하는 제 2 로깅 방식을 수행할 수 있다.The present invention compares the size of a dirty page with the size of an entire log record, and if the size of the generated total log record is smaller than the size of the dirty page, a first logging method for storing the generated total log record in a log file If the size of the generated total log record is larger than the size of the dirty page, the second logging method of storing the dirty page in the log file may be performed.
즉, 제 1 로깅 방식은, 변경 이력만을 로깅하는 page-oriented logging only 방식이고, 제 2 로깅 방식은, 더티 페이지의 크기와 전체 로그 레코드의 크기를 비교한 결과에 따라, 변경 이력 로그와 변경본 로그 중, 작은 로그를 선택하는 bimodal logging 방식이다.That is, the first logging method is a page-oriented logging only method for logging only the change history, and the second logging method is based on a result of comparing the size of the dirty page with the size of the entire log record. Bimodal logging method selects small logs among logs.
도 20에 도시된 바와 같이, 본 발명은, 제 2 로깅 방식으로 로깅을 수행할 경우, 로그 파일의 크기가 기존 방식보다 더 많이 줄어들었음을 알 수 있다.As shown in FIG. 20, when the logging is performed in the second logging method, it can be seen that the size of the log file is reduced more than the conventional method.
이와 같이, 본 발명은, 변경된 페이지 전체를 로깅하지 않고 페이지마다 데이터베이스 파일을 변경하는 연산만을 로깅함으로써, 로그 파일의 크기를 줄이고 전체 입/출력 부하를 낮출 수 있다.As described above, the present invention can reduce the size of the log file and lower the overall input / output load by logging only an operation for changing the database file for each page without logging the entire changed page.
그리고, 본 발명은, 체크 포인트 시, 데이터베이스 파일에 대한 싱크(sync) 연산만을 수행하므로, 추가적인 마이그레이션 비용(migration cost)가 필요한 WAL 방식에 비해, 체크포인트 속도를 개선할 수 있으며, 이를 통해 ANR(Application Not Responding)의 문제 해결이 가능하다.In addition, since the present invention performs only a sync operation on the database file at the checkpoint, the checkpoint speed can be improved compared to the WAL method that requires an additional migration cost. Application Not Responding).
또한, 본 발명은, 읽기 시, WAL 방식의 경우, WAL 파일을 무조건 한 번 검색해야 하므로, 선택(select) 연산에 불리하지만, 본 발명의 경우, 데이터베이스 파일만을 검색하므로, 검색 비용을 더 낮출 수 있다.In addition, the present invention is disadvantageous in the selection operation because the WAL file must be searched once unconditionally in the case of reading, but in the present invention, since only the database file is searched, the search cost can be lowered. have.
이상, 본 발명은 본 발명의 정신 및 필수적 특징을 벗어나지 않는 범위에서 다른 특정한 형태로 구체화될 수 있음은 당업자에게 자명하다. It will be apparent to those skilled in the art that the present invention can be embodied in other specific forms without departing from the spirit and essential features of the present invention.
전술한 본 발명은, 프로그램이 기록된 매체에 컴퓨터가 읽을 수 있는 코드로서 구현하는 것이 가능하다. 컴퓨터가 읽을 수 있는 매체는, 컴퓨터 시스템에 의하여 읽혀질 수 있는 데이터가 저장되는 모든 종류의 기록장치를 포함한다. 컴퓨터가 읽을 수 있는 매체의 예로는, ROM, RAM, CD-ROM, 자기 테이프, 플로피 디스크, 광 데이터 저장 장치 등이 있으며, 또한 캐리어 웨이브(예를 들어, 인터넷을 통한 전송)의 형태로 구현되는 것도 포함한다. 또한, 상기 컴퓨터는 단말기의 제어부를 포함할 수도 있다.The present invention described above can be embodied as computer readable codes on a medium in which a program is recorded. The computer-readable medium includes all kinds of recording devices in which data that can be read by a computer system is stored. Examples of computer-readable media include ROM, RAM, CD-ROM, magnetic tape, floppy disks, optical data storage devices, and the like, which are also implemented in the form of carrier waves (eg, transmission over the Internet). It also includes. In addition, the computer may include a control unit of the terminal.
따라서, 상기의 상세한 설명은 모든 면에서 제한적으로 해석되어서는 아니되고 예시적인 것으로 고려되어야 한다. 본 발명의 범위는 첨부된 청구항의 합리적 해석에 의해 결정되어야 하고, 본 발명의 등가적 범위 내에서의 모든 변경은 본 발명의 범위에 포함된다.Accordingly, the above detailed description should not be construed as limiting in all aspects and should be considered as illustrative. The scope of the invention should be determined by reasonable interpretation of the appended claims, and all changes within the equivalent scope of the invention are included in the scope of the invention.
다양한 실시 예가 본 발명을 실시하기 위한 최선의 형태에서 설명되었다.Various embodiments have been described in the best mode for carrying out the invention.
본 발명은 데이터를 변경 및 복구할 수 있도록 하는 데이터베이스 관리 시스템과 관련된 분야에서 이용된다.The present invention is used in the field related to a database management system that enables data to be changed and recovered.
본 발명의 사상이나 범위를 벗어나지 않고 본 발명에서 다양한 변경 및 변형이 가능함은 당업자에게 자명하다. 따라서, 본 발명은 첨부된 청구항 및 그 동등 범위 내에서 제공되는 본 발명의 변경 및 변형을 포함하는 것으로 의도된다.It will be apparent to those skilled in the art that various changes and modifications can be made in the present invention without departing from the spirit or scope of the invention. Accordingly, it is intended that the present invention cover the modifications and variations of this invention provided they come within the scope of the appended claims and their equivalents.

Claims (20)

  1. 페이지 단위로 구성된 데이터베이스 파일을 저장하는 데이터베이스;A database storing a database file organized in units of pages;
    트랜잭션(transaction)이 수행된 데이터베이스 파일에 대한 로그 파일을 생성하는 로그 파일 생성부;A log file generation unit generating a log file for a database file on which a transaction is performed;
    상기 데이터베이스 파일의 트랜잭션을 수행하는 트랜잭션 수행부; 그리고,A transaction execution unit that performs a transaction of the database file; And,
    상기 데이터베이스, 로그 파일 생성부 및 트랜잭션 수행부를 제어하는 제어부를 포함하고,A control unit for controlling the database, a log file generation unit, and a transaction execution unit;
    상기 제어부는,The control unit,
    상기 데이터베이스 파일의 트랜잭션이 요청되면, 상기 데이터베이스 파일의 트랜잭션을 수행하도록, 상기 트랜잭션 수행부를 제어하고,When a transaction of the database file is requested, the transaction execution unit is controlled to perform a transaction of the database file.
    상기 데이터베이스 파일의 트랜잭션이 수행되면, 상기 데이터베이스 파일의 페이지들 중, 내용이 변경된 더티 페이지(dirty page) 별로, 변경 내역에 대한 로그 레코드(log record)를 생성하고, 상기 데이터베이스에 상기 트랜잭션이 커밋(commit)되면, 상기 생성된 전체 로그 레코드를 상기 로그 파일에 저장하도록, 상기 로그 파일 생성부를 제어하는 것을 특징으로 하는 데이터베이스 관리 시스템.When a transaction of the database file is performed, a log record of a change history is generated for each dirty page whose contents are changed among the pages of the database file, and the transaction is committed to the database. and committing, controlling the log file generating unit to store the generated entire log record in the log file.
  2. 제 1 항에 있어서, 상기 제어부는,The method of claim 1, wherein the control unit,
    상기 생성된 전체 로그 레코드를 상기 로그 파일에 저장할 때,When storing the generated full log record in the log file,
    상기 생성된 전체 로그 레코드의 크기가 상기 더티 페이지의 크기보다 더 작으면, 상기 생성된 전체 로그 레코드를 상기 로그 파일에 저장하고,If the size of the generated full log record is smaller than the size of the dirty page, store the generated full log record in the log file,
    상기 생성된 전체 로그 레코드의 크기가 상기 더티 페이지의 크기보다 더 크면, 상기 더티 페이지를 상기 로그 파일에 저장하도록, 상기 로그 파일 생성부를 제어하는 것을 특징으로 하는 데이터베이스 관리 시스템.And control the log file generator to store the dirty page in the log file when the size of the generated total log record is larger than the size of the dirty page.
  3. 제 1 항에 있어서, 상기 로그 파일은,The method of claim 1, wherein the log file,
    로그 페이지 단위로 구성되고,Organized in log pages,
    상기 로그 페이지는,The log page,
    로그 페이지 정보를 포함하는 로그 페이지 헤더, 각 로그 레코드의 위치 및 길이 정보를 포함하는 로그 포인터, 로그 데이터를 포함하는 로그 레코드로 구성되는 것을 특징으로 하는 데이터베이스 관리 시스템.And a log page header including log page information, a log pointer including position and length information of each log record, and a log record including log data.
  4. 제 3 항에 있어서, 상기 로그 페이지 헤더는,The method of claim 3, wherein the log page header,
    로그 페이지 번호, 로그 페이지 내의 로그 레코드 개수, 사용 가능한 공간, 그리고 플래그 중, 적어도 어느 하나의 정보를 포함하는 것을 특징으로 하는 데이터베이스 관리 시스템.And at least one of a log page number, a number of log records in a log page, available space, and a flag.
  5. 제 3 항에 있어서, 상기 로그 포인터는,The method of claim 3, wherein the log pointer,
    상기 로그 레코드의 위치 정보를 저장하는 제 1 유닛과,A first unit for storing position information of the log record;
    상기 로그 레코드의 길이 정보를 저장하는 제 2 유닛을 포함하는 것을 특징으로 하는 데이터베이스 관리 시스템.And a second unit for storing length information of the log record.
  6. 제 3 항에 있어서, 상기 로그 레코드는,The method of claim 3, wherein the log record,
    작업 명령 정보를 저장하는 제 1 유닛;A first unit for storing work instruction information;
    상기 작업이 수행된 데이터베이스 파일의 더티 페이지 번호를 저장하는 제 2 유닛;A second unit for storing a dirty page number of the database file on which the operation is performed;
    상기 더티 페이지 내에서, 상기 작업이 수행된 셀 번호를 저장하는 제 3 유닛; 그리고,A third unit for storing a cell number in which the operation is performed in the dirty page; And,
    상기 작업 명령에 따른 로그 데이터를 저장하는 제 4 유닛을 포함하는 것을 특징으로 하는 데이터베이스 관리 시스템.And a fourth unit for storing log data according to the work command.
  7. 제 3 항에 있어서, 상기 로그 포인터와 상기 로그 레코드는,The method of claim 3, wherein the log pointer and the log record,
    서로 일대일 대응하여 배치되는 것을 특징으로 하는 데이터베이스 관리 시스템.Database management system, characterized in that arranged in one-to-one correspondence with each other.
  8. 제 3 항에 있어서, 상기 로그 포인터의 개수와 상기 로그 레코드의 개수는,The method of claim 3, wherein the number of log pointers and the number of log records are:
    서로 동일한 것을 특징으로 하는 데이터베이스 관리 시스템.Database management system, characterized in that the same.
  9. 제 3 항에 있어서, 상기 로그 포인터는,The method of claim 3, wherein the log pointer,
    상기 로그 레코드가 상기 로그 페이지 내에 삽입될 때, 생성되는 것을 특징으로 하는 데이터베이스 관리 시스템.And when the log record is inserted into the log page.
  10. 제 3 항에 있어서, 상기 로그 포인터는,The method of claim 3, wherein the log pointer,
    상기 로그 레코드가 상기 로그 페이지 내에 삽입되기 전인 상기 로그 레코드가 생성될 때, 생성되는 것을 특징으로 하는 데이터베이스 관리 시스템.And when the log record is generated before the log record is inserted into the log page.
  11. 제 3 항에 있어서, 상기 로그 페이지 헤더는,The method of claim 3, wherein the log page header,
    상기 로그 페이지의 시작 지점에 저장되고,Stored at the beginning of the log page,
    상기 로그 포인터는,The log pointer is,
    상기 로그 레코드가 상기 로그 페이지에 삽입되는 순서에 따라, 상기 로그 페이지 헤더로부터 상기 로그 페이지의 끝 지점 방향으로 순차 저장되며,The log record is sequentially stored from the log page header toward the end point of the log page according to the order of insertion of the log record into the log page,
    상기 로그 레코드는,The log record,
    상기 로그 레코드가 상기 로그 페이지에 삽입되는 순서에 따라, 상기 로그 페이지의 끝 지점으로부터 상기 시작 지점 방향으로 순차 저장되는 것을 특징으로 하는 데이터베이스 관리 시스템.And sequentially storing the log record in the direction from the end point of the log page to the start point in the order of insertion of the log record into the log page.
  12. 제 11 항에 있어서, 상기 로그 포인터는,The method of claim 11, wherein the log pointer,
    상응하는 현재 로그 레코드의 길이 정보와 위치 정보를 포함하는 것을 특징으로 하는 데이터베이스 관리 시스템.And length information and position information of a corresponding current log record.
  13. 제 3 항에 있어서, 상기 로그 페이지 헤더는,The method of claim 3, wherein the log page header,
    상기 로그 페이지의 시작 지점에 저장되고,Stored at the beginning of the log page,
    상기 로그 포인터와 로그 레코드는,The log pointer and log record,
    상기 로그 레코드가 상기 로그 페이지에 삽입되는 순서에 따라, 상기 로그 페이지 헤더로부터 상기 로그 페이지의 끝 지점 방향으로 순차 저장되는 것을 특징으로 하는 데이터베이스 관리 시스템.And sequentially storing the log record in the direction of the end point of the log page from the log page header in the order of insertion of the log record into the log page.
  14. 제 13 항에 있어서, 상기 로그 포인터는,The method of claim 13, wherein the log pointer,
    상응하는 현재 로그 레코드의 길이 정보와,The length information of the corresponding current log record,
    이전 로그 레코드의 위치 정보를 포함하는 것을 특징으로 하는 데이터베이스 관리 시스템.A database management system, comprising the location information of previous log records.
  15. 제 3 항에 있어서, 상기 제어부는,The method of claim 3, wherein the control unit,
    상기 로그 페이지 내에 삽입되는 상기 로그 레코드의 개수가, 상기 로그 페이지의 빈 공간 크기를 초과하면, 새로운 추가 로그 페이지를 생성하고,If the number of log records inserted in the log page exceeds the amount of free space of the log page, create a new additional log page,
    상기 로그 페이지 헤더 내에 오버플로우 플래그를 추가하도록, 상기 로그 파일 생성부를 제어하는 것을 특징으로 하는 데이터베이스 관리 시스템.And controlling the log file generator to add an overflow flag in the log page header.
  16. 제 1 항에 있어서, 상기 제어부는,The method of claim 1, wherein the control unit,
    상기 로그 레코드 생성 시,When generating the log record,
    상기 더티 페이지에 대한 변경 이력을 확인하고, 상기 더티 페이지에 변경 이력이 존재하면, 상기 더티 페이지의 변경 내역에 대한 로그 레코드를 생성하여, 상기 생성된 전체 로그 레코드를 상기 로그 파일에 저장하고,Check the change history for the dirty page, and if a change history exists in the dirty page, generate a log record for the change history of the dirty page, and store the generated entire log record in the log file,
    상기 더티 페이지에 변경 이력이 존재하지 않으면, 상기 더티 페이지의 변경 내역에 대한 로그 레코드 생성 없이, 상기 더티 페이지 전체를 상기 로그 파일에 저장하도록, 상기 로그 파일 생성부를 제어하는 것을 특징으로 하는 데이터베이스 관리 시스템.And if the change history does not exist in the dirty page, controlling the log file generator to store the entire dirty page in the log file without generating a log record of the change history of the dirty page. .
  17. 제 16 항에 있어서, 상기 제어부는,The method of claim 16, wherein the control unit,
    상기 더티 페이지에 대한 변경 이력을 확인할 때,When checking the change history for the dirty page,
    비트맵 인덱스(bitmap index)를 이용하여 변경 이력을 확인하는 것을 특징으로 하는 데이터베이스 관리 시스템.A database management system, characterized by checking the change history using a bitmap index.
  18. 제 1 항에 있어서, 상기 제어부는,The method of claim 1, wherein the control unit,
    상기 트랜잭션이 커밋될 때,When the transaction is committed,
    상기 로그 파일의 커밋 로그 레코드(commit log record)에 체크섬(checksum)을 저장하는 것을 특징으로 하는 데이터베이스 관리 시스템.And storing a checksum in a commit log record of the log file.
  19. 제 18 항에 있어서, 상기 제어부는,The method of claim 18, wherein the control unit,
    상기 데이터베이스 파일의 복구 시에, 상기 체크섬과 상기 로그 레코드의 내용을 비교하고,Upon recovery of the database file, comparing the checksum with the contents of the log record,
    상기 체크섬과 상기 로그 레코드의 내용이 다르면, 해당하는 트랜잭션을 실패로 판정하고, 재수행(redo) 과정에서 상기 로그 레코드를 제외시키는 것을 특징으로 하는 데이터베이스 관리 시스템.And if the contents of the checksum and the log record are different, determine the corresponding transaction as a failure, and exclude the log record in the redo process.
  20. 트랜잭션(transaction)이 수행된 데이터베이스 파일에 대한 로그 파일을 생성하는 데이터베이스 관리 시스템의 데이터 복구 방법에 있어서,In the data recovery method of a database management system for generating a log file for a database file on which a transaction is performed,
    데이터 복구 요청을 수신하는 단계;Receiving a data recovery request;
    복구하고자 하는 데이터베이스 파일에 대한 로그 파일의 존재를 확인하는 단계;Checking the existence of a log file for the database file to be recovered;
    상기 로그 파일이 존재하면, 상기 로그 파일의 마지막 로그 레코드로부터 마지막 커밋 로그 레코드까지 역순서로 검색하여, 상기 복구하고자 하는 데이터베이스 파일에 대한 원본 페이지가 존재하는지를 확인하는 단계;If the log file exists, searching for the reverse log from the last log record of the log file to the last commit log record to determine whether there is an original page for the database file to be restored;
    상기 원본 페이지가 존재하면, 상기 원본 페이지를 상기 데이터베이스 파일에 저장하는 단계;If the original page exists, storing the original page in the database file;
    상기 로그 파일의 마지막 체크포인트 로그 레코드로부터 마지막 커밋 로그 레코드까지 정순서로 검색하여, 그들 사이에 존재하는 로그 레코드를 재수행하는 단계; 그리고,Retrieving log records existing between the last checkpoint log record and the last commit log record of the log file in order; And,
    상기 로그 파일의 마지막 커밋 로그 레코드 이후에 존재하는 로그 레코드를 삭제하는 단계를 포함하는 것을 특징으로 하는 데이터베이스 관리 시스템의 데이터 복구 방법.And deleting the log record existing after the last commit log record of the log file.
PCT/KR2016/008849 2015-11-10 2016-08-11 Database management system, and data modification and recovery method thereof WO2017082520A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2015-0157340 2015-11-10
KR1020150157340A KR20170054767A (en) 2015-11-10 2015-11-10 Database management system and method for modifying and recovering data the same

Publications (1)

Publication Number Publication Date
WO2017082520A1 true WO2017082520A1 (en) 2017-05-18

Family

ID=58695745

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2016/008849 WO2017082520A1 (en) 2015-11-10 2016-08-11 Database management system, and data modification and recovery method thereof

Country Status (2)

Country Link
KR (1) KR20170054767A (en)
WO (1) WO2017082520A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284179A (en) * 2018-08-07 2019-01-29 北京达佳互联信息技术有限公司 Solve method, apparatus, electronic equipment and the storage medium of application program Caton
CN111104259A (en) * 2019-12-23 2020-05-05 厦门市美亚柏科信息股份有限公司 Database recovery method and device and storage medium
CN112015807A (en) * 2019-05-31 2020-12-01 阿里巴巴集团控股有限公司 Data synchronization processing method and device, electronic equipment and computer storage medium
CN115129739A (en) * 2022-08-31 2022-09-30 杭州沃趣科技股份有限公司 Data file breakpoint continuous transmission method, device, equipment and storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101990329B1 (en) * 2017-08-10 2019-06-18 주식회사 티맥스데이터 Method and apparatus for improving database recovery speed using log data analysis
KR102085608B1 (en) * 2018-12-21 2020-03-06 주식회사 티맥스데이터 Recovery server and computer programs
KR20240056278A (en) 2022-10-21 2024-04-30 네이버 주식회사 Method for data recovery and computing apparatus using the same

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0628043A (en) * 1992-06-30 1994-02-04 Toshiba Corp Static switch
JP2004062759A (en) * 2002-07-31 2004-02-26 Hitachi Ltd Database log management method, its device and its program
KR20050052016A (en) * 2003-11-28 2005-06-02 한국전자통신연구원 Method of and apparatus for logging and restoring the meta data in file system
KR20080044480A (en) * 2006-11-16 2008-05-21 삼성전자주식회사 Method for deferred logging and apparatus thereof
KR20080084263A (en) * 2007-03-15 2008-09-19 주식회사넥싸이트 Apparatus and method for recovering damaged data of serial eeprom

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0628043A (en) * 1992-06-30 1994-02-04 Toshiba Corp Static switch
JP2004062759A (en) * 2002-07-31 2004-02-26 Hitachi Ltd Database log management method, its device and its program
KR20050052016A (en) * 2003-11-28 2005-06-02 한국전자통신연구원 Method of and apparatus for logging and restoring the meta data in file system
KR20080044480A (en) * 2006-11-16 2008-05-21 삼성전자주식회사 Method for deferred logging and apparatus thereof
KR20080084263A (en) * 2007-03-15 2008-09-19 주식회사넥싸이트 Apparatus and method for recovering damaged data of serial eeprom

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LEE, JOON HEE ET AL.: "A Novel Recovery Scheme for SQLite Based on Logical Logging", JOURNAL OÍKL1T, vol. 12, no. 11, 30 November 2014 (2014-11-30), pages 181 - 192, XP055382000 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109284179A (en) * 2018-08-07 2019-01-29 北京达佳互联信息技术有限公司 Solve method, apparatus, electronic equipment and the storage medium of application program Caton
CN112015807A (en) * 2019-05-31 2020-12-01 阿里巴巴集团控股有限公司 Data synchronization processing method and device, electronic equipment and computer storage medium
CN111104259A (en) * 2019-12-23 2020-05-05 厦门市美亚柏科信息股份有限公司 Database recovery method and device and storage medium
CN111104259B (en) * 2019-12-23 2022-08-12 厦门市美亚柏科信息股份有限公司 Database recovery method and device and storage medium
CN115129739A (en) * 2022-08-31 2022-09-30 杭州沃趣科技股份有限公司 Data file breakpoint continuous transmission method, device, equipment and storage medium
CN115129739B (en) * 2022-08-31 2022-11-25 杭州沃趣科技股份有限公司 Data file breakpoint continuous transmission method, device, equipment and storage medium

Also Published As

Publication number Publication date
KR20170054767A (en) 2017-05-18

Similar Documents

Publication Publication Date Title
WO2017082520A1 (en) Database management system, and data modification and recovery method thereof
WO2018101640A1 (en) Consistency recovery method for seamless database duplication
WO2018159997A1 (en) Method and apparatus for performing test by using test case
WO2014208863A1 (en) Integrated data management apparatus and method for non-volatile buffer cache and non-volatile storage
CN108416040B (en) Database repair method and device, terminal equipment and storage medium
WO2018034426A1 (en) Method for automatically correcting error in tagged corpus by using kernel pdr
WO2014000641A1 (en) High-performance cache system and method
WO2014032262A1 (en) Implementation method and system for migrating application among platforms&lt;0}
WO2016204529A1 (en) Memory storage device and method for preventing data loss after power loss
US7823007B2 (en) Apparatus, system, and method for switching a volume address association in a point-in-time copy relationship
WO2020101343A1 (en) Method for implementing change data capture in database management system
KR100515890B1 (en) Method of efficiently recovering database
WO2021040167A1 (en) Software update agent apparatus and patch method using same
WO2019088334A1 (en) System for storing and searching big data in real-time
WO2015002481A1 (en) Apparatus and method for managing buffer having three states on the basis of flash memory
WO2021080385A1 (en) Computing device and operating method thereof
WO2017035785A1 (en) Method and apparatus for locating memory leakage
WO2015005636A1 (en) Memory system and data processing method for memory
WO2018076872A1 (en) Data backup method, apparatus, storage medium and server
WO2019062093A1 (en) Raid management method and device, and computer-readable storage medium
WO2018236141A1 (en) Crash report grouping method, server and computer program
WO2016192110A1 (en) File information processing method and device, and file processing apparatus and system
WO2019062103A1 (en) Method of mounting disk array, android device and storage medium
WO2021172708A1 (en) Method for processing cache barrier command for disk array, and device therefor
WO2023163405A1 (en) Method and apparatus for updating or replacing credit evaluation model

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: 16864446

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16864446

Country of ref document: EP

Kind code of ref document: A1