CN1784676B - Database data recovery system and method - Google Patents
Database data recovery system and method Download PDFInfo
- Publication number
- CN1784676B CN1784676B CN200480001706.4A CN200480001706A CN1784676B CN 1784676 B CN1784676 B CN 1784676B CN 200480001706 A CN200480001706 A CN 200480001706A CN 1784676 B CN1784676 B CN 1784676B
- Authority
- CN
- China
- Prior art keywords
- database
- snapshot
- data
- page
- source
- Prior art date
- Legal status (The legal status 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 status listed.)
- Expired - Fee Related
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
相关申请参照Related application reference
本发明要求以下申请的优先权:美国临时申请第60/547,641号,其提交于2004年2月25日,标题为DATABASE DATA RECOVERY SYSTEM AND METHOD(数据库数据恢复系统和方法);美国非临时申请第10/833,541号,其提交于2004年4月28日,标题为DATABASE DATA RECOVERY SYSTEM AND METHOD(数据库数据恢复系统和方法),这些申请作为参考结合于此。此外,本发明是美国申请第10/611,774号的部分延续,该申请的标题为TRANSACTION CONSISTENTCOPY-ON-WRITE DATABASE(事务一致写复制数据库),其提交于2003年6月30日,也作为参考结合于此。This application claims priority to the following applications: U.S. Provisional Application No. 60/547,641, filed February 25, 2004, and entitled DATABASE DATA RECOVERY SYSTEM AND METHOD; U.S. Nonprovisional Application No. 10/833,541, filed April 28, 2004, and entitled DATABASE DATA RECOVERY SYSTEM AND METHOD, which applications are hereby incorporated by reference. Additionally, this invention is a continuation-in-part of U.S. Application Serial No. 10/611,774, entitled TRANSACTION CONSISTENT COPY-ON-WRITE DATABASE, filed June 30, 2003, also incorporated by reference here.
技术领域 technical field
本发明一般涉及数据库,尤其涉及数据库恢复技术。The present invention generally relates to databases, and more particularly to database restoration techniques.
背景background
在如今的世界上,数据库相当流行。数据库可通过便于迅速查询和容易使用的方式来储存大量的信息。例如,在传统关系型数据库中,信息可被组织为对象,如记录、表格和索引。数据库引擎提供了一种在用户指定了查询之后从数据库表格中检索并操纵数据的机制。查询通常是以某种查询语言来表达的,如结构化查询语言(SQL)。查询可指定一个或多个表格,以及其中要被检索或被操纵的行和列。通过适当地指定查询,数据库引擎检索数据、执行任何指定的操作并产生结果表格。数据库是受欢迎的和有用的,这至少部分是因为其储存大量数据的能力,这样的数据可通过简单地指定查询来有效地检索并操纵。Databases are quite popular in today's world. Databases can store large amounts of information in a manner that facilitates rapid query and ease of use. For example, in a traditional relational database, information can be organized into objects such as records, tables, and indexes. A database engine provides a mechanism for retrieving and manipulating data from database tables after a user specifies a query. Queries are usually expressed in some query language, such as Structured Query Language (SQL). A query specifies one or more tables, along with the rows and columns to be retrieved or manipulated. By specifying the query appropriately, the database engine retrieves the data, performs any specified operations, and produces the resulting tables. Databases are popular and useful at least in part because of their ability to store large amounts of data that can be efficiently retrieved and manipulated by simply specifying queries.
令人遗憾的是,用户错误是数据库系统中的常见问题。通常,这样的错误在数据库应用程序或用户错误地改变或删除数据,且数据库系统正确地遵循命令并迅速地改变或删除数据时发生。这在本领域中被称为快手指删除问题(quick fingerdelete problem)。例如,用户可能发出删除表格的命令,但忘记指定“WHERE”子句,这就导致比所预期的删除了更多数据。另外,用户可能安装新应用程序,而该新的应用程序以用户未知的方式修改数据库。对这个问题有几种传统解决方案。一般而言,最普通的解决方案是将数据全恢复到用户错误出现之前的时间点。一旦数据库被恢复,其可能成为在线状态,并且所有的变化,包括用户错误,均丢失了。然而,全数据库恢复是时间密集型的,有时候可能要花费数天来完成。Unfortunately, user error is a common problem in database systems. Typically, such errors occur when a database application or user mistakenly changes or deletes data, and the database system correctly follows orders and changes or deletes data promptly. This is known in the art as the quick finger delete problem. For example, a user might issue a command to delete a table, but forget to specify a "WHERE" clause, resulting in more data being deleted than expected. Additionally, a user may install a new application that modifies the database in ways unknown to the user. There are several traditional solutions to this problem. Generally speaking, the most common solution is to fully restore the data to a point in time before the user error occurred. Once the database is restored, it may go online and all changes, including user errors, are lost. However, full database restores are time-intensive and can sometimes take days to complete.
另外一种方法是,被无心修改的数据可通过将相关信息从恢复数据库中提取出来并将其合并回到原始数据库中来补救。有关这种方案的一种变化被称作日志运送(log shipping)。Alternatively, data that has been inadvertently modified can be remedied by extracting relevant information from the recovery database and merging it back into the original database. A variation on this scheme is called log shipping.
日志运送涉及以恢复状态保持另一次要服务器上的数据库的副本,但在原始服务器之后有一个恒定延迟。日志备份仅在延迟(如24小时)之后被应用于次要数据库上。若用户错误出现在原始数据库中,且数据库管理员在延迟时间内注意到该错误,则数据库管理员可还原到次要服务器,这是因为它已经包含了在该错误之前的时间点的数据库。令人遗憾的是,日志运送是复杂的,其需要许多附加资源和空间。Log shipping involves keeping a copy of the database on another secondary server in recovery state, but with a constant delay after the original server. Log backups are only applied to the secondary database after a delay (such as 24 hours). If a user error occurs in the original database, and the DBA notices the error within the delay time, the DBA can restore to the secondary server because it already contains the database from a point in time before the error. Unfortunately, log shipping is complex, requiring many additional resources and space.
使用传统的系统和方法恢复数据库需要相当长的延迟,因此它通常是最后采用的选项。此外,日志运送需要附加硬件,这就增加了数据库系统的复杂度。减少错误是数据库系统中重大且重要的问题。因此,本领域内需要一种除其它特征之外即快速又有效的恢复数据库的新系统和方法。Restoring a database using traditional systems and methods requires considerable latency, so it is usually an option of last resort. In addition, log shipping requires additional hardware, which increases the complexity of the database system. Reducing errors is a big and important problem in database systems. Accordingly, there is a need in the art for a new system and method for, among other features, fast and efficient restoration of a database.
概述overview
下面提供本发明的简化概述,以提供对本发明各方面的基本了解。这个概述不是本发明的详尽纵览。它并非要标识本发明的关键/决定性元素,或者描述本发明的范围。其唯一目的是以简单的形式提出本发明的某些概念,作为以后给出的更详细说明的序言。The following provides a simplified summary of the invention in order to provide a basic understanding of various aspects of the invention. This summary is not an extensive overview of the invention. It is not intended to identify key/critical elements of the invention or to delineate the scope of the invention. Its sole purpose is to present some concepts of the invention in a simplified form as a prelude to the more detailed description that is presented later.
本发明涉及数据库快照的创建和采用。本发明减轻了与恢复数据库相关联的问题,恢复数据库将花费时间并通常是最后采用的选项;以及与日志运送相关联的问题,日志运送通常需要附加硬件,从而增加了数据库系统的复杂度。还原到数据库快照缓解了某些这样的问题。根据本发明的一方面,数据库快照(DBSS)是看起来像另一(源)数据库的只读、间点副本的数据库。DBSS不必是源数据库的完整副本;这两个数据库共享对两者公用的数据,这就使DBSS能够被快速地创建并使空间有效。当源数据库被修改时,原始数据被复制到空间有效存储中,以供DBSS用来维持其源数据库的时间视图中的点。若用户错误发生在源数据库上,且DBSS已经在错误之前被创建了,则数据库管理员具有将整个数据库还原到DBSS的选项,这在用户错误之前的时间点处。对源数据库的所有改变,包括用户错误,都丢失了。而且,该还原一般比正常恢复快得多,且不需要日志运送所需要的重复资源。The present invention relates to the creation and utilization of database snapshots. The present invention alleviates the problems associated with restoring a database, which takes time and is usually an option of last resort, and with log shipping, which often requires additional hardware, adding to the complexity of the database system. Reverting to a database snapshot alleviates some of these problems. According to an aspect of the invention, a database snapshot (DBSS) is a database that looks like a read-only, point-in-time copy of another (source) database. The DBSS does not have to be a complete copy of the source database; the two databases share data that is common to both, which allows the DBSS to be created quickly and space efficiently. When the source database is modified, the original data is copied to space-efficient storage for use by the DBSS to maintain its point-in-time view of the source database. If the user error occurred on the source database, and the DBSS had been created before the error, the database administrator has the option of restoring the entire database to the DBSS, which was at the point in time before the user error. All changes to the source database, including user errors, are lost. Also, this restore is typically much faster than normal recovery and does not require the duplication of resources required for log shipping.
根据本发明的一方面,还原到数据库快照可包含在源或主要数据库上复制数据库快照文件页、截短主要数据库、将打开的未提交事务应用于数据库、以及使用数据库日志来集中于诸如用户错误等事件上。According to an aspect of the invention, reverting to a database snapshot may include copying the database snapshot file pages on the source or primary database, truncating the primary database, applying open uncommitted transactions to the database, and using the database log to focus on issues such as user error Wait for the event.
依照本发明的一方面,用户或数据库管理员可在不同的时间点处创建一个或多个数据库快照。例如,若用户要执行测试,则他/她可创建数据库快照,以使能还原到前一个数据库状态或视图。然而,根据本发明的另一个方面,一监视器组件可用来监视主要数据库,并在特定事件发生时自动创建数据库快照。例如,若监视器检测到或者能够推断新的应用程序将要被安装,则其可启动数据库快照的创建,以在新应用程序改变之前保存数据库的状态。According to an aspect of the invention, a user or database administrator can create one or more database snapshots at different points in time. For example, if a user wants to perform a test, he/she can create a database snapshot to enable reverting to a previous database state or view. However, according to another aspect of the present invention, a monitor component can be used to monitor the primary database and automatically create database snapshots when certain events occur. For example, if the monitor detects or can infer that a new application is about to be installed, it can initiate the creation of a database snapshot to preserve the state of the database before the new application changes.
根据本发明的又一方面,镜像数据库可被自动更新,以反映在还原时对主要数据库做出的改变。因此,镜像数据库可被更新并同步,而不使用其传统上使用的冗长的全恢复。According to yet another aspect of the present invention, the mirror database can be automatically updated to reflect changes made to the primary database while restoring. Thus, mirrored databases can be updated and synchronized without the lengthy full recovery that has traditionally been used.
为实现前述和相关的目的,这里结合下面的描述和附图,描述了本发明的某些说明性方面。这些方面表明可实施本发明的不同方法,所有这些方法都旨在由本发明所覆盖。当结合附图考虑时,可从下面本发明的详细描述中清楚本发明的其它优点和新颖特征。To the accomplishment of the foregoing and related ends, certain illustrative aspects of the invention are described herein, taken in conjunction with the following description and accompanying drawings. These aspects indicate different ways in which the invention can be practiced, all of which are intended to be covered by the invention. Other advantages and novel features of the invention will become apparent from the following detailed description of the invention when considered in conjunction with the accompanying drawings.
附图的简要说明Brief description of the drawings
从下面的详细描述和下文简要描述的附图中,本发明的前述和其它方面将变得显而易见。The foregoing and other aspects of the invention will become apparent from the following detailed description and the accompanying drawings briefly described below.
图1是依照本发明一方面的数据恢复系统的原理框图。FIG. 1 is a functional block diagram of a data recovery system in accordance with one aspect of the present invention.
图2是依照本发明一方面的恢复组件的原理框图。Figure 2 is a functional block diagram of a recovery component in accordance with an aspect of the invention.
图3示出了一时间线简图,以示出本发明的各方面。Figure 3 shows a simplified timeline diagram to illustrate aspects of the invention.
图4是依照本发明一方面的数据库快照系统的原理框图。FIG. 4 is a functional block diagram of a database snapshot system according to one aspect of the present invention.
图5是依照本发明一方面示出示例性数据库恢复的图示。FIG. 5 is a diagram illustrating exemplary database recovery in accordance with an aspect of the present invention.
图6是依照本发明一方面的示例性数据库镜像系统的原理框图。FIG. 6 is a functional block diagram of an exemplary database mirroring system in accordance with an aspect of the present invention.
图7是依照本发明一方面的示例性镜像系统的原理框图。7 is a functional block diagram of an exemplary mirroring system in accordance with an aspect of the present invention.
图8是依照本发明一方面的主要数据库的原理框图。Figure 8 is a functional block diagram of a primary database in accordance with an aspect of the present invention.
图9是依照本发明一方面的数据库快照系统的原理框图。FIG. 9 is a functional block diagram of a database snapshot system according to an aspect of the present invention.
图10是依照本发明一方面的示例性事务日志的原理框图。10 is a functional block diagram of an exemplary transaction log in accordance with an aspect of the present invention.
图11是依照本发明一方面描述建立快照数据库的方法的流程图。FIG. 11 is a flowchart describing a method for establishing a snapshot database according to an aspect of the present invention.
图12是依照本发明一方面示出恢复方法的流程图。FIG. 12 is a flowchart illustrating a recovery method in accordance with an aspect of the present invention.
图13是依照本发明一方面的数据恢复方法的流程图。FIG. 13 is a flowchart of a data recovery method according to an aspect of the present invention.
图14是依照本发明一方面示出合适的操作环境的原理框图。14 is a functional block diagram illustrating a suitable operating environment in accordance with one aspect of the present invention.
图15是可与本发明交互的示例计算环境的原理框图。15 is a functional block diagram of an example computing environment that can interact with the present invention.
详细描述A detailed description
现在参考附图来描述本发明,贯穿附图,相同的数字表示相同的元素。然而,应当理解的是,附图和详细描述并非要将本发明限于所揭示的具体形式。相反,本发明旨在覆盖落入本发明的精神和范围内的所有修改、等价方案以及替换方案。The present invention is now described with reference to the drawings, wherein like numerals refer to like elements throughout. It should be understood, however, that the drawings and detailed description are not intended to limit the invention to the precise form disclosed. On the contrary, the invention is intended to cover all modifications, equivalents, and alternatives falling within the spirit and scope of the invention.
如在本申请中所使用的,术语“组件”和“系统”是指计算机相关实体,其或者是硬件、硬件和软件的组合、软件、或者是执行中的软件。例如,组件可以是,但不局限于,在处理器上运行的进程、处理器、对象、可执行码、执行线程、程序和/或计算机。作为说明,在服务器上运行的应用程序和服务器均可以是组件。一个或多个组件可驻留在进程和/或执行线程中,且组件可位于一台计算机中和/或分布在两台或多台计算机之间。As used in this application, the terms "component" and "system" refer to a computer-related entity, which is either hardware, a combination of hardware and software, software, or software in execution. For example, a component may be, but is not limited to being, a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. As an illustration, both an application running on a server and a server can be a component. One or more components can reside within a process and/or thread of execution and a component can be localized on one computer and/or distributed between two or more computers.
此外,本发明可以被实现为方法、装置或者制造物品,其使用标准编程和/或工程技术来产生软件、固件、硬件或者任何其任一组合。这里使用的术语“制造物品”(或称“计算机程序产品”)旨在包含可从任何计算机可读设备、载波或介质访问的计算机程序。例如,计算机可读介质可包括,但不局限于,磁存储设备(如硬盘、软盘、磁条......)、光盘(如压缩盘(CD)、数字多功能盘(DVD)......)、智能卡以及闪存设备(如卡、棒)。当然,本领域的技术人员会认识到,在不背离本发明的范围和精神的前提下,可对本配置做出许多修改。Furthermore, the present invention may be implemented as a method, apparatus, or article of manufacture using standard programming and/or engineering techniques to produce software, firmware, hardware, or any combination thereof. The term "article of manufacture" (or "computer program product") as used herein is intended to encompass a computer program accessible from any computer-readable device, carrier, or media. For example, computer readable media may include, but are not limited to, magnetic storage devices (such as hard disks, floppy disks, magnetic stripes, ...), optical disks (such as compact disks (CDs), digital versatile disks (DVDs). ...), smart cards, and flash memory devices (e.g. cards, sticks). Of course, those skilled in the art will recognize many modifications can be made in this configuration without departing from the scope and spirit of the invention.
恢复系统restoration system
首先看图1,示出了数据恢复系统100。数据恢复系统100包含源数据库110、快照组件120、快照数据库130以及恢复组件140。源数据库110(以下也称为主要数据库)以经组织的方式包含大量的数据,以便于查询和其它用途。数据库110可以是任何种类的数据库,包括但不局限于,关系型或多维数据库。快照组件120部分地基于源数据库而生成快照数据库130(这里也将数据库快照称为DBSS)。快照数据库130允许用户创建现有源数据库110的事务一致视图,而不作出它的完整副本。当源数据库110从快照数据库130中分叉时,快照组件120确保快照数据库130包含在其被修改之前的数据副本,例如,以页为单位。换言之,若源数据库页包含字母“A”,且执行导致“A”改变为“B”的事务,则可用其来写对应的快照数据库页,并因而储存字母“A”。根据本发明的一方面,快照数据库130可以是源数据库110的只读时间点副本。DBSS不必要是源数据库110的完整副本。这两个数据库可共享对两者公用的数据,这就也使DBSS能够被快速创建并使空间有效。当源数据库110被修改时,原始数据可被复制到空间有效存储器,以供DBSS用来维持其源数据库110的时间视图中的点。此外,应当理解,可以有与源相关联的一个以上快照数据库130,以提供多个还原点。另外,快照数据库130可以是瞬时或持久的。瞬时快照是内部易失性副本,它在崩溃、故障或关机之后被删除。持久快照是公共副本,它可被更安全地保存在存储设备中,以供其它应用程序使用。Referring first to FIG. 1 , a data recovery system 100 is shown. The data recovery system 100 includes a
恢复组件140利用快照数据库130将源数据库110恢复到在事件之前的时间点。依照本发明的一方面,该事件可对应于用户错误,如快手指删除,即用户意外地将数据从源表格中删除。或者,事件可对应于系统崩溃、死锁或其中数据丢失或被操纵的任何其它情形中。若事件发生在源数据库110上,且快照数据库130已经在错误之前被创建了,则数据库管理员具有使用恢复组件140来将整个源数据库110恢复回到事件之前的时间点处的快照数据库130的选项。恢复组件140可利用驻留在快照数据库130中的数据来将源数据库110恢复到事件之前的先前的时间点处。例如,可用快照数据库数据在对应位置处重写当前源数据库值。或者,快照数据库130可用共享数据来填充,并变成新的源数据库。应当认识到,这个恢复过程通常比传统的恢复技术快得多,这是因为仅需要将稀疏文件(sparse file)复制到源数据库,而不是全部恢复。此外,由于恢复过程不需要如日志运送所需要的重复资源,所以它是更加有效的。Restore
图2依照本发明的一方面描述了恢复组件140。特别地,恢复组件包含还原组件210和撤销组件210。还原组件210提供了依照本发明的恢复中的主要功能,而撤销组件220便于细粒度的恢复,其集中于诸如错误等事件上。若数据库快照已经在事发生现之前被创建,则还原组件210可利用数据库快照中的稀疏文件将源数据库恢复到事件之前的时间。在快照创建之后被改变的数据文件或页可通过将储存在快照数据库中的旧值复制到源数据库来返回到快照时间处的状态。这就导致例如从快照被创建的时间直到还原操作的数据丢失,包括错误。例如,若源数据库包含快照数据库被创建时的“A”、“B”和“C”,且随后“B”被改变为“D”,则快照数据库可包含“B”,且源数据库可包含“A”、“D”、“B”。还原组件然后可通过简单在将“B”复制到“D”上而将数据库恢复到快照时间处的值。然而,在数据库快照被创建时,可能存在尚未提交的进行中的事务。这些事务不被数据库快照捕捉。因此,在源数据库被恢复到数据库快照之后,那些事务丢失了,且作为事务结果出现的操作(如插入、更新、删除)将不被执行。FIG. 2 depicts
撤销组件220可用于补偿在还原时的这个不准确的表示等等。例如,撤销组件220可储存快照数据库创建时的所有打开的事务,这包括所有在快照创建之前开始并在其后终止的事务。这些被储存的事务可随后用于卷进(roll forward)恢复的主要数据库,以捕捉打开的事务,并集中于恢复事件。此外,撤销组件220可利用以周期间隔或根据管理员命令来捕捉数据库变化的传统数据库日志,以更接近地集中于诸如错误等事件,从而最小化了“良好”事务的丢失。因此,本发明至少促进了数据库恢复,并可利用较少的系统资源但以快得多的速度来常规地完成。Undo component 220 can be used to compensate for this inaccurate representation upon restoration, among other things. For example, undo component 220 can store all open transactions at the time of snapshot database creation, including all transactions that started before snapshot creation and terminated thereafter. These stored transactions can then be used to roll forward the recovered primary database to capture open transactions and focus recovery events. Additionally, the undo component 220 can utilize traditional database logs that capture database changes at periodic intervals or at administrator command to more closely focus on events such as errors, thereby minimizing the loss of "good" transactions. Thus, the present invention at least facilitates database recovery and can be done routinely with less system resources but at a much faster rate.
转到图3,依照本发明的一方面示出了时间线300,以进一步提供有关数据库恢复操作的清晰性。时间在时间线300上从左到右前进。换言之,定位在较远右边的事件在时间上发生在定位在较远左边的事件之后。在310处,创建数据库快照(DBSS)。一段时间过去(分钟、小时、天......)且事件发生在320处。例如,事件可对应于用户意外删除完整的表格或者修改页数据。其后,例如,可由数据库管理员启动恢复操作。因此,本发明的还原组件210(图2)可用来将数据库恢复到创建数据库快照的时间点310。根据本发明的一方面,这可通过将稀疏文件数据从快照数据库复制到源数据库中的对应数据,从而将源数据库置于缺少320处的事件效果的一致稳定状态来实现。撤销组件220(图2)然后可用来将源数据库前进到事件320,以维持“良好”数据,同时丢失或改变由事件所引发的数据。这可通过将储存在撤销文件中的打开的事务应用于所恢复的数据库和/或数据库日志文件而实现。Turning to FIG. 3, a timeline 300 is shown to provide further clarity regarding database recovery operations in accordance with an aspect of the present invention. Time advances from left to right on timeline 300 . In other words, events positioned farther to the right occur in time after events positioned farther to the left. At 310, a database snapshot (DBSS) is created. A period of time passes (minutes, hours, days...) and an event occurs at 320 . For example, an event may correspond to a user accidentally deleting a complete form or modifying page data. Thereafter, recovery operations can be initiated, for example, by a database administrator. Accordingly, the restore component 210 (FIG. 2) of the present invention can be used to restore the database to the point in time 310 when the database snapshot was created. According to an aspect of the invention, this may be accomplished by copying sparse file data from the snapshot database to corresponding data in the source database, thereby placing the source database in a consistent steady state lacking the effects of the event at 320 . Undo component 220 (FIG. 2) can then be used to advance the source database to event 320 to maintain "good" data while losing or changing data caused by the event. This can be accomplished by applying open transactions stored in undo files to the restored database and/or database log files.
图4依照本发明的一方面示出数据库快照系统400。DBSS系统400包含快照组件120、源数据库110、快照数据库130、目录组件410以及监视器组件420。如前面提到的源数据库110是寻求恢复的主或主要数据库。快照组件120使用源数据库110来生成数据库快照130。数据库快照(DBSS)130可以是只读的时间点数据库。它是空间有效的,这是因为其与源数据库130共享空间。该共享空间是在两个数据库中相同的所有数据页。根据一个示例性实现,DBSS可用下面的句法来创建:FIG. 4 illustrates a
CREATE DATABASE ss_database_nameCREATE DATABASE ss_database_name
ON<filespec>[,...n]ON <filespec>[,...n]
AS SNAPSHOT OF source_database_name对源数据库110中的每个数据文件,创建用于DBSS 130的另一文件。这些新文件是稀疏文件。当页在源数据库110中被改变时,它们被首先复制到稀疏文件中。目录组件410可用来生成日志或日志文件,以跟踪DBSS 130中的页是与源数据库110共享,还是页已经被复制到稀疏文件中。根据本发明的一方面,日志被储存在源数据库110中,以便于对其容易访问。AS SNAPSHOT OF source_database_name For each data file in
应当认识到,恢复在其可读之前可在DBSS 130上运行,以将其带回到一致状态。当前打开的事务被卷回(roll back),且某些原始页将很有可能由于卷回而被复制到稀疏文件中。根据本发明的一方面,DBSS没有日志。一旦创建了DBSS 130,则DBSS可保持存在,直到它被数据库管理员丢弃(若其持久保存的话),否则它可在出错或系统关机时被丢弃。It should be appreciated that recovery can be run on the
多个DBSS 130可存在于单个源数据库110的不同时间点处。根据本发明的一方面,除正被还原或正被恢复的快照以外的所有快照都可被销毁。或者,时间上驻留在被还原的快照之后的所有快照可被销毁,而那些时间上出现较早的快照可被保存。在正被还原或者将要被还原的快照之后拍摄的源数据库快照不是非常有价值的。此外,例如,可在源数据库已经使用数据库快照恢复之后对该源数据库拍摄新快照。在用于恢复的快照之前拍摄的快照要有价值得多,因为仍旧可还原到由先前的快照所捕捉的特定时间点处。
DBSS 130能以周期性的方式来创建和丢弃,或者若用户希望单个“安全”的时间点以允许对其还原,可用特别的方式来创建和丢弃。例如,用户可能想要在新应用程序安装或测试阶段创建快照。可利用下面的命令而发出到DBSS 130的还原:
RESTORE DATABASE{database_name|database_name_var}FROMRESTORE DATABASE{database_name|database_name_var}FROM
DATABASE_SNAPSHOT=<snapshotname>监视器组件420也可由快照组件120使用,以观察关于源数据库的事务,并启动数据库快照的自动生成。例如,若监视器组件420检测到或者推断可能显著改变源数据库的新应用程序的安装,则它可开始数据库快照的创建。为促进这样的功能,应当认识到,本发明可使用人工智能系统和方法,包括但不局限于,基于规则的专家系统、贝叶斯规则以及神经网络。DATABASE_SNAPSHOT=<snapshotname>
为恢复数据库,源数据库被关闭,而且对其的所有连接被关闭。因此,源在这个过程中不可用于事务。数据库可被标记为“恢复”,以通知外部观察者该数据库不可用。然后,服务器可继续将稀疏文件中的页复制到源数据库文件中的原始位置(当DBSS被创建时)。在绝大多数情况下,复制改变的页的速度比从备份中恢复要快得多。一旦页被复制,则数据库的日志可被重建。现在,源数据库返回到其在DBSS创建时的时间点处。从DBSS被创建以来的所有变化已经被消除了。若创建撤销文件,则日志链没有断裂,且可应用采自源数据库的数据日志备份,以卷进源数据库。To restore a database, the source database is shut down and all connections to it are closed. Therefore, the source is not available for transactions during this process. A database can be marked as "recovering" to notify external observers that the database is unavailable. The server can then proceed to copy the pages in the sparse file to their original locations in the source database file (when the DBSS was created). In the vast majority of cases, copying changed pages is much faster than restoring from backup. Once the pages are copied, the database's log can be rebuilt. The source database is now returned to its point in time when the DBSS was created. All changes since DBSS was created have been eliminated. If an undo file is created, the log chain is not broken and the data log backup taken from the source database can be used to roll into the source database.
支持在使用撤销文件还原之后卷进的方案可被概括如下。在创建DBSS时,由DBSS在创建时的恢复所接触的每个页的原始值可被保存为单独撤销文件中的“预图像(pre-image)”。在还原时,DBSS页就如所述地被复制到源数据库中。预图像可从单独的撤销文件中复制。在这一点上,数据库与在创建DBSS的时候完全一样。其后,数据库日志可用来将还原的DBSS卷进到正好在用户错误发生之前的时间点处,以最小化数据丢失的量。The scheme to support rolling in after restore using an undo file can be summarized as follows. Upon creation of the DBSS, the original value of each page touched by the recovery of the DBSS upon creation may be saved as a "pre-image" in a separate undo file. On restore, the DBSS pages are copied into the source database as described. Preimages can be copied from separate undo files. At this point, the database is exactly as it was when the DBSS was created. Thereafter, the database log can be used to roll the restored DBSS to a point in time just before the user error occurred to minimize the amount of data loss.
转到图5,依照本发明的一方面提供了示出示例性数据库恢复500的图示。源数据库110包括两个数据库文件510和520。数据库文件510和520都包含8个页,每个页具有不同的数据。生成源数据库的快照。从而创建数据库快照130。快照数据库可具有两个快照数据库稀疏文件530和540,其分别对应于源文件510和520。在快照起源的时候,这些源文件可简单地为外壳,因为它们与源文件510和520共享所有数据。在快照创建之后的某点处,源数据库中的值可被改变。这里,被改变的值驻留在文件510的页3和页7中,以及文件2的页4中。特别的,页3已经从“C”改变到“Z”,页7已经从“G”改变到“Y”,而且页4已经从“L”改变到“Z”。因此,改变前的原始值已经被保存到稀疏文件530和540处,这里为“C”、“G”和“L”。一旦被恢复,稀疏文件中的页,这里为来自文件530的3到7和来自文件540的页3可被复制回到源或主要数据库110中的已更新页面。Turning to FIG. 5 , a diagram illustrating an exemplary database restore 500 is provided in accordance with an aspect of the present invention.
复制页包含几个情况,这包括简单复制回已修改的页,或者诸如添加或删除文件、将主要数据库文件增长或收缩至稀疏文件的大小、添加或删除页(即跟踪被添加到主要数据库的页,这样以使它们可在恢复时被消除)等等更复杂的情况。对文件添加和删除而言,可比较源数据库和数据库快照的文件列表并将其同步。对页添加而言,若源比快照或复制品大,则源可在末端被切去或被截短到复制品的大小,这部分是因为根据本发明的一方面,被添加的页是添加在源的末端的。若复制品较大,则这意味着页从主要源中删除。因此,源的大小可被增加,且该范围的所有页面将已经在快照中,由此将通过正常的复制操作而被复制。Copying pages covers several cases, this includes simply copying back modified pages, or things like adding or removing files, growing or shrinking the main database file to the size of the sparse file, adding or removing pages (i.e. tracking pages so that they can be erased during recovery) and more complex cases. For file additions and deletions, the file lists of the source database and the database snapshot are compared and synchronized. For page additions, if the source is larger than the snapshot or replica, the source can be cut off at the end or truncated to the size of the replica, in part because, according to an aspect of the invention, the pages being added are at the end of the source. If the replica is larger, this means that the page was removed from the primary source. Therefore, the size of the source can be increased, and all pages of the range will already be in the snapshot, and thus will be copied by the normal copy operation.
一种复制回页面的单纯算法(algorithm)是将它们一个接一个的复制。然而,根据本发明的一方面,可使用异步复制操作实现。例如,可使用单个线程和三个队列一读队列、写队列以及空缓冲队列。在复制返回的同时,若页在源中(如,意味着它已改变),或者它不在源中(如,意味着它被删除),则它可被简单地复制到源。然而,若主要源中有额外页,则它们可能被添加到文件的末端,这可通过将文件截短到复制品的大小而补救。最后,源可被解锁,以完成恢复。A naive algorithm for copying back pages ( algorithm) is to copy them one by one. However, according to an aspect of the invention, an asynchronous copy operation implementation may be used. For example, a single thread and three queues—a read queue, a write queue, and an empty buffer queue—can be used. While copying back, if the page is in the source (eg, meaning it has changed), or it is not in the source (eg, meaning it was deleted), it can simply be copied to the source. However, if there are extra pages in the primary source, they may be added to the end of the file, which can be remedied by truncating the file to the size of the replica. Finally, the source can be unlocked to complete the restore.
根据本发明的另一个方面,与源数据库相关联的日志备份可在恢复之后被打破。因此,日志备份将在还原的数据库上失效,直到作出完全或文件备份。还原的数据库可保持与其被创建时所保持的相同的恢复模型。因此,本发明的系统可支持(1)启动还原;(2)操纵数据;(3)重建日志;以及(4)重启数据库。According to another aspect of the invention, log backups associated with the source database can be broken after recovery. Therefore, log backups will be invalidated on the restored database until a full or file backup is made. A restored database maintains the same recovery model as it was created. Therefore, the system of the present invention can support (1) start restore; (2) manipulate data; (3) rebuild log; and (4) restart database.
根据本发明的另一方面,新的源数据库可通过复制来自原始源数据库中的数据而从快照数据库中创建。数据库创建阶段的任何错误可能需要数据库管理员(DBA)例如一旦服务器变得可用就重启操作。一旦数据库被创建,DBA就可丢弃源数据库,并对还原的数据库进行重命名。这样的系统例如可用于数据镜像。According to another aspect of the invention, a new source database can be created from the snapshot database by copying data from the original source database. Any errors in the database creation phase may require a database administrator (DBA) to restart operations, for example, once the server becomes available. Once the database is created, the DBA can discard the source database and rename the restored database. Such a system can be used, for example, for data mirroring.
现在转到图6,依照本发明的一方面示出了示例性数据镜像系统600。系统600包含两个数据库:源数据库110和镜像数据库610,数据库快照130以及恢复组件140。源数据库110是主要数据库。镜像数据库610是单独的数据库,它几乎包含源数据库110的逐位复制品。这样,当对源数据库110做出改变时,例如可通过网络将它们发送到镜像数据库610。镜像的概念是若主要源数据库110例如由于电源故障而失效或变得不可用,则镜像数据库610可变成用于事务的新源数据库,从而通过冗余度而促进数据的高可用性。根据前述本发明的一方面,源数据库610可具有与之相关联的快照数据库快照130,以便于时间点还原。这样,数据库管理员可使用数据库快照130和恢复组件140将源数据库110还原到先前的时间点。若在源数据库110上执行还原,则镜像数据库610也应反映该变化。常规地,需要时间消耗备份和全恢复来更新并重新同步镜像数据库610。根据本发明的一方面,镜像数据库610可自动被更新并与源同步。由于对源的改变被自动反映在镜像数据库中,所以在还原阶段对源的改变也可在该还原已经在源上完成之后,同时或异步地传递到镜像中。Turning now to FIG. 6, an exemplary
转到图7,依照本发明的一方面示出了用于对具有快照的数据库建立镜像的示例性系统700。如图所示,系统700包括名为DB1_LS的基本或目标数据库610。应用程序620寻求从数据库610中查看数据。特别地,应用程序620可与名为DB1_001、DB1_002以及DB1_003的快照630交互。第一快照DB1_001可被创建并参照DB1,例如:Turning to FIG. 7, an exemplary system 700 for mirroring a database with snapshots is shown in accordance with an aspect of the present invention. As shown, system 700 includes a base or
CREATE DATABASE DB1_001 AS SNAPSHOT OF DB1_LSCREATE DATABASE DB1_001 AS SNAPSHOT OF DB1_LS
ON(NAME=`datafile′,FILENAME=`F:\DB1_001.SNP′)随后,第二快照DB1_002可被创建。仍旧使用DB1_001的用户继续使用它:ON(NAME='datafile', FILENAME='F:\DB1_001.SNP') Subsequently, a second snapshot DB1_002 can be created. Users who still use DB1_001 continue to use it:
CREATE DATABASE DB1_002 AS SNAPSHOT OF DB1_LSCREATE DATABASE DB1_002 AS SNAPSHOT OF DB1_LS
ON(NAME=`datafile′,FILENAME=`F:\DB1_002.SNP′)其后,第三快照可被创建,并做出对DB1的参照。仍旧使用DB1_001或DB1_002的用户继续使用它们:ON(NAME='datafile', FILENAME='F:\DB1_002.SNP') Thereafter, a third snapshot can be created and a reference to DB1 made. Users who still use DB1_001 or DB1_002 continue to use them:
CREATE DATABASE DB1_003 AS SNAPSHOT OF DB1_LSCREATE DATABASE DB1_003 AS SNAPSHOT OF DB1_LS
ON(NAME=`datafile′,FILENAME=`F:\DB1_003.SNP′)ON(NAME='datafile', FILENAME='F:\DB1_003.SNP')
另外,根据本发明的一方面,可使用数据库快照来对数据库进行一致性核查。例如,DBCC CHECKDB()命令可在数据库上执行。结果,具有备用存储的数据库的内部快照可在现有数据库文件的交替流中被创建。然后,可读取页以执行一致性核查,且系统可从基本数据库中读取它们(若它们还没有被修改)或者从交替流中读取(若它们已经被修改)。In addition, according to an aspect of the present invention, the database snapshot can be used to check the consistency of the database. For example, the DBCC CHECKDB() command can be executed on a database. As a result, internal snapshots of the database with alternate storage can be created in alternate streams of existing database files. The pages can then be read to perform a consistency check, and the system can read them from the base database (if they have not been modified) or from the alternate stream (if they have been modified).
也应当认识到的是,尽管没有示出,但是本发明可使用一个或多个图形用户界面(GUI)。GUI可用来支持快照管理。例如,包括但不限于文本框、按钮、选项卡、下拉菜单和滚动条的多个文本和图形组件可用来创建快照并随后将数据库还原到该处。It should also be appreciated that, although not shown, the invention may utilize one or more graphical user interfaces (GUIs). A GUI can be used to support snapshot management. For example, a number of text and graphics components including, but not limited to, text boxes, buttons, tabs, drop-down menus, and scroll bars can be used to create a snapshot and then restore the database thereto.
此外,在传统的意义上,数据库快照和与其相关联的源数据库都可被备份。例如,管理员可备份来自快照的单独文件或文件组。当备份被恢复时,它们被恢复为常规的数据库。在进行源的备份操作时,用户可指定哪个快照要用于备份。在恢复时,用户也可指定哪个快照要被恢复。Also, both a database snapshot and its associated source database can be backed up in the traditional sense. For example, administrators can back up individual files or groups of files from snapshots. When backups are restored, they are restored as regular databases. When performing a backup operation on the source, the user can specify which snapshot is to be used for the backup. When restoring, the user can also specify which snapshot is to be restored.
数据库快照(也称为写复制(Copy-On-Write)数据库)Database snapshots (also known as Copy-On-Write databases)
一般而言,数据库包含两种类型的文件:数据文件和日志文件。日志文件包含一系列日志记录。日志记录可用日志序列号(LSN)来标识。如图8中所描述的,根据本发明的一方面,主要数据库800包括一组数据文件802和日志文件810。数据文件802可被划分成被称作页的存储块或单元。In general, a database contains two types of files: data files and log files. A log file contains a series of log records. Log records can be identified by a Log Sequence Number (LSN). As depicted in FIG. 8,
用于数据库的数据库快照可被创建,它提供了先前的时间点处的现有数据库的事务一致视图,而不创建该数据库的完整副本。与数据库结合的数据库快照包括产生前一时刻的数据库副本的信息所需的所有信息。然而,数据库快照本身并不包含所有的信息,由此其大小可比全副本小。另外,快照可在对数据库做出修改时匆忙地(on the fly)创建,这允许成本(时间和处理)随时间展开。若在先前时刻对数据库快照进行复制,则时间和处理成本会同时集中。另外,数据库快照有这样的优点,即它们可在更新活动在数据库上继续时被创建。主要数据库是被使用并且其一个或多个数据库快照被创建的数据库。A database snapshot for a database can be created, which provides a transactionally consistent view of an existing database at a previous point in time without creating a full copy of the database. A database snapshot, combined with a database, includes all the information needed to produce the information of a copy of the database at a previous moment. However, a database snapshot itself does not contain all the information, so its size can be smaller than a full copy. Additionally, snapshots can be created on the fly as modifications are made to the database, which allows the cost (time and processing) to spread over time. If the database snapshot was replicated at a previous point in time, both time and processing costs would be intensive. Additionally, database snapshots have the advantage that they can be created while update activity continues on the database. The primary database is the database that is used and one or more database snapshots of which are created.
如上述,数据库快照包含所有需要的信息,以及主要数据库,其确定前一时刻主要数据库的内容。数据库快照可包含对应于主要数据库中的每一文件的副文件(side file)。副文件包含来自对应数据文件的所有数据的副本,该数据文件自从创建了数据库快照以来已经被改变。在本发明的一个方面中,为避免将表格从副文件中的页映射到主要文件中的页的必要,副文件被储存在稀疏空间中。在稀疏文件中,仅文件的实际被写入的部分需要存储空间。该文件的所有其它区域可以是未分配的。然而,应当注意到,在稀疏文件中储存副文件不是本发明所必需的,而且在本发明的范围内可考虑其它存储系统和方法。As mentioned above, the database snapshot contains all the required information, as well as the main database, which determines the content of the main database at the previous moment. A database snapshot may contain side files corresponding to each file in the primary database. A sidefile contains a copy of all data from the corresponding datafile that has been changed since the database snapshot was created. In one aspect of the invention, to avoid the need to map tables from pages in the side file to pages in the primary file, the side file is stored in sparse space. In a sparse file, only the portion of the file that is actually written requires storage space. All other areas of the file may be unallocated. It should be noted, however, that storing side files in sparse files is not required by the present invention, and other storage systems and methods are contemplated within the scope of the present invention.
根据本发明的另一个方面,稀疏文件机制以标准区域大小工作。若一个区域内的数据被写到稀疏文件中,则即使数据不填满整个区域,用于整个区域的空间也可被分配。因为这个空间被分配,而且可从中读取,所以可在该区域中用有效数据填充的范围和该区域的范围之间作出区分,其存在的原因是稀疏文件的粒度需要特定大小的区域被分配(若该区域内的任何存储是必需的话)。According to another aspect of the invention, the sparse file mechanism works with standard region sizes. If data within an area is written to a sparse file, space for the entire area can be allocated even if the data does not fill the entire area. Since this space is allocated and readable from it, a distinction can be made between the extent of the region filled with valid data and the extent of the region, which exists because the granularity of sparse files requires regions of a certain size to be allocated (if any storage in the area is required).
因为数据库快照包括主要数据库中自从数据库快照被创建以来已经改变的所有数据的原始值,所以数据库快照创建时间的数据库数据可从该快照中读取。为响应于对来自数据库快照的数据请求,数据可从数据库快照的副文件中读取(若副文件包含来自该请求的数据的话)。要被读取而不在副文件中的数据自从数据库快照被创建以来尚未改变,且可从主要数据库中读取。Because a database snapshot includes the original values of all data in the primary database that has changed since the database snapshot was created, database data at the time the database snapshot was created can be read from the snapshot. In response to a request for data from the database snapshot, data may be read from a side file of the database snapshot (if the side file contains data from the request). Data to be read that is not in the secondary file has not changed since the database snapshot was created and can be read from the primary database.
根据本发明的另一个方面,副文件包含来自主要数据库的数据页。当主要数据库的任一页上的数据被改变时,该数据页就被储存在副文件中。本发明是参考作为主要数据库中数据单元的页来描述的;然而,可以构想也可使用其它来自主要数据库的其它数据单元。According to another aspect of the invention, the secondary files contain data pages from the primary database. When data is changed on any page of the primary database, that data page is stored in the secondary file. The invention has been described with reference to pages as units of data in the primary database; however, it is contemplated that other units of data from the main database could also be used.
为确定哪个数据被写到副文件中,以及哪个数据应当被读到主要数据库中,应当确认副文件中的有效数据的存在。在一个实例中,它能被直接读取以确定有效数据是否存在。根据本发明的另一个方面,副页表可被创建,它储存有关给出页是否存在且有效的数据。To determine which data is written to the side file, and which data should be read into the main database, the presence of valid data in the side file should be confirmed. In one example, it can be read directly to determine whether valid data is present. According to another aspect of the invention, a secondary page table can be created which stores data as to whether a given page exists and is valid.
对主要数据库中的每个页而言,副页表可储存有关该页是否应从主要数据库中读取的信息,这表明其没有变化,或者副页表可储存关于该页是否应从副文件中读取的信息,这表明其已经变化了。副页表允许快速确定给定页面是否存在于副文件中。For each page in the main database, the subpage table can store information about whether the page should be read from the main database, indicating that it has not changed, or the subpage table can store information about whether the page should be read from the sidefile fetched information, which indicates that it has changed. The sidepage table allows to quickly determine whether a given page exists in the sidefile.
根据本发明的另一个方面,副文件和稀疏文件机制均使用相同的页/区域大小。即,副文件从主要数据库中保存的页与当任何存储器被写入稀疏文件中时稀疏文件所储存的区域是相同大小的。例如,若稀疏文件区域是8KB,且从主要数据库储存的页也是8KB,则页大小和区域大小是相等的。在这种情况下,任何被填充的区域将被读自主要数据库的页完全填充,而且不可能在该区域中储存无效数据。According to another aspect of the invention, both sidefile and sparsefile mechanisms use the same page/region size. That is, the pages saved by the side file from the primary database are the same size as the area the sparse file stores when any memory is written into the sparse file. For example, if the sparse file region is 8KB, and the pages stored from the main database are also 8KB, then the page size and region size are equal. In this case, any filled regions will be completely filled with pages read from the primary database, and it is impossible to store invalid data in that region.
依照本发明的另一方面,多个副文件区域可确切地对应于每个页。例如,若稀疏文件区域是8KB(千字节),且从主要数据库储存的页是16KB,则储存在副文件中的每一页将填满两个区域。而且,在这种情况下,任何被填充的区域将被来自从主要数据库读出的页的内容完全填充。而且,无效数据不可能被包含在该区域中。According to another aspect of the present invention, a plurality of side file areas may correspond exactly to each page. For example, if the sparse file region is 8KB (kilobytes), and the pages stored from the primary database are 16KB, then each page stored in the secondary file will fill two regions. Also, in this case, any filled regions will be completely filled with content from pages read from the primary database. Also, invalid data cannot be contained in this area.
对本发明的这些方面而言,副页表包含存储器内位图,其持有关于副文件中每个页面信息的一个比特。对副文件中的每一页而言,对应的比特表明该页是否在副文件中。For these aspects of the invention, the side page table contains an in-memory bitmap that holds one bit of information about each page in the side file. For each page in the sidefile, a corresponding bit indicates whether the page is in the sidefile.
根据本发明的另一方面,副文件区域的粒度大于从主要数据库储存的页的粒度。例如,若副文件的每个区域是64KB,且该页大小是8KB,则副文件中区域的存在不必表明区域中的所有信息是来自主要数据库的有效数据。若仅有一个页被复制到副文件中,在此示例中,则所分配的区域中的64KB中仅有8KB会包含有效数据。在另一个实施例中,某些副文件页在区域中散布。According to another aspect of the invention, the granularity of the secondary file area is greater than the granularity of pages stored from the primary database. For example, if each region of the sidefile is 64KB, and the page size is 8KB, the presence of the region in the sidefile does not necessarily indicate that all the information in the region is valid data from the primary database. If only one page is copied into the sidefile, in this example only 8KB of the 64KB in the allocated region will contain valid data. In another embodiment, certain side file pages are scattered throughout the zone.
对这些方面而言,副页表包含两个存储器内位图,其持有关于副文件中每一页的信息的两个比特,称为比特1和比特2。对副文件中的每一页而言,对应的比特表明(比特1)页是否确实在副文件中,以及(比特2)页是否潜在地在副文件中。比特2也可被认为是表明已经分配了其中页应当被保存在副文件中的区域。然而,如下所述,在一个实施例中,该比特2仅当副页表被重新构造时被置位。For these purposes, the side page table contains two in-memory bitmaps that hold two bits of information about each page in the side file, referred to as
位图被维持在存储器内,因此可能不是持久的。若它们被擦除,则从稀疏文件信息中重新构造位图。咨询稀疏文件,并且对每一页而言,若副文件已经为其中定位页的区域分配了空间,则比特2被置位,以表明页潜在地在副文件中。对每一页而言,比特1最初被置位,以表明不确定该页在副文件中。Bitmaps are maintained in memory and therefore may not be persistent. If they are erased, the bitmap is reconstructed from the sparse file information. The sparse file is consulted, and for each page, if the side file has allocated space for the region in which the page is located, bit 2 is set to indicate that the page is potentially in the side file. For each page,
若副页表以其持续的方式维持,则区域和页的粒度可能是可忽略的,且可使用一比特的副页表。然而,在一个实施例中,为在数据库服务器重启之后支持持久数据库视图,使用二比特页表。If subpage tables are maintained in their persistent fashion, the granularity of regions and pages may be negligible, and a one-bit subpage table may be used. However, in one embodiment, to support persistent database views across database server restarts, two-bit page tables are used.
依照本发明的一方面,没有为副文件创建页表。在这种情况下,每当有必要决定是否已经复制数据库快照中的页时,就咨询数据库快照。下面将参考本发明的一方面来描述本发明,其中存在一比特或二比特的页表,然而,也可构想其中没有页表的本发明的其它实施例,而且数据库视图必须被检查,以决定它是否包含从主要数据库中复制的页。According to an aspect of the invention, no page tables are created for side files. In this case, the database snapshot is consulted whenever it is necessary to determine whether pages in the database snapshot have been replicated. The invention will be described below with reference to an aspect of the invention in which there is a one-bit or two-bit page table, however, other embodiments of the invention are conceivable in which no page table is present and the database view must be examined to determine Whether it contains pages copied from the primary database.
如图9所示,主要数据库800的数据库快照920由副文件925组成。主要数据库800中的每个数据文件802具有数据库快照920中对应的副文件925。另外,副页表数据930被储存在数据库快照920的存储器内。根据本发明的一个方面,副页表数据930是一个副页表,其覆盖所有的副文件925。根据本发明的另一个方面,对每个副文件925可存在单独的副页表。As shown in FIG. 9 , database snapshot 920 of
在数据库中,事务日志是自从事务日志被最后一次备份以来已对数据库执行的所有事务的连续记录。事务日志用来将数据库恢复到失效点。根据本发明的一个方面,事务日志被建模为循环队列。可通过删除日志的不活动部分而截短事务日志。这个不活动部分包含完成的事务,其不需要被恢复,这至少是因为它们反映的变化已经持久保存到数据文件。相反,事务日志的活动部分包含已完成的事务和仍旧在运行且未完成事务(活动事务)。可完成截短,以最小化事务日志中的不活动空间,而不是允许事务日志继续增长并使用更多空间。In a database, the transaction log is a continuous record of all transactions that have been performed on the database since the transaction log was last backed up. The transaction log is used to restore the database to the point of failure. According to one aspect of the invention, the transaction log is modeled as a circular queue. The transaction log can be truncated by removing inactive portions of the log. This inactive portion contains completed transactions, which do not need to be recovered, at least because they reflect changes that have been persisted to the data files. In contrast, the active portion of the transaction log contains completed transactions as well as incomplete transactions that are still running (active transactions). Truncation can be done to minimize inactive space in the transaction log, rather than allowing the transaction log to continue to grow and use more space.
活动事务可引发事务不一致性。对活动事务而言,数据文件的某些修改可能还没有从缓冲器高速缓存中写到数据文件中,且可能存在来自数据文件中未完成事务的某些修改。日志文件810可用来确保数据库的恢复是事务一致的。这可通过使用ARIES(用于恢复和隔离使用语义的算法)风格的恢复来完成。记录在日志中的可能还没有被写到数据文件中的每一修改通过对数据库执行修改而卷进。为确保数据库的完整性,在事务日志中发现的每个未完成事务通过撤销对数据库的修改而卷回。Active transactions can cause transaction inconsistencies. For active transactions, some modifications to the data file may not have been written to the data file from the buffer cache, and there may be some modifications from outstanding transactions in the data file. Log files 810 may be used to ensure that recovery of the database is transactionally consistent. This can be done using ARIES (Algorithms for Recovery and Isolation Usage Semantics) style recovery. Every modification recorded in the log that may not have been written to the data files is rolled in by performing the modification to the database. To ensure the integrity of the database, each incomplete transaction found in the transaction log is rolled back by undoing the modification to the database.
为创建数据库快照,数据库视图的实体结构(副文件和页表)必须被初始化。首先,对主要数据库800中的每个数据文件802创建副文件925。如上所述,副文件可以是稀疏文件,或者在另一个实施例中为与数据文件802大小相同的非稀疏文件。副文件925c与主要数据库800中的数据文件802相关联。To create a database snapshot, the physical structure of the database view (side files and page tables) must be initialized. First, a secondary file 925 is created for each data file 802 in the
因为事务是连续出现的,而且数据库视图是事务一致的,所以事务日志应当在数据库快照创建期间使用。为确保关于应当用于数据库视图的事务的信息不被丢弃,在主要数据库800上禁用日志截短(若其存在)。Because transactions occur sequentially and database views are transactionally consistent, a transaction log should be used during database snapshot creation. To ensure that information about transactions that should be used for database views is not discarded, log truncation is disabled on the primary database 800 (if it exists).
根据本发明的一方面,为数据库快照初始化副页表930。首先,副页表930被设置,以表明副文件925中不存在页,而且,在二比特副页表的情况下,没有页面潜在地在或确定在副文件925中。According to an aspect of the invention, secondary page table 930 is initialized for database snapshots. First, sidepage table 930 is set to indicate that no pages exist in sidefile 925, and, in the case of a two-bit sidepage table, no pages are potentially or determined to be in sidefile 925.
当完成初始化时,数据库快照准备好“上线”。现在,数据库快照将沿着主要数据库800运行,而且当执行修改时,修改的页的原始值的副本(即执行更新之前的页的内容)将被储存在数据库快照中。用于实现数据库的事务一致快照的示例性方法可包括确定事务日志上的拆分点。这个拆分将对应于数据库快照所代表的时间点。主要数据库800上日志末端的LSN可在数据库快照被创建时获取;这个LSN是主要数据库800和数据库快照820将开始分叉处的“拆分点”。然后,主要数据库800可被标记,这样以使需要数据库快照处理。主要数据库800中的数据库快照支持按如下所述开始。When initialization is complete, the database snapshot is ready to "go live". Now, the database snapshot will run along the
为了数据库快照一致,必须分析拆分点之前的主要数据库800的日志,以确定什么事务在拆分时是活动的。日志中最老的活动(从拆分点开始)事务被标识。在最老活动事务之前允许日志截短。For database snapshot consistency, the log of the
通过类似于ARIES(用于恢复和隔离使用语义的算法)风格的恢复的方式,对数据库快照执行主要数据库800日志中所有来自拆分点之前的最老活动事务的操作。图10是根据本发明的一方面的示例性事务日志-日志文件810的框图。日志文件810中的日志条目包括日志条目1000、1010、1020、1030、1040、1050、1060、1080、1080、1090和1099。确定拆分点1075。事务继续被写到日志,然而禁用截短。检查日志文件810,并对副文件925执行任何对数据库的修改,作为从最老活动事务到拆分点的事务的结果(在图10的示例中,从日志条目n1000到日志条目n+7)。这些事务的每一个中的修改结果被储存在副文件925中。然而,检查这些事务。由日志中的任何活动事务,如日志条目n1000、日志条目n+21020和日志条目n+6写到日志文件的修改在副文件925中撤销。In a manner similar to ARIES (Algorithms for Recovery and Isolation Usage Semantics) style recovery, all operations from the oldest active transaction in the
然而,某些事务可能还没有提交。因此,日志中直到拆分点的活动事务应当被定位并被撤销。根据本发明的一方面,在未完成事务改变数据库中某一位置的值处,已经被添加到上述副文件的变化从该副文件中删除。或者,事务的撤销可通过如下详细描述的修改数据库快照、设置副文件中的数据以匹配数据库中从拆分点开始的数据。However, some transactions may not have been committed. Therefore, transactions active in the log up to the split point should be located and undone. According to an aspect of the present invention, where an outstanding transaction changes the value of a certain position in the database, changes that have been added to the above-mentioned side file are deleted from the side file. Alternatively, the transaction can be undone by modifying the database snapshot as detailed below, setting the data in the side file to match the data in the database starting from the split point.
这样,仅有来自日志的未完成事务被反映在数据库快照中。当日志中的事务被反映在数据库快照中时,除在拆分点出现时活动但已被撤销的事务之外,在主要数据库800中允许日志截短。因为已经启用了数据库快照处理,所以数据库快照将在对主要数据库800做出改变时更新,并且因此数据库快照可用来确定从拆分点时刻开始的主要数据库800的内容。This way, only outstanding transactions from the log are reflected in the database snapshot. Log truncation is allowed in the
当数据库服务器在其被关闭之后重启时(或者正常或者非正常),数据库快照应被重新初始化。为了这样做,已经被储存在存储器中的副页表必须被重新初始化。When the database server is restarted (either gracefully or abnormally) after it was shut down, the database snapshot should be reinitialized. In order to do this, the subpage table already stored in memory must be reinitialized.
为重新初始化副页表,在二比特副页表实现中,对已经被分配的副页表中的每个区域而言,已经被分配的区域中每一页的副页表中的数据(比特2)被置位,以表明该页可能已经被写到副文件925中。所有其它页面的副页表中的数据被置位,以表明页不可能被写到副文件925中。然而,页被写到副文件925中是不确定的,因此,比特1没有被初始地设置。To reinitialize the subpage table, in a two-bit subpage table implementation, for each region in the subpage table that has been allocated, the data in the subpage table for each page in the region that has been allocated (bit 2) is set to indicate that the page may have been written to sidefile 925. Data in the secondary page table for all other pages is set to indicate that the page cannot be written to secondary file 925. However, it is indeterminate that a page is written to sidefile 925, so
或者,在二比特副页表实现中,或者在一比特副页表实现中,可检查副文件925,以确定对每一页而言,副文件925中的页面是否有效,如上所述。该页表被设置,以表明对每个确实存在的页而言,页确实实际存在于副文件925中。所有其它页被设置,以表明页不存在于副文件925中。Alternatively, in a two-bit side table implementation, or in a one-bit side page table implementation, side file 925 may be checked to determine for each page whether a page in side file 925 is valid, as described above. The page table is set to indicate that the page does actually exist in sidefile 925 for each page that does exist. All other pages are set to indicate that the page does not exist in sidefile 925.
为了让数据库快照在数据被盖写之前储存来自主要数据库800的信息,主要数据库800必须支持数据库快照的创建。对主要数据库800修改的每一页而言,必须做出页面是否在数据库快照中的确定。若页面存在于数据库快照中,则它是页的正确版本。例如,当对主要数据库800中的页做出前一个修改时可能会出现这种情况。若页在主要数据库800中被再次改变,则数据库视图中的版本不应变化。In order for the database snapshot to store information from the
当从页已被改变的主要数据库800中接收信息时,若页在副文件925中,则什么也不做。若页不在副文件925中,则页应当被写到副文件925中,并且应当在副页表中置位正确的比特。在存在二比特页表的情况下,对于该页的比特1和比特2有三种可能性,如由下表1所示:
表格1:对于二比特页表的情况Table 1: For two-bit page tables
根据本发明的一方面,当比特1表明页确实在副文件925中时,比特2被忽略;这样,如表1所示,若比特1表明页确实在副文件925中,则页被假定在副文件925中,而不管比特2表明什么。在另一个实施例中,当比特1被置位,以表明页确实在副文件925中时,比特2被置位,以表明页可能在副文件925中,并且在这个替换实施例中,当比特1表明页确实在副文件925中,而比特2表明该页确实不在副文件925中时,该情况是无效的,并且遇到错误。According to an aspect of the invention, when
当主要数据库800表明页正被改变,则对二比特页表而言,应当对上文列出情况而采取的行动如下:When the
情况1:什么也不做。Case 1: Do nothing.
情况2:确定页是否在副文件225中,若没有,则将该页写到副文件225中。Case 2: Determine whether the page is in the side file 225, if not, write the page into the side file 225.
情况3:将页写到副文件925中。Case 3: Write the page to the side file 925.
在情况1或情况2中,当页被写到副文件925中时,主要数据库800中页的老版本(现在正由主要数据库800修改的版本)被写到副文件925中。另外,页表被设置,以表明页现在正在副文件925中,这样以使对页的任何后续写入将根据情况1来处理,并且数据库视图的正确页面保持储存在副文件925中。In
在情况2中为确定页是否在副文件925中,对应于该页的数据从副文件925中读取。若数据是有效的,则页的前一个版本在副文件925中,且其不应被盖写。在一个实施例中,对应于该页的页表比特1被置位,以表明该页确实在副文件925中,因此将来对该页的写入在情况1中处理。In case 2 to determine whether the page is in the side file 925, the data corresponding to the page is read from the side file 925. If the data is valid, then the previous version of the page is in side file 925 and it should not be overwritten. In one embodiment, the
数据无效性可由放置在新分配的区域中的数据来表示,以表明还没有有效数据被写到区域中。例如,若已知没有数据库页会包含全零的话,全零可被写到新分配的区域中。若情况如此,则副文件925中页的存在是由副文件925中的对应页来表示的,该页是分配的区域的一部分且包含某些非零数据。Data invalidity may be indicated by data placed in a newly allocated area to indicate that no valid data has yet been written to the area. For example, all zeros can be written to the newly allocated area if it is known that no database page will contain all zeros. If this is the case, the existence of a page in sidefile 925 is indicated by a corresponding page in sidefile 925 that is part of the allocated region and that contains some non-zero data.
表格1中详细描述的情况也适用于执行储存在数据库快照中的数据读取。当页中的数据从数据库视图中读取时,该页应从副文件925中读取(若其存在于副文件925中的话)。若其不存在于,则页应当从主要数据库800中读取。在二比特页表系统中,应当对三种情况而采取的行动如下:The conditions detailed in Table 1 also apply to performing reads of data stored in database snapshots. When data in a page is read from a database view, the page should be read from sidefile 925 (if it exists in sidefile 925). If it does not exist, the page should be read from the
情况1:从副文件925中读取页。Case 1: A page is read from the side file 925.
情况2:确定页是否在副文件925中,若其在副文件925中,则从副文件925中读取页,若其不在副文件925中,则从主要数据库800中读取页。Case 2: Determine if the page is in the side file 925, if it is in the side file 925, then read the page from the side file 925, if it is not in the side file 925, then read the page from the
情况3:从主要数据库800中读取页。Case 3: A page is read from the
数据库快照代表先前的时间点处的数据库状态。用户可选择使用数据库快照作为数据库。例如,用户可选择对数据库快照执行行动,以创建该数据库的数据库快照,如同它已在先前的时间点对数据库快照执行了行动。另外,在初始化阶段,如上面详细说明的,可在数据库快照上执行并撤销事务。A database snapshot represents the state of the database at a previous point in time. Users can choose to use a database snapshot as the database. For example, a user may choose to perform an action on a database snapshot to create a database snapshot of the database as if it had performed an action on the database snapshot at a previous point in time. Additionally, during the initialization phase, as detailed above, transactions can be executed and undone on the database snapshot.
为修改数据库快照,修改应基于数据库快照中的数据,而且所得的页应被储存在数据库快照中。若数据库快照中不存在关于页的数据,则修改应基于主要数据库800中的数据,且所得的页应储存在数据库快照中。In order to modify a database snapshot, the modification should be based on the data in the database snapshot, and the resulting pages should be stored in the database snapshot. If the data about the page does not exist in the database snapshot, the modification should be based on the data in the
在二比特页表系统中,应对于三种情况而采取的行动如下:In the two-bit page table system, the actions to be taken in the three cases are as follows:
情况1:从副文件925中读取页、执行修改、将页写到副文件925。Case 1: Read a page from side file 925, perform modification, write the page to side file 925.
情况2:确定页是否在副文件925中,若其在的话,则如情况1进行,若其不在的话,则如情况3进行。Case 2: Determine if the page is in side file 925, if it is, then proceed as in
情况3:从主要数据库800中读取页、将页写到副文件925中、以及设置页表,以表明该页在副文件925中。执行对页的修改,并将已修改的页在适当时写到副文件925中。Case 3: A page is read from the
在上述一个或多个示例性系统的视图中,参考图11-13的流程图,可更好地认识到可依照本发明实现的方法。虽然为解释简单起见,以一系列方框示出并描述方法,然而应当理解并被认识到的是,本发明不受方框顺序的限制,因为依照本发明,某些方框可能以不同的次序发生和/或与这里描述并说明的其它方框同时发生。而且,依照本发明,不是需要所有示出的方框来实现本方法。In view of one or more of the exemplary systems described above, methods that may be implemented in accordance with the present invention may be better appreciated with reference to the flowcharts of FIGS. 11-13 . While the methodologies are shown and described as a series of blocks for simplicity of explanation, it is to be understood and appreciated that the invention is not limited by the order of the blocks, as certain blocks may be in different order in accordance with the invention. Occurs sequentially and/or concurrently with other blocks described and illustrated herein. Moreover, not all illustrated blocks may be required to implement a methodology in accordance with the invention.
另外,应当进一步认识到的是,以下和贯穿本说明书所揭示的方法能够被储存在制造物品中,以便于将这样的方法运输并传递到计算机中。所用的术语制造物品旨在包含可从任何计算机可读设备、载波或介质上访问的计算机程序。作为说明而非限制,制造物品可具体体现为计算机可读指令、数据结构、模式、程序模块等等。In addition, it should be further appreciated that the methods disclosed below and throughout this specification can be stored in an article of manufacture to facilitate transport and transfer of such methods to a computer. The term article of manufacture is used to encompass a computer program accessible from any computer readable device, carrier, or media. By way of illustration and not limitation, articles of manufacture may embody computer readable instructions, data structures, schemas, program modules, and the like.
图11依照本发明的一方面描述了用于建立快照数据库1100的方法。快照数据库维持有关从其创建的时间点以来对源数据库的改变的数据。在1100处,接收变更源或主要数据库中的数据的请求。例如,可做出改变或变更数据页的请求。在1120处,要由新数据置换的源数据库中的数据副本被复制到对应于源数据库的修改的快照数据库文件和页中。在1130处,新数据被源数据库中的老数据复制或替代。最后,在1130处,可更新目录,以通知对数据库的改变以及快照数据库中的条目。FIG. 11 depicts a method for building a
图12依照本发明的一方法示出了数据恢复方法1200。在1210处,储存在快照数据库中的每一数据页可盖写主要数据库中的对应位置上数据。此外,应当认识到,数据库中的主要文件可在必要的情况下被扩展,以启用快照数据的接收。在1220处,快照数据库或其中文件的大小可被标识,并与主要数据库或其中对应文件的大小相比较。若快照数据库或其中的文件小于主要数据库或其中的文件,其意味着文件不应存在于恢复的数据库中,则主要数据库可被截短,以删除添加的数据页。这可对应于当根据本发明方面新添加的数据被添加到文件末端时删除文件中的最后一个数据页。在1230处,可从存储器中检索在快照创建时尚未提交的打开的事务,并应用于正恢复的主要数据库。接下来,可在1240处检索数据库日志,并应用于恢复的数据库,以进一步将数据库推进到更接近需要恢复的事件处,这样以使保存直到事件出现但是在事件出现之前的尽可能多的“良好”事务。Figure 12 illustrates a
现在转到图13,依照本发明的一方面来描述数据恢复方法1300。在1310处,数据库快照被创建并被维持。数据库快照可由用户在任何时刻创建。此外,可创建一个以上快照,这样以随着时间的推移而提供多个版本点。快照数据库也可被自动创建。例如,监视器组件可观察关于源或主要数据库的行动作,并检测和/或推断可显著变更数据库的行动。例如,快照可在检测到新应用程序安装时被自动创建。根据本发明的一方面,数据库快照可储存对源数据库的变化。因此,维持数据库快照对应于复制对其的变化。根据本发明的另一方面,快照可包含稀疏文件,从而仅储存对于对应页的改变,并且与主要数据库共享所有其它的数据。在1320处,数据库可在出现包括但不局限于用户错误(如快手指删除)等事件时,还原到由快照所标记的先前的时间点。特别地,还原或恢复可包含,将来自快照数据库中的页复制到主要数据库中的页上、截短主要数据库、在快照创建的时候将未提交的打开的事务应用于数据库、以及将数据库日志信息应用于主要数据库以集中于事件上。Turning now to FIG. 13, a data recovery method 1300 is described in accordance with an aspect of the present invention. At 1310, a database snapshot is created and maintained. Database snapshots can be created by users at any time. Additionally, more than one snapshot can be created, thus providing multiple version points over time. Snapshot databases can also be created automatically. For example, a monitor component can observe actions on a source or primary database, and detect and/or infer actions that may significantly alter the database. For example, a snapshot can be automatically created when a new application installation is detected. According to an aspect of the invention, a database snapshot may store changes to a source database. Therefore, maintaining a database snapshot corresponds to replicating changes to it. According to another aspect of the invention, snapshots may contain sparse files, storing only changes to corresponding pages, and sharing all other data with the primary database. At 1320, the database can be restored to the previous point in time marked by the snapshot when an event occurs including but not limited to a user error (such as quick finger deletion). In particular, restore or recovery may involve copying pages from the snapshot database to pages in the primary database, truncating the primary database, applying uncommitted open transactions to the database at the Information is applied to the main database to focus on events.
示例操作环境Example operating environment
为提供关于本发明各方面的环境,图14以及下面的讨论旨在提供其中可实现本发明各方面的合适计算环境的简短概括描述。虽然上面已经通过在一台和/或多台计算机上运行的计算机程序的计算机可执行指令的通用上下文来描述了本发明,但是本领域的技术人员会认识到,本发明也可结合其它的程序模块来实现。一般而言,程序模块包括例程、程序、组件、数据结构等,其执行特定的任务和/或实现特定的抽象数据类型。此外,本领域的技术人员会认识到,本发明方法可用其它计算机系统配置来实施,包括单处理器或多处理器计算机系统、小型计算设备、大型机,以及个人计算机、手持式计算设备、基于微处理器的或可编程消费者电子设备等等。本发明所示的各方面也可在分布式计算环境中实施,其中任务由通过通信网络链接的远程处理设备来执行。然而,本发明的某些(若不是所有)方面可在独立的计算机上实施。在分布式计算环境中,程序模块可位于本地和远程存储器存储设备中。In order to provide context with respect to aspects of the invention, FIG. 14 and the following discussion are intended to provide a brief general description of a suitable computing environment in which aspects of the invention may be implemented. Although the invention has been described above in the general context of computer-executable instructions of a computer program running on one and/or more computers, those skilled in the art will recognize that the invention can also be combined with other programs module to achieve. Generally, program modules include routines, programs, components, data structures, etc. that perform particular tasks and/or implement particular abstract data types. In addition, those skilled in the art will recognize that the methods of the present invention may be implemented with other computer system configurations, including single-processor or multi-processor computer systems, miniature computing devices, mainframes, as well as personal computers, handheld computing devices, based Microprocessor's or programmable consumer electronics, etc. The illustrated aspects of the invention may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. However, some, if not all, aspects of the invention can be implemented on stand-alone computers. In a distributed computing environment, program modules may be located in both local and remote memory storage devices.
参考图14,用于实现本发明各个方面的示例性环境1410包括计算机1412。计算机1412包括处理单元1414、系统存储器1416以及系统总线1418。系统总线1418将系统组件(包括但不局限于系统存储器1416)连接到处理单元1414。处理单元1414可以是任何多种可用处理器。双微处理器和其它多处理器体系结构也可被用作处理单元1414。Referring to FIG. 14 , an exemplary environment 1410 for implementing aspects of the invention includes a
系统总线1418可以是任何几种类型的总线结构的一种或多种,包括存储器总线或存储器控制器、外围总线或外部总线、和/或使用任何多种可用总线体系结构的任一种的局部总线,这包括但不局限于,11位总线、工业标准体系结构(ISA)、微通道体系结构(MCA)、扩展ISA(EISA)、智能驱动电子设备(IDE)、VESA局部总线(VLB)、外围部件互联(PCI)、通用串行总线(USB)、高级图形端口(AGP)、个人计算机存储器卡国际协会总线(PCMCIA),以及小型计算机系统接口(SCSI)。The
系统存储器1416包括易失性存储器1420和非易失性存储器1422。基本输入/输出系统(BIOS)包含基本例程,用来如在启动阶段在计算机1412内的元件之间传递信息,该基本输入/输出系统(BIOS)被储存在非易失性存储器1422中。作为说明而非限制,非易失性存储器1422可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除ROM(EEPROM)、或者闪存。易失性存储器1420包括随机存取存储器(RAM),其用作外部高速缓存存储器。作为说明但非限制,RAM可以多种形式可用,如同步RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路DRAM(SLDRAM),以及直接存储器总线RAM(DRRAM)。
计算机1412也包括可移动/不可移动、易失性/非易失性计算机存储介质。图14示出例如盘存储1412。盘存储1412包括但不局限于诸如磁盘驱动器、软盘驱动器、磁带驱动器、Jaz驱动器、Zip驱动器、LS-100驱动器、闪存卡、或者记忆棒等设备。另外,盘存储器1424可单独包括存储介质或与其它存储介质结合,其它存储介质包括但不限于光盘驱动器,如光盘ROM设备(CD-ROM)、CD可记录驱动器(CD-R驱动)、CD可重写驱动器(CD-RW驱动器)或者数字多功能盘ROM驱动器(DVD-ROM)。为促进盘存储设备1424与系统总线1418的连接,通常使用可移动或不可移动接口,如接口1426。
应当认识到图14描述了担当用户以及在合适的操作环境1410中描述的基本计算机资源之间的中介的软件。这样的软件包括操作系统1428。操作系统1428可储存于盘存储器1424中,其用来控制并分配计算机系统1412的资源。系统应用程序1430利用操作系统1428通过储存在系统存储器1416或盘存储器1424中的程序模块1432和程序数据1434对资源的管理。此外,应当认识到,本发明可用各种操作系统或操作系统的组合来实现。It should be appreciated that FIG. 14 depicts software that acts as an intermediary between a user and the basic computer resources described in a suitable operating environment 1410 . Such software includes an
用户通过输入设备1436将命令或信息输入到计算机1412中。输入设备1436包括,但不限于,定位设备(如鼠标、跟踪球、触针、触摸垫、触摸屏)、键盘、话筒、操纵杆、游戏垫、圆盘式卫星电视天线、扫描仪、电视调谐器卡、数码照相机、数码录像机、网络照相机等等。这些和其它输入设备由接口端口1438,通过系统总线1418连接到处理单元1414。接口端口1438包括如串行端口、并行端口、游戏端口以及通用串行总线(USB)。输出设备1440使用某些与输入设备1436相同类型的端口。这样,例如,USB端口可用来将输入提供给计算机1412,并将信息从计算机1412输出到输出设备1440。提供输出适配器1442,用于说明存在某些输出设备1440,像监视器、扬声器和打印机以及其它输出设备1440,它们需要特殊的适配器。输出适配器1442包括(作为说明但非限制)视频卡和声卡,其提供输出设备1440和系统总线1418之间的连接手段。应当注意,如远程计算机1444等其它设备和/或设备系统提供输入以及输出能力。A user enters commands or information into
计算机1412可在使用到一台或多台远程计算机,如远程计算机1444的逻辑连接的网络化环境中工作。远程计算机1444可以是个人计算机、服务器、路由器、网络PC、工作站、基于微处理器的装置、对等设备或者其它普通网络节点等等,其通常包括许多或所有上面相对计算机1412所描述的元件。为简单起见,仅与远程计算机1444一起示出了存储器存储设备1446。远程计算机1444逻辑上通过网络接口1448与计算机1412相连,然后通过通信连接1450物理地连接。网络接口1448包含如本地网(LAN)和广域网(WAN)这样的通信网络。LAN技术包括光纤分布式数据接口(FDDI)、铜缆分布式数据接口(CDDI)、以太网/IEEE 802.3、令牌环/IEEE 802.5等等。WAN技术包括,但不限于,点对点链路、像综合业务数字网(ISDN)及其变化的电路交换网络、分组交换网络、以及数字用户线(DSL)。
通信连接1450指用于将网络接口1448连接到总线1418的硬件/软件。虽然为说明的清晰性,示出通信连接1450在计算机1412内部,但是其也可在计算机1412外部。连接到网络接口1448所需的硬件/软件包括(仅示例性的)内部和外部技术,如调制解调器(包括常规电话级调制解调器、电缆调制解调器、DSL调制解调器、功率调制解调器、ISDN适配器以及以太网卡。
图15是可与本发明交互的示例计算环境1500的原理框图。系统1500包括一个或多个客户机1510。客户机1510可以是硬件和/或软件(如线程、进程、计算设备)。系统1500也包括一个或多个服务器1530。服务器1530也可以是硬件和/或软件(如线程、进程、计算设备)。服务器1530可容纳线程,以如通过使用本发明而执行变换。客户机1510和服务器1530之间的一个可能通信可以是以适合在两个或多个计算机进程中传送的数据分组的形式。系统1500包括通信框架1550,其可用来促进客户机1510和服务器1530之间的通信。客户机1510可操作上连接到用于储存对客户机1510本地的信息的一个或多个客户机数据存储1560。同样的,服务器1530操作上可连接到可用来储存对服务器1530本地的信息的一个或多个服务器数据存储1540。FIG. 15 is a functional block diagram of an example computing environment 1500 that can interact with the present invention. System 1500 includes one or more clients 1510 . Client 1510 can be hardware and/or software (eg, thread, process, computing device). System 1500 also includes one or more servers 1530 . Server 1530 can also be hardware and/or software (eg, thread, process, computing device). Servers 1530 may house threads to perform transformations as by using the present invention. One possible communication between client 1510 and server 1530 may be in the form of data packets suitable for transfer between two or more computer processes. System 1500 includes a communications framework 1550 that can be used to facilitate communications between clients 1510 and servers 1530 . Client 1510 is operatively connected to one or more client data stores 1560 for storing information local to client 1510 . Likewise, server 1530 may be operatively connected to one or more server data stores 1540 that may be used to store information local to server 1530 .
上面已经描述的包括本发明的示例。当然,不可能为描述本发明而描述组件或方法的每个可想到的组合,但是本领域的普通技术人员会认识到,本发明的许多其它组合和排列也是可能的。因此,本发明旨在包含落入所附权利要求书的精神和范围内的所有这样的变更、修改和变化。此外,在详细描述或权利要求书中使用术语“包括或具有”的意义上,这样的术语应类似于术语“包含”为包括性的,如同“包含”在用作权利要求书中的过渡词时被解释的那样。What has been described above includes examples of the present invention. It is, of course, not possible to describe every conceivable combination of components or methodologies for purposes of describing the present invention, but those of ordinary skill in the art will recognize that many other combinations and permutations of the present invention are possible. Accordingly, the present invention is intended to embrace all such alterations, modifications and variations that fall within the spirit and scope of the appended claims. Furthermore, where the term "comprises or has" is used in the detailed description or in the claims, such terms should be inclusive like the term "comprises" as if "comprising" is used as a transition word in the claims as explained at the time.
Claims (19)
Applications Claiming Priority (5)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US54764104P | 2004-02-25 | 2004-02-25 | |
| US60/547,641 | 2004-02-25 | ||
| US10/833,541 | 2004-04-28 | ||
| US10/833,541 US8095511B2 (en) | 2003-06-30 | 2004-04-28 | Database data recovery system and method |
| PCT/US2004/024048 WO2005086032A1 (en) | 2004-02-25 | 2004-07-27 | Database data recovery system and method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN1784676A CN1784676A (en) | 2006-06-07 |
| CN1784676B true CN1784676B (en) | 2012-05-30 |
Family
ID=36773857
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN200480001706.4A Expired - Fee Related CN1784676B (en) | 2004-02-25 | 2004-07-27 | Database data recovery system and method |
Country Status (3)
| Country | Link |
|---|---|
| CN (1) | CN1784676B (en) |
| AT (1) | ATE463797T1 (en) |
| DE (1) | DE602004026422D1 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105027070A (en) * | 2013-01-10 | 2015-11-04 | 净睿存储股份有限公司 | Safety for volume operations |
Families Citing this family (23)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8112664B2 (en) * | 2008-03-26 | 2012-02-07 | Symantec Operating Corporation | Using volume snapshots to prevent file corruption in failed restore operations |
| US8412676B2 (en) * | 2008-10-21 | 2013-04-02 | Microsoft Corporation | Forgetting items with knowledge based synchronization |
| CN102685733B (en) * | 2012-04-27 | 2016-08-03 | 王兰睿 | A kind of method and system for creating and safeguard mobile station information mirror database |
| CN103870478B (en) * | 2012-12-12 | 2018-09-25 | 腾讯科技(深圳)有限公司 | A kind of method and device for restoring synchrodata |
| CN103914359B (en) * | 2012-12-31 | 2017-09-26 | 中国移动通信集团浙江有限公司 | A kind of data reconstruction method and device |
| GB2509930A (en) * | 2013-01-17 | 2014-07-23 | Ibm | Data backup recovery |
| US9501501B2 (en) * | 2013-03-15 | 2016-11-22 | Amazon Technologies, Inc. | Log record management |
| US9514007B2 (en) | 2013-03-15 | 2016-12-06 | Amazon Technologies, Inc. | Database system with database engine and separate distributed storage service |
| CN104156369B (en) * | 2013-05-14 | 2019-04-02 | 上海盛大网络发展有限公司 | A kind of database mirroring production method and a kind of database |
| US9098453B2 (en) * | 2013-07-11 | 2015-08-04 | International Business Machines Corporation | Speculative recovery using storage snapshot in a clustered database |
| CN105677673B (en) * | 2014-11-20 | 2019-01-04 | 阿里巴巴集团控股有限公司 | Method for processing business, apparatus and system |
| CN104462342B (en) * | 2014-12-04 | 2018-08-07 | 北京国双科技有限公司 | database snapshot synchronization processing method and device |
| WO2016095156A1 (en) * | 2014-12-18 | 2016-06-23 | Intel Corporation | Translation cache closure and persistent snapshot in dynamic code generating system software |
| US10884869B2 (en) * | 2015-04-16 | 2021-01-05 | Nuodb, Inc. | Backup and restore in a distributed database utilizing consistent database snapshots |
| US10067969B2 (en) | 2015-05-29 | 2018-09-04 | Nuodb, Inc. | Table partitioning within distributed database systems |
| US10180954B2 (en) | 2015-05-29 | 2019-01-15 | Nuodb, Inc. | Disconnected operation within distributed database systems |
| US10496672B2 (en) * | 2015-12-30 | 2019-12-03 | EMC IP Holding Company LLC | Creating replicas at user-defined points in time |
| CN107239365B (en) * | 2016-03-29 | 2020-11-27 | 华为技术有限公司 | A method and apparatus for accessing a storage device |
| CN106708662A (en) * | 2016-12-13 | 2017-05-24 | 上海上讯信息技术股份有限公司 | Method for restoring database and equipment |
| TWI735518B (en) * | 2017-01-24 | 2021-08-11 | 香港商阿里巴巴集團服務有限公司 | Service provision method and system of database |
| CN107203345B (en) * | 2017-06-01 | 2019-10-01 | 深圳市云舒网络技术有限公司 | A kind of more copies storage rapid verification coherence method and its device |
| CN109388519B (en) * | 2017-08-07 | 2021-06-11 | 上海寒武纪信息科技有限公司 | Error recovery method and device and processor |
| CN111414370A (en) * | 2019-01-07 | 2020-07-14 | 北京智融网络科技有限公司 | Feature library updating method and system |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6065018A (en) * | 1998-03-04 | 2000-05-16 | International Business Machines Corporation | Synchronizing recovery log having time stamp to a remote site for disaster recovery of a primary database having related hierarchial and relational databases |
| US6438749B1 (en) * | 1999-03-03 | 2002-08-20 | Microsoft Corporation | Method and system for restoring a computer to its original state after an unsuccessful patch installation attempt |
-
2004
- 2004-07-27 DE DE602004026422T patent/DE602004026422D1/en not_active Expired - Lifetime
- 2004-07-27 CN CN200480001706.4A patent/CN1784676B/en not_active Expired - Fee Related
- 2004-07-27 AT AT04779217T patent/ATE463797T1/en not_active IP Right Cessation
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US6065018A (en) * | 1998-03-04 | 2000-05-16 | International Business Machines Corporation | Synchronizing recovery log having time stamp to a remote site for disaster recovery of a primary database having related hierarchial and relational databases |
| US6438749B1 (en) * | 1999-03-03 | 2002-08-20 | Microsoft Corporation | Method and system for restoring a computer to its original state after an unsuccessful patch installation attempt |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105027070A (en) * | 2013-01-10 | 2015-11-04 | 净睿存储股份有限公司 | Safety for volume operations |
| CN105027070B (en) * | 2013-01-10 | 2018-05-29 | 净睿存储股份有限公司 | Roll up the security of operation |
Also Published As
| Publication number | Publication date |
|---|---|
| ATE463797T1 (en) | 2010-04-15 |
| DE602004026422D1 (en) | 2010-05-20 |
| CN1784676A (en) | 2006-06-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP1602042B1 (en) | Database data recovery system and method | |
| CN1784676B (en) | Database data recovery system and method | |
| US11740974B2 (en) | Restoring a database using a fully hydrated backup | |
| EP3008599B1 (en) | Live restore for a data intelligent storage system | |
| EP2366151B1 (en) | Method and system for managing replicated database data | |
| US10089192B2 (en) | Live restore for a data intelligent storage system | |
| US10061658B2 (en) | System and method of data intelligent storage | |
| US7257689B1 (en) | System and method for loosely coupled temporal storage management | |
| US20160224430A1 (en) | Triggering discovery points based on change | |
| CN107835983A (en) | Backup-and-restore is carried out in distributed data base using consistent database snapshot | |
| US11403176B2 (en) | Database read cache optimization | |
| CN116648693A (en) | Method and device for backing up file system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| ASS | Succession or assignment of patent right |
Owner name: MICROSOFT TECHNOLOGY LICENSING LLC Free format text: FORMER OWNER: MICROSOFT CORP. Effective date: 20150429 |
|
| C41 | Transfer of patent application or patent right or utility model | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20150429 Address after: Washington State Patentee after: Micro soft technique license Co., Ltd Address before: Washington State Patentee before: Microsoft Corp. |
|
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20120530 Termination date: 20200727 |