Abstract—Advantage Database Server (ADS) is a high performance,
low-maintenance, remote database server that permits
you to easily build and deploy client/server applications and
Web-based applications. ADS retrieve requests for database
operations to be performed on behalf of clients. For performance,
application or software is being integrated with database system
code, this application or software has direct access to database
systems buffer, and because of this the danger of data being
corrupted due to application writes is increased. We investigate
an alternative approach that associated with corrupted region
of data. Advantage database table repair utility detect that
corruption and fix ADT (Advatage Database Table) file.
Index Terms—Database corruption, data integrity, detection,
Advantage Database Server (ADS) is a high-performance,
low-maintenance, remote database server that permits you to
easily build and deploy client/server applications and Webbased
applications. ADS retrieve requests for database operations
to be performed on behalf of clients. ADS locate
tables on server and processes database operations and result
of operation then returned to client across network, eliminate
need to send the database to client for processing.
Unlike many of the more complicated and expensive
database servers, such as Microsoft’s SQL Server and Oracle,
ADS (Advantage Database Server) is not a traditional setbased
relational database server based on SQL. Instead, ADS
(Advantage Database Server) is an ISAM (indexed sequential
access method) relational database server. ISAM databases use
indexes extensively, permitting them to perform high-speed
table searches, filtering, and table joins.
Now a days, hardware are more reliable, therefore software
errors are often the biggest threat to database system
availability. For performance, special purpose application code
is being integrated with database system code. Databases
allow users to add new data types to the database engine.
Performance-critical software may require the performance
that can achieved by accessing data directly that stored in a
main-memory 1. In both cases, due to complex and costlier
inter-process communication, direct access to database buffer
cache is critical to meet the performance required by these
Sponsored by SAP Labs India Pvt. Ltd.
applications. Therefore, availability of database can be affected
by software errors as well as errors in application programme.
Advantage database table repair utility reads table header to
detect errors in ADT file. Table header contains information
about table such as string identifier, table encryption, auto
encrypted value, memo files and so on. This information
is used to check correctness of ADT table and Advantage
Database Memo (ADM) file. This header value cross checked
against table record to identify corruption for example we can
calculate file length using table header and check that value
with actual file length.
II. REVIEW OF LITERATURE
Log 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 the
actual modification and stored on a stable storage media,
which is failsafe. If a transaction crashes, then the recovery
manager may undo transactions i.e. reverse the operations of
a transaction. This involves examining a transaction for the
log entry write item(T, x, old value, new value) and setting
the value of item x in the database to old-value.There are
two major techniques for recovery from transaction failures:
deferred updates and immediate updates.
Deferred updates 15 : This technique does not physically
update the database on disk until a transaction has reached its
commit point. Before reaching commit, all transaction updates
are recorded in the local transaction workspace. If a transaction
fails before reaching its commit point, it will not have changed
the database in any way so UNDO is not needed. It may
be necessary to REDO the effect of the operations that are
recorded in the local transaction workspace, because their
effect may not yet have been written in the database. Hence, a
deferred update is also known as the No-undo/redo algorithm.
Immediate updates 15 : In the immediate update, the
database may be updated by some operations of a transaction
before the transaction reaches its commit point. However,
these operations are recorded in a log on disk before they
are applied to the database, making recovery still possible. If a
transaction reaches its commit point, the effect of its operation
must be undone i.e. the transaction must be rolled back hence
we require both undo and redo. This technique is known as
Shadow Paging 14, 15 : Shadow paging is an alternative
to log-based recovery techniques, which has both advantages
and disadvantages. It may require fewer disk accesses, but
it is hard to extend paging to allow multiple concurrent
transactions. The paging is very similar to paging schemes
used by the operating system for memory management.
The idea is to maintain two page tables during the life of
a transaction: the current page table and the shadow page
table. When the transaction starts, both tables are identical.
The shadow page is never changed during the life of the
transaction. The current page is updated with each write
operation. Each table entry points to a page on the disk.
When the transaction is committed, the shadow page entry
becomes a copy of the current page table entry and the
disk block with the old data is released. If the shadow is
stored in nonvolatile memory and a system crash occurs, then
the shadow page table is copied to the current page table.
This guarantees that the shadow page table will point to the
database pages corresponding to the state of the database prior
to any transaction that was active at the time of the crash,
making aborts automatic.
Recovery With Concurrent Transaction3 : Regardless of
the number of concurrent transactions, the disk has only one
single disk buffer and one single log. These are shared by all
transactions. The buffer blocks are shared by a transactions.
We allow immediate updates, and permit a buffer block to
have data items updated by one or more transactions.When
more than one transaction are being executed in parallel, the
logs are interleaved. At the time of recovery, it would become
hard for the recovery system to backtrack all logs, and then
start recovering. To ease this situation, most modern DBMS
use the concept of ‘checkpoints’.
Before Image Table(BI table)4 : Deleted data, generally
named as before image, can be found in almost all modern
DBMSs in various forms.BI table is a kind of table transparent
to users. Each BI table is bound with a base table in database.
It has the same structure as its relevant base table except that
it has no integrity constraints. Rows deleted from a base table
are inserted into its BI table automatically. This can be simply
realized with a trigger. When a row in a base table is deleted
or updated, the trigger will be invoked and the rows old value
will be inserted into the tables BI table.
BI tables may induce data redundancy because there will
exist double before image in the system. However, it must
be pointed out that the traditional before image is transitory,
while data in BI tables will be long-standing until they are
confirmed out of date.
III. SYSTEM ARCHITECTURE
Repair utility scans a given directory for ADT files and
performs a number of checks for corruption or bad data. It
reports all findings to a log file and displays a ‘VALID’ tag
for each correct file in the directory. If you decide to fix the
invalid files, it asks you if you’d like to backup the original
ADT and ADM files. It then performs the same checks and
fixes problems whenever possible.
Fig. 1. System Architecture
Encrypted tables require the table password in order to
be analyzed by repair utility. If no password or an incorrect
password is supplied, repair utility displays the table name
along with ‘ENCRYPTED’ showing it was unable to analyze
IV. SYSTEM ANALYSIS
A. Table header
Below is structure of ADT table header with some of its
field. Total size of table header is 400 bytes.
ADVANTAGE DATABASE TABLE HEADER
Size Data Type Description
Identifies table as an Advantage table,
e.g. “Advantage Table”
4 UINT32 Table structure version.
8 UINT64 Number of records in the table
First record position (IOW, the
4 UINT32 Record width
Record number of first deleted record in
our deleted record linked list
8 UINT64 Number of records marked for deletion.
Encrypted encryption password
associated with this table
Options information. Bits set for:
1) Contains memo file,
2) Has auto-increment field,
3) Table is encrypted
40 Reserved for future use
B. Record header
Record Header is 5 bytes.
• 4 extra bytes
• 1 byte for option information
– Record encrypted
– Record updated within a transaction
– Record appended within a transaction
C. What and how to fix ADT file
• Incorrect file size : check physical file size with calculated
file size using table header .
Following is formula to calculate file size using table
fsize = (rlength?no.ofrecords)+headerlength (1)
fsize = filesize
rlength = record length
• Record is encrypted but table is not encrypted : Even
though it is possible to encrypt some records and not
others, it is usually corruption in the record header rather
than intentional. With this option enabled, repair utility
will 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 complete
• Incorrect record count: Repair utility will reset the record
count in the ADT header to reflect the current record
Repair utility finds maximum auto increment value and
row version value by scanning each record and compare
that value with header auto increment and row version
value. if mismatch found then repair utility update header
value by actual max auto and max row version value
which got from records.
• Corruption associated with memo files :
Memo block overlapping If repair utility finds multiple
records in the ADT that have memo fields pointing to the
same memo data blocks in the ADM, it will make a copy
of one of the memos to avoid the overlap.
Corruption in the free block list ADM files keep a
list of allocated but unused blocks for memo data. If
repair utility finds freelist entries with bad or overlapping
pointers it will clear them.
Invalid memo pointers (past EOF, before BOF, in ADM
header) ADT records with bad memo pointers will be
reset to zero (no data).
Orphaned memo blocks Blocks in the ADM allocated but
not referenced by any records will be reported to the log,
but not modified.
Database system is an important part of computer system
that is used to store data. When failure occurs, information
stored in database is lost and database becomes inconsistent.
Recovery scheme is an essential part of a database system
which can restore the database to the consistent state that
existed before the failure.
The system i.e. repair utility will be helpful to detect and
fix that errors using table header and record header.
Abstract—Advantage Database Server (ADS) is a high performance,