A SYSTEM FOR TAKING BACKUP IN A DATA BASE

Abstract: For backing up in a distributed real time data base on primary memory in operation, all data in the data base are structured as belonging to one of several logic data bases, a logic data base being able to, but need not extend over several processors. A backup function of a certain logic data base is activated by sending a message to a central backup handler, which has information regarding processors, over which the current backup system extends, and synchronizes the backup function over processor borders. The synchronization includes that local data base handlers are informed that backup will be started and that a new transaction log is being created, in which all transactions having not attained commit state and which shall therefore not be included in the backup are logged. The backup will thereafter only contain changes of transactions in the old transaction log.

Description: A system for taking backup in a data base Technical area, The present invention relates to a system for taking backup in a distributed real time data base in operation, which is located on primary memory. A data base normally has a recover functionality responsive for data stored in the data base being consistent, i.e. being in a state to be expected with respect to different up dates. For enabling recovery from errors write-damaging the data base a backup version need to be stored. A backup includes all information necessary for being able to recover the data base to the same consistent state that prevailed at the time when the backup version was created. A typical strategy for recovery a data base can be summarized as follows. If the data base has become inconsistent due to a catastrophic error having occured, the recovery function orders restart with reloading of the data base to the latest backup version. In order to enable return to a more current state the data base is then updated with information that has been stored on a log, i.e. a history of earlier operations stored in a memory which is used by the recovery function for restoring the latest allowed transactions, i.e. operations on objects or records in the data base. The concept of object is here intended to have the conventional meaning within the data processing art. In short an object is an information packet with an associated description of how to manage its information. The objects are divided into classes after thei area of use, and are identified by means of object identities. A more detailed description of the concept of object can be found e.g. in "OBJECT-ORIENTED ANALYSIS" by Peter Coad and Edward Yourdon, Yourdon Press Computing Series. The information and mechanisms required for recovery of the data base are determined by the method chosen for updating the data base. In case of updating an object a copy of the original object is created, a lock is set for preventing other users from updating the data base and first at commit, i.e. the transaction operation used by a program or an operator for indicating that a current transaction has been ended and that its effects should remain, the updated copy is switched in and set locks are released. Copied objects or objects which shall not be submitted to backup are erased at restart of the database with reloading. State of the art. Within the current technical area it is a demand that the data base system must not stop during backing up. In U.S. patent specification 4 077 059 a system is described having a hierarchic memory with two memory units on each level. One of the units contains all data on this level. The other unit contains only changes which have been made to these data. By duplicating and recovering only changed data, the amount of data which must be transported in case of errors, is decreased. The patent specification in question does not describe a data base system in a strict sense. There is no backing up functionality activated by a central handler which has information about the system and synchronizes the functionality. U.S., A,4 714 995 describes an integrated processor system with associated data bases. Integration is done of processor systems having a need of sharing certain common data elements, where each processor system has a data base. The object is to perform controlled copying. Relations and transactions are allowed to extend over several data bases. Disclosure of the invention. One object of the invention is to provide a system of the kind indicated by way of introduction, by means of which transactions are allowed to perform operations to the data base at the same time as backing up is performed. In accordance with the invention this has been attained in a backup system for a real time data base on primary memory in operation, said data base being distributed over a number of processors which execute the different functionalities, such as different steps and features, stated below, by said back up system comprising a number of logic data bases, of which each is able to extend over several of said processors, and each has a backup functionality associated therewith, all data in said real time data base being structured as being distributed over said logic data bases, a central backup handler, which has information regarding processors, over which the backup system extends, a local database handler for each processor, activating functionality for activating said backup functionality of a current one of said logic data bases by sending a message to said central backup handler to perform synchronization of the backup functionality over processors over which said current logic data base extends, said synchronization including that the local data base handlers are informed that backup will be started and that a new transaction log should be created, in which all transactions which shall not be included in the backup are logged, so as to enable that backup will only contain changes of transactions in an earlier transaction log. Preferred embodiments of the invention have the features included in the enclosed dependent claims. In other words, the invention envolves that all data in the data base are structured as belonging to one of several logic data bases, a logic data base being able to, but need not extend over several processors. The backup function of a certain logic data base is activated by sending a message to a central backup handler, which has information regarding processors, over which the current backup system extends, and synchronizes the backup function over processor borders. The synchronization includes that local data base handlers are informed that backup will be started and that a new transaction log is being created, in which all transactions having not attained commit state and shall therefore not be included in the backup are logged. Backup will then contain only changes of transactions in the old transaction log. According to an embodiment activation of the backup functionality for a certain logic data base is performed periodically or, at need, by an operator. Preferably the synchronization includes that the central backup handler instructs the local data base handlers to set a backup flag in the logic data base in question, which informs the local data base handlers that backup will be started and makes that they change behaviour with respect to storing objects located in the current logic data base, whereupon, after set backup flag, the local data base handlers acknowledge by informing the central backup handler that this has been carried through. When all local data base handlers have acknowledged, the central backup handler instructs all local log handlers for current processors to create the new transaction log. Preferably the new transaction log may include a "BackupSynch" variable which can take the values "Include" or "Exclude" and the value of which is used by the local data base handler and by the local backup handlers to decide whether objects shall be included in a backup or not, the central backup handler instructing the local log handlers to change said variable in the new transaction log to "Exclude", implying that the object thereof shall not be included in the backup. The "BackupSynch" variable may be collected from a coordinator for a transaction in connection with entering "COMMIT" into the transaction log, implying that the transaction has attained commit state, and then sends the value of the "BackupSynch" variable and the "COMMIT" message to all participating transactions, which in turn distribute the "BackupSynch" value to the different data base objects, whereby all objects in the transaction get the same "BackupSynch" value and will be included in or alternatively excluded from backup. Acording to a further embodiment a counter is arranged to indicate the number of proceeding transactions in COMMIT state towards the old transaction log, the synchronization including that when the count of the counter is 0, the central backup functionality is informed that there is no coordinator for any transaction in the current processor wishing that updatings shall be included in the backup. In still a further embodiment copying of objects to the backup area will start after the local log handlers have been informed that the local data base handler has made all changes from transactions, which shall be included in the backup, visible in the data base. Preferably the making visible may include synchronization between the local data base handler, backup handler and local handler. The synchronization may be performed by the local log handler keeping up with the number of transactions existing in the old transaction log, the number of transactions are counted down when the transaction enters END-TRANSACTION in the old transaction log, and END-TRANSACTION is entered when the local data base handler has performed the changes in the data base and informed this to transaction. Preferably the central backup handler instructs all local backup handlers, when the number of transactions in the old transaction log is 0 in all local log handlers, to begin copying objects to be included in the backup to the backup area, said objects having been backup marked by the local data base handler in response to its change of behaviour when the backup flag was set. According to a further embodiment copying of objects is performed to the backup area, and the old backup is stored in a primary memory until the new backup is ended, whereupon the old backup is packeted and stored in a secondary memory. Description of the drawings. Embodiments of the invention will now be described more closely with reference to the attached drawings, on which Fig. 1 is intended to illustrate schematically a solution for primary memory backup of a data base, where the invention can be used, Figures 2 - 8 are flow charts illustrating the backing up functionality in a data base according to Figure 1, Figure 9 in a similar view as Figure 1 illustrates the situation in the data base during an end stage of a backup performed in accordance with the invention, Figure 10 schematically illustrates a data base extending over two processors, the situation immediately before start of a backup being shown, Figure 11 enlarged and in more detail illustrates the data base and log situation in one of the processors according to Figure 10 at a later point of time during the backup, and Figures 12 - 14 are tables illustrating measures which may be required in connection with the backup described with reference to Figures 10 and 11. Preferred embodiments. Above and in the description given below with reference to embodiments, as well as in the drawings, different functionalities are referred to as "handlers", such as data base handler, backup handler, etc., "logic data base", etc. Such functionalities are programs or steps executed by the computers envolved, unless appearing otherwise from the concept. The concept of logic data base defined above may also alternately be denominated RecDB in the drawings, which is an abbreviation for Recovery Data Base. Figure l is divided into two parts 2 and 4, schematically representing a data base area and a backup area, respectively, in the primary memory of a processor. Associated with each area there is a catalogue 6 and 8, respectively, of objects with associated classes which are stored in the data base. Corresponding catalogues as the catalogues 6 and 8 may, below and on later drawing Figures, also be called LID-table. By means of respective pointer 10 and 12 objects to be subjected to an operation are chosen with knowledge of the associated class and key. Figure 1 illustrates the data base and backup areas 2 and 4 after certain updatings of data base objects. In the Figure objects updated since latest backup are identified with prime signs. Since latest backup objects A and C have been updataed to A' and C . Objects B and D have not been updated. The backup area is write protected but allows reading of data. More particularly only the updated objects A' and C are stored in the data base area 2, whereas objects A, B, C and D are stored in the backup area 4, and the data base points to the objects B and D in the backup area 4, indicated by arrows 14 and 16. According to one of the features of the invention all data in the data base are structured as belonging to one or more logic data bases, such a logic data base being able to, but need not, extend over several processors. Since such a data base, as mentioned above, can (but need not) extend over several processors, backing up of it will be distributed. According to one of the objects of the invention, transactions shall be allowed to perform operations towards the data base simultaneously with backing up. Within the transaction objects will be updated, created or erased, resulting in many different versions of an object being able to exist during the time of backing up. The backup functionality must therefore get information about the version of an object that shall be included in the backup. At first hand, this shall now be explained more closely with reference to the flow charts shown in Figures 2 - 8. To start with, from Figure 2 it appears that the backup function for a certain logic data base is activated by a user 30 by sending an instruction 32 to create backup to a central backup handler 34, the receipt of the instruction by the backup handler being indicated at 36. The central backup handler has information regarding the processors over which the current backup system extends and synchronizes the backup function over the processors, starting by taking the state STATE=SYNCHBACKUP, indicated at 38. The synchronization includes that local data base handlers, one of which has been indicated at 40, are informed that backup will be started, and are instructed to set backup flag. A new transaction log is created, in which all transactions which have not attained commit-state and which shall therefore not be included in the backup are logged. Thereupon backing up is performed only of changes of transactions in the old transaction log. More in detail the synchronization may imply the following: 1. The central backup handler 34 instructs, indicated at 42. the local data base handlers 40 to set backup flag in the current logic data base. The receipt of the instruction is indicated at 44. This instruction shall be acknowledged. The backup flag informs the local data base handlers that backup will be started and results in the local data base handlers changing behaviour as concerns storing of objects located in the logic data base in question. 2. The local data base handlers set backup flag and inform that this has been performed, marked at 46. The receipt of the message at the central backup handler is marked at 48. 3. Time supervision of all local data base handlers acknowledging is carried through with the steps indicated at 50 in Figure 2 and in Figure 3. When all the local data base handlers have acknowledged, the central backup handler instructs, indicated at 52, local log handlers 54 to perform the following steps. The performance of the steps is indicated by the steps shown at 56. a) Create a new transaction log where all transactions, which have not reached the commit phase and which therefore shall not be included in the backup, will be logged. b) Change a "BackupSynch"-variable, included in the transaction log to "Exclude" (see below) . c) When a counter indicating the number of proceeding transactions in commit state towards the earlier transaction log (the transaction log prevailing at start of the steps in accordance with paragraph 1 above) takes the count 0, the central backup functionality is informed that there is no coordinator for any transaction in the current processor that wants that updates shall be included in the backup. The sending of this message is indicated at 58, and the receipt thereof at 60. The "BackupSynch" variable can take the values "Include/Exclude", and its value shall be used by the local data base handler and by the local backup handler to decide whether an object shall be included in the backup or not. The "BackupSynch" variable is collected by the coordinator 30 for the transaction in connection with it entering "COMMIT" in the transaction log, indicated at 62 in Figure 5a and at 64 in Figure 5b. The sending and receipt of the "BackupSynch" variable is indicated at 66 in Figure 5b and at 68 in Figure 5a. The coordinator then sends the "BackupSynch" value and the Commit message to all participating transactions. These in turn distribute the "BackupSynch" value to the different data base objects. In this way it is secured that all objects in the transaction get the same "BackupSynch" value and will be included in or alternatively excluded from the backup. During the whole synchronization phase there will be two transaction logs: - one earlier (old) transaction log containing transactions the changes of which of the data base will be reflected in the backup, and - a new transaction log containing transactions being in other cases than COMMIT when backing up started and the changes of which of the data base will not be reflected by the backup. After the local log handlers having been informed of the change of the log, the above described synchronization is ready. Copying objects to the backup area will, however, not start until the local data base handler has made all changes from transactions to be included in the backup visable in the data base. This step therefore also requires a second synchronization, viz. between local data base handlers, local backup handlers and local log handlers. This synchronization is based upon the local log handler keeping up with the number of transactions in commit-state being included in the old transaction log. The number of transactions are counted down when the log handler receives an instruction to enter "END-TRANSACTION" in the old transaction log. "END- TRANSACTION" is entered when the local data base handler has performed the changes of the data base and has informed the transaction of this. The last mentioned steps are indicated in Figure 7a and b. To sum up, the second synchronizing involves that: 1. The local data base handler performs the changes included in the transaction and informs the transaction about this. 2. The transaction enters "END-TRANSACTION" in the transaction log. 3. The local log handlers count down the counter indicating the number of transactions in commit state in the transaction log and inform the central backup handler when the count is equal to zero. When the number of transactions in the old transaction log is zero in all local log handlers, the central backup handler instructs all local backup handlers to begin copying the objects to be included in the backup to the backup area. The sending of the instruction as well as the steps preceding this are indicated in Figure 4. The objects in question have, according to Figure 6, been backup marked in the LID table of the local data base handler as a response to the later changing behaviour when the backup flag was set. The behaviour of the local data base handler in association with backup appears from Figures 6, 8, and 9 and will be described more closely below. Copying of objects will be performed to the backup area. From security reasons the old backup will be left on the primary memory until the new backup is ended. Then the old backup will be packeted and stored in a secondary memory. During the time taken for creating the new backup and packeting the old one there will be two backup versions on the primary memory, which does not imply that all objects are doubled but only that the access structure or the objects which are specific for the respective backup. The situation is illustrated in Figure 9, where the same elements as in Figure 1 have the same reference numerals. Figure 9 will, in fact, be changed to in agreement with Figure l after ending of the backup steps. With referenc to Figures 10 and 11 an embodiment of the backup functionality will now be described. More particularly, the embodiment starts from the presumption that backup shall be taken at a time T=0 of a data base 100 extending over two processors Pl and P2, respectively. The associated backup area and log area are not shown. At T=0 there are two transactions Tl and T2 accessing the data base. In the processor Pl these transactions may form coordinator, indicated at K, and in the processor P2 participant, indicated with D. Figure 10 shows the situation at T=0, and Figure 11 shows an enlarged and more detailed view of the data base 100 in question in the processor Pl. Initiation of backup is performed in the following way. The first thing that happens at T=0 is that, in accordance with 42 in Figure 2, the central backup handler 118 of the processor Pl will instruct the local data base handlers in Pl and P2 to set the backup flag in the respective data base handler, the one of which in Pl is shown at 120. This is illustrated in Figure 11 by the fact that, in a cataloque 124 of applications, in the Figure called "RecDB-cataloque" (RecDB = Recovery Data Base), the backup flag is set to 1. According to 52 and 56 in Figure 2, the value of the "BackupSynch" variable in the log of Pl and P2 is changed from "include", indicated at 126 for the processor Pl, to "exclude". A new transaction log is created, cf. 56 in Figure 2, this being indicated for th processor Pl in Figure 11 at 128. At TO there are two transactions working towards the data base, viz. - the transaction Tl which is in the commit phase and shall update object B and remove object D in the processor Pl, and update the object F in the processor P2. - the transaction T2 being in the initial phase shall create object E in processor Pl and update object G in processor P2. Examples of synchronization of the transactions towards backup will now be described. Since the transaction Tl is a coordinating transaction it enters, according to 64 in Figure 5b, COMMIT in the old transaction log, indicated at 130 in Figure 11, and collects "BackupSynch=Include", cf. 68 in Figure 5a. The BackupSynch variable is sent to participator Tl in processor P2 in connection with GLOBAL-COMMIT. Then the transaction Tl will call different methods in the data base handler for making the changes, which have been performed to data by the transaction, visible in the data base. In the present embodiment the transaction Tl will desire to store object B' and and remove object B. Generally for all types of calls (when the backup flag is set) the data base handler compares the value in the BackupSynch variable of the object with the value of the same variable in the entry for the object in the LID table. Depending upon the result of the comparison and the method called by the object the data base handler will perform some of the measures described in the tables in Figures 12-14. In Figure 12 updating of objects is illustrated, in Figure 13 the creation of new objects, and in Figure 14 the removal of objects. For object B, which shall be updated the second case in column 2 is valid, since the backup value both in the data base record and in the LID table is include. For object D in Figure 14 likewise case 2 in column 2 is valid for the same reason as in the preceding case. Also the object E shall be included in the backup. When the data base handler has made the operations of the transaction Tl visible in the data base it will inform the transaction which in turn informs the log. The log counts down the number of transactions in the old commit log and since it now becomes 0 the central backup function is informed, cf. 58, 60 in Figure 2, that copying of objects from the data base area to the backup rarea has started. When the participating local log handlers have informed that they can start backup, the central backup handler instructs all local backup handlers to start dumping to backup, as appears from the steps included in Figure 4. For dumping objects to the backup area the following happens, with reference to Figure 8. The local backup handlers will go through the LID table, indicated at 140, and check the value of the BackupSynch variable, indicated at 142. If it is equal to "include" the object will be copied to the backup area, if it is equal to "exclude" the object will not be copied but the value of the variable is set to "Include" as a preparation for the next backup, cf. steps 144 and 146. When all objects in the LID table have been copied the objects in the backup buffer will be copied to the backup area. Then the backup handler will set the backup flag for the data base to zero so that the date base handler can revert to its usual behaviour.

Claims: Claims . 1. A backup system for a real time data base on primary memory in operation, said data base being distributed over a number of processors, which execute the different functionalities appearing below, said backup system being characterized by a number of logic data bases, of which each is able to extend over several of said processors, and each has a backup functionality associated therewith, all data in said real time data base being structured as being distributed over said logic data bases, a central backup handler, which has information regarding processors, over which the backup system extends, a local database handler for each processor, activating functionality for activating said backup functionality of a current one of said logic data bases by sending a message to said central backup handler to perform synchronization of the backup functionality over processors over which said current logic data base extends, said synchronization including that the local data base handlers are informed that backup will be started and that a new transaction log should be created, in which all transactions which shall not be included in the backup are logged, so as to enable that backup will only contain changes of transactions in an earlier transaction log. 2. A system according to claim 1, characterized by said activating functionality being optionally operable to activate said backup functionality of a logic database periodically or, should the need arise, by an operator. 3. A system according to claim 1 or 2, characterized by said synchronization including that the central backup handler instructs the local data base handlers to set a backup flag in the current logic data base informing the local data base handlers that backup will be started and making them to change behaviour with respect to storing objects located in the current logic data base, the local data base handlers after backup flag having been set acknowledging this to the central backup handler. 4. A system according to claim 3, characterized by the central backup handler instructing local log handlers of current processors to create the new transaction log when all local data base handlers have acknowledged that backup flag has been set. 5. A system according to claim 4, characterized by the new transaction log including a backup synchroization variable which can take the values "Include" or "Exclude", said value being used by the local data base handler and by local backup handlers to decide whether objects shall be included or not included, respectively, in a backup, the central backup handler instructing the local log handlers to change said variable in the new transaction log to "Exclude", implying that the object thereof shall not be included in the backup. 6. A system according to claim 5, characterized by the backup synchronization variable being collected by a coordinator for a transaction in connection with entering "COMMIT" into the transaction log, implying that the transaction has attained commit state, and then sends the value of the backup synchronization variable and the "COMMIT" message to all participating transactions, which in turn distribute the backup synchronization value to the different data base objects, whereby all objects in the transaction get the same backup synchronization value and will be included or excluded, as the case may be, from backup. 7. A system according to any of the preceding claims, characterized by a counter for indicating the number of proceeding transactions in COMMIT state towards the old transaction log, and said synchronization including that at 0 count of the counter the central backup functionality is informed that there is no coordinator for any transaction in the current processor wishing updatings to be included in the backup. 8. A system according to any of the preceding claims, characterized by starting copying of objects after having informed local log handlers that the local data base handler has made all changes from transactions, which shall be included in the backup, visible in the data base. 9. A system according to claim 8, characterized by the step of making visible includes synchronization between the local data base handler, backup handler and log handler. 10. A system according to claim 9, characterized by said synchronization being performed by the local log handler keeping up with the number of transactions existing in the earlier transaction log, the number of transactions being counted down as the transaction enters a message END- TRANSACTION in the earlier transaction log, the step of entering END-TRANSACTION being carried through when the local data base handler has performed the changes in the data base and informed this to the transaction. 11. A system according to claims 3 and 9, characterized by the central backup handler instructing all local backup handlers, when the number of transactions in the old transaction log is 0 in all local log handlers, to begin copying the objects to be included in the backup to the backup area, said objects having been backup marked by the local data base handler in response to its change of behaviour when the backup flag was set. 12. A system according to any of the preceding claims, characterized by copying of objects being performed to a backup area, and that the earlier backup is stored in a primary memory until the new backup is ended, whereupon the earlier backup is stored in a secondary memory.

Inventors: LARSSON BO ERIK SETFAN, SANCHEZ IVAN MARIA, LARSSON, BO, ERIK, STEFAN, SANCHEZ, IVAN, MARIA
Applicants: ERICSSON TELEFON AB L M, TELEFONAKTIEBOLAGET L M ERICSSON
Application year: 1993
Main classification: G06F15
IPC codes: G06F11, G06F12