← Back to Patent Explorer
US4945474A Expired / Lapsed US ⏱️ 0.0 years remaining

Method for restoring a database after I/O error employing write-ahead logging protocols

Assignee: International Business Machines Corp
•
Filing: 1988-04-08
•
Granted: 1990-07-31
•
Expires: 2008-04-08
📄 Original PDF 🌐 Google Patents 🔄 Sync Now

Abstract

Abstract Method for reducing data loss during I/O errors and power failure during non-atomic writes to media in a transaction management system using write-ahead logging protocol. A recovery log is written during forward processing. On system restart processing, the log is traversed and a REDO executed. Recovery is effected from detected incomplete log writes or log write failures and uncommitted transactions are undone. A technique is provided in which files having I/O errors are identified, whereby subsequent restart operations are prevented from accessing these files. In one embodiment index files with such error are renamed, serving to indicate that corresponding original files contain errors, and the error index files are automatically rebuilt whereby I/O error on the files causes no data loss. The index file rebuild does not invalidate access plans related to the failed index.

Inventors

  • 👤 Linda C. Elliott
  • 👤 Gary R. Horn
  • 👤 II Lloyd E. Jordan
  • 👤 Frank E. Levine
  • 👤 Cheng-Fong Shih
  • 👤 William W. Myre, Jr.

Bibliographic Details

Application Number —
Jurisdiction US
Data Source google_patents
Last Synchronized 2026-10-24 18:16
CPC Classifications
G; G06; G06F; G06F11/00; G06F11/07; G06F11/14; G06F11/1471; G06F2201/00; G06F2201/87; Y; Y10; Y10S; Y10S707/00; Y10S707/99951; Y10S707/99952; Y10S707/99953

Claims Analysis

Total Claims: 11
Claim 1
Independent Claim 297 words
In a computerized database system including a storage medium for storing data files, index files, and a recovery log having a plurality of files, and a CPU for I/O to said storage medium, a method executed by said system for recovering a database after an I/O error, comprising the steps of: (a) writing log records during normal forward processing to said recovery log on said storage medium; (b) traversing across said recovery log on said storage medium during RESTART routine processing after said I/O error for detecting committed and uncommitted transactions, said RESTART routine including a REDO sub-routine for redoing committed transactions recorded in said recovery log; (c) detecting said written log records in said recovery log which are incomplete or failed; (d) executing a recovery routine; (e) executing an UNDO routine for undoing said detected uncommitted transactions; (f) renaming said files on said storage medium having said I/O error; (g) storing in a first file on said storage medium indicators of said renamed files that identify said renamed files as error files; (h) accessing said first file for said indicators; (i) preventing a subsequent RESTART routine from accessing said identified I/O error files in response to said accessing said first file; (j) continuing said RESTART routine in response to said accessing said first file while preventing operations on said identified I/O error files during said continued RESTART routine; (k) generating a request for access to one of said data files on said storage medium having a corresponding index file; (l) accessing said one of said data files on said medium to determine whether said corresponding index file has been renamed thereby indicating said corresponding index file is an error index file; (m) rebuilding said index file in response to said determination of said error index file.
Claim 2
Dependent Claim 297 words
In a computerized database system including a storage medium for storing data files, index files, and a recovery log having a plurality of files, and a CPU for I/O to said storage medium, a method executed by said system for recovering a database after an I/O error, comprising the steps of: (a) writing log records during normal forward processing to said recovery log on said storage medium; (b) traversing across said recovery log on said storage medium during RESTART routine processing after said I/O error for detecting committed and uncommitted transactions, said RESTART routine including a REDO sub-routine for redoing committed transactions recorded in said recovery log; (c) detecting said written log records in said recovery log which are incomplete or failed; (d) executing a recovery routine; (e) executing an UNDO routine for undoing said detected uncommitted transactions; (f) renaming said files on said storage medium having said I/O error; (g) storing in a first file on said storage medium indicators of said renamed files that identify said renamed files as error files; (h) accessing said first file for said indicators; (i) preventing a subsequent RESTART routine from accessing said identified I/O error files in response to said accessing said first file; (j) continuing said RESTART routine in response to said accessing said first file while preventing operations on said identified I/O error files during said continued RESTART routine; (k) generating a request for access to one of said data files on said storage medium having a corresponding index file; (l) accessing said one of said data files on said medium to determine whether said corresponding index file has been renamed thereby indicating said corresponding index file is an error index file; (m) rebuilding said index file in response to said determination of said error index file.
Claim 3
Dependent Claim 77 words
The method of claim 1 wherein a plurality of said log records comprises a log record page residing on said medium; a maximum I/O page size comprises a memory page; and wherein said step of writing said log records further comprises detecting when the size of said log record page is substantially equal to that of said memory page; writing a substantially full log record page to an nth page of said recover log on said medium.
Claim 4
Dependent Claim 59 words
The method of claim 2 wherein said step of writing said log records further comprises the steps of detecting when the size of next ones of said log record pages is less than that of said memory page; and in response thereto alternating writing said next ones of said log record pages to alternating page locations in said log.
Claim 5
Dependent Claim 36 words
The method of claim 1 further including generating an error status when one of said identified filed is a data files; and returning said error status to an application program seeking access to said data file.
Claim 6
Dependent Claim 38 words
The method of claim 1 further including generating an error status when one of said identified files comprises a long filed file; and returning said error status to an application program seeking to access said long field file.
Claim 7
Dependent Claim 26 words
The method of claim 1 further including the step of preventing return of error status to an application program seeking to access said error index file.
Claim 8
Dependent Claim 52 words
The method of claim 6 including the steps of providing a configuration option rebuild indicator for requesting error index rebuilds; executing a RESTART UNDO routine; setting said rebuild indicator; detecting that said rebuild indicator is set; and performing said index file rebuild in response to said detection of said indicator being set.
Claim 9
Dependent Claim 20 words
The method of claim 1 wherein said I/O error is an incomplete log write or a detected log write failure.
Claim 10
Dependent Claim 146 words
In a computerized database system, a method of generating a recovery log for use in a relational database system having a data file and an index file, comprising the steps of: initializing a plurality of log pages; generating a plurality of log records; writing to media a full log page of said records in one of said initialized log pages having a page number n; writing to said media in response to said system sub-pages of said records in next ones of said initialized log pages having respective alternative and consecutive page locations numbers n+1 and n+2; detecting an I/O error in at least one of said written full pages or sub-pages; and preventing additional said writes to said media in response to said detected I/O error, wherein said I/O error is a detected log write failure or an incomplete log write on said index file.
Claim 11
Dependent Claim 146 words
In a computerized database system, a method of generating a recovery log for use in a relational database system having a data file and an index file, comprising the steps of: initializing a plurality of log pages; generating a plurality of log records; writing to media a full log page of said records in one of said initialized log pages having a page number n; writing to said media in response to said system sub-pages of said records in next ones of said initialized log pages having respective alternative and consecutive page locations numbers n+1 and n+2; detecting an I/O error in at least one of said written full pages or sub-pages; and preventing additional said writes to said media in response to said detected I/O error, wherein said I/O error is a detected log write failure or an incomplete log write on said index file.

References Cited (Backward Citations)

US3736566A Cited
US4044337A Cited
US4507751A Cited
US4648031A Cited
US4498145A Cited
US4697266A Cited
US4686620A Cited
US4751639A Cited
US4814971A Cited
US4815028A Cited
US4819156A Cited

USPTO Annuity & Maintenance Windows

Annuity Stage Window Opens Payment Deadline Surcharge Period Until Estimated Fee Status
3.5 Years (Year 4) 1993-07-30 1994-01-29 1994-07-31 $2000.00 Window Closed / Lapsed
7.5 Years (Year 8) 1997-07-30 1998-01-29 1998-07-31 $3760.00 Window Closed / Lapsed
11.5 Years (Year 12) 2001-07-30 2002-01-29 2002-07-31 $7700.00 Window Closed / Lapsed

Assigned Categories & Tags

No categories assigned to this patent yet.

Assign Category Tag