Abstract—Advantage Database Server (ADS) is a high performance,low-maintenance, remote database server that permitsyou to easily build and deploy client/server applications andWeb-based applications. ADS retrieve requests for databaseoperations to be performed on behalf of clients. For performance,application or software is being integrated with database systemcode, this application or software has direct access to databasesystems buffer, and because of this the danger of data beingcorrupted due to application writes is increased. We investigatean alternative approach that associated with corrupted regionof data.
Advantage database table repair utility detect thatcorruption and fix ADT (Advatage Database Table) file.Index Terms—Database corruption, data integrity, detection,repair.I. INTRODUCTIONAdvantage Database Server (ADS) is a high-performance,low-maintenance, remote database server that permits you toeasily build and deploy client/server applications and Webbasedapplications. ADS retrieve requests for database operationsto be performed on behalf of clients. ADS locatetables on server and processes database operations and resultof operation then returned to client across network, eliminateneed to send the database to client for processing.
Unlike many of the more complicated and expensivedatabase servers, such as Microsoft’s SQL Server and Oracle,ADS (Advantage Database Server) is not a traditional setbasedrelational database server based on SQL. Instead, ADS(Advantage Database Server) is an ISAM (indexed sequentialaccess method) relational database server. ISAM databases useindexes extensively, permitting them to perform high-speedtable searches, filtering, and table joins.Now a days, hardware are more reliable, therefore softwareerrors are often the biggest threat to database systemavailability. For performance, special purpose application codeis being integrated with database system code. Databasesallow users to add new data types to the database engine.
Performance-critical software may require the performancethat can achieved by accessing data directly that stored in amain-memory 1. In both cases, due to complex and costlierinter-process communication, direct access to database buffercache is critical to meet the performance required by theseSponsored by SAP Labs India Pvt. Ltd.applications. Therefore, availability of database can be affectedby software errors as well as errors in application programme.Advantage database table repair utility reads table header todetect errors in ADT file.
Table header contains informationabout table such as string identifier, table encryption, autoencrypted value, memo files and so on. This informationis used to check correctness of ADT table and AdvantageDatabase Memo (ADM) file. This header value cross checkedagainst table record to identify corruption for example we cancalculate file length using table header and check that valuewith actual file length.II. REVIEW OF LITERATURELog Based Recovery1, 15 : Log is a sequence of records,which maintains the records of actions performed by a transaction.It is important that the logs are written prior to theactual modification and stored on a stable storage media,which is failsafe.
If a transaction crashes, then the recoverymanager may undo transactions i.e. reverse the operations ofa transaction. This involves examining a transaction for thelog entry write item(T, x, old value, new value) and settingthe value of item x in the database to old-value.There aretwo major techniques for recovery from transaction failures:deferred updates and immediate updates.Deferred updates 15 : This technique does not physicallyupdate the database on disk until a transaction has reached itscommit point. Before reaching commit, all transaction updatesare recorded in the local transaction workspace. If a transactionfails before reaching its commit point, it will not have changedthe database in any way so UNDO is not needed.
It maybe necessary to REDO the effect of the operations that arerecorded in the local transaction workspace, because theireffect may not yet have been written in the database. Hence, adeferred update is also known as the No-undo/redo algorithm.Immediate updates 15 : In the immediate update, thedatabase may be updated by some operations of a transactionbefore the transaction reaches its commit point. However,these operations are recorded in a log on disk before theyare applied to the database, making recovery still possible. If atransaction reaches its commit point, the effect of its operationmust be undone i.
e. the transaction must be rolled back hencewe require both undo and redo. This technique is known asundo/redo algorithm.Shadow Paging 14, 15 : Shadow paging is an alternativeto log-based recovery techniques, which has both advantagesand disadvantages. It may require fewer disk accesses, butit is hard to extend paging to allow multiple concurrenttransactions. The paging is very similar to paging schemesused by the operating system for memory management.The idea is to maintain two page tables during the life ofa transaction: the current page table and the shadow pagetable. When the transaction starts, both tables are identical.
The shadow page is never changed during the life of thetransaction. The current page is updated with each writeoperation. Each table entry points to a page on the disk.When the transaction is committed, the shadow page entrybecomes a copy of the current page table entry and thedisk block with the old data is released. If the shadow isstored in nonvolatile memory and a system crash occurs, thenthe shadow page table is copied to the current page table.This guarantees that the shadow page table will point to thedatabase pages corresponding to the state of the database priorto any transaction that was active at the time of the crash,making aborts automatic.Recovery With Concurrent Transaction3 : Regardless ofthe number of concurrent transactions, the disk has only onesingle disk buffer and one single log.
These are shared by alltransactions. The buffer blocks are shared by a transactions.We allow immediate updates, and permit a buffer block tohave data items updated by one or more transactions.
Whenmore than one transaction are being executed in parallel, thelogs are interleaved. At the time of recovery, it would becomehard for the recovery system to backtrack all logs, and thenstart recovering. To ease this situation, most modern DBMSuse the concept of ‘checkpoints’.Before Image Table(BI table)4 : Deleted data, generallynamed as before image, can be found in almost all modernDBMSs in various forms.BI table is a kind of table transparentto users. Each BI table is bound with a base table in database.It has the same structure as its relevant base table except thatit has no integrity constraints. Rows deleted from a base tableare inserted into its BI table automatically.
This can be simplyrealized with a trigger. When a row in a base table is deletedor updated, the trigger will be invoked and the rows old valuewill be inserted into the tables BI table.BI tables may induce data redundancy because there willexist double before image in the system. However, it mustbe pointed out that the traditional before image is transitory,while data in BI tables will be long-standing until they areconfirmed out of date.III. SYSTEM ARCHITECTURERepair utility scans a given directory for ADT files andperforms a number of checks for corruption or bad data. Itreports all findings to a log file and displays a ‘VALID’ tagfor each correct file in the directory.
If you decide to fix theinvalid files, it asks you if you’d like to backup the originalADT and ADM files. It then performs the same checks andfixes problems whenever possible.Fig. 1. System ArchitectureEncrypted tables require the table password in order tobe analyzed by repair utility. If no password or an incorrectpassword is supplied, repair utility displays the table namealong with ‘ENCRYPTED’ showing it was unable to analyzethe table.
IV. SYSTEM ANALYSISA. Table headerBelow is structure of ADT table header with some of itsfield.
Total size of table header is 400 bytes.TABLE IADVANTAGE DATABASE TABLE HEADERSize Data Type Description20 STRINGIdentifies table as an Advantage table,e.g. “Advantage Table”4 UINT32 Table structure version.
8 UINT64 Number of records in the table4 UINT32First record position (IOW, theheader length)4 UINT32 Record width8 UINT64Record number of first deleted record inour deleted record linked list8 UINT64 Number of records marked for deletion.20 STRINGEncrypted encryption passwordassociated with this table4 VOIDOptions information. Bits set for:1) Contains memo file,2) Has auto-increment field,3) Table is encrypted40 Reserved for future useB. Record headerRecord Header is 5 bytes.• 4 extra bytes• 1 byte for option information- Record encrypted- Record updated within a transaction- Record appended within a transactionC. What and how to fix ADT file• Incorrect file size : check physical file size with calculatedfile size using table header .Following is formula to calculate file size using tableheaderfsize = (rlength?no.ofrecords)+headerlength (1)where,fsize = filesizerlength = record length• Record is encrypted but table is not encrypted : Eventhough it is possible to encrypt some records and notothers, it is usually corruption in the record header ratherthan intentional.
With this option enabled, repair utilitywill clear the encryption bit in the record header.• Records that have never been released from a transaction:Repair utility will reset transaction bits to a completetransaction state.• Incorrect record count: Repair utility will reset the recordcount in the ADT header to reflect the current recordnumber.
Repair utility finds maximum auto increment value androw version value by scanning each record and comparethat value with header auto increment and row versionvalue. if mismatch found then repair utility update headervalue by actual max auto and max row version valuewhich got from records.• Corruption associated with memo files :Memo block overlapping If repair utility finds multiplerecords in the ADT that have memo fields pointing to thesame memo data blocks in the ADM, it will make a copyof one of the memos to avoid the overlap.Corruption in the free block list ADM files keep alist of allocated but unused blocks for memo data. Ifrepair utility finds freelist entries with bad or overlappingpointers it will clear them.
Invalid memo pointers (past EOF, before BOF, in ADMheader) ADT records with bad memo pointers will bereset to zero (no data).Orphaned memo blocks Blocks in the ADM allocated butnot referenced by any records will be reported to the log,but not modified.V. CONCLUSIONDatabase system is an important part of computer systemthat is used to store data.
When failure occurs, informationstored in database is lost and database becomes inconsistent.Recovery scheme is an essential part of a database systemwhich can restore the database to the consistent state thatexisted before the failure.The system i.e. repair utility will be helpful to detect andfix that errors using table header and record header.