Database Corruption And Prevention



Similar documents
ENSURING DATABASE RELIABILITY ON YOUR NETWORK

How to Plan for Disaster Recovery

Network Client. Troubleshooting Guide FREQUENTLY ASKED QUESTIONS

Resolving network file speed & lockup problems

ScoMIS Encryption Service

Backups and Maintenance

Installation Guide for Workstations

Understanding Backup and Recovery Methods

AutoDownload: SQL Server and Network Trouble Shooting

Server & Workstation Installation of Client Profiles for Windows

VirtualCenter Database Maintenance VirtualCenter 2.0.x and Microsoft SQL Server

AKCess Pro Server Backup & Restore Manual

2. Empty the Recycle Bin. Some users need to be reminded to periodically empty the Recycle Bin.

Hosting Users Guide 2011

Snow Inventory. Installing and Evaluating

Net Protector Admin Console

ScoMIS Encryption Service

Windows Operating Systems. Basic Security

McAfee.com Personal Firewall

How To Backup A Database In Navision

Working with SQL Server Agent Jobs

CribMaster Database and Client Requirements

Reboot the ExtraHop System and Test Hardware with the Rescue USB Flash Drive

Network Storage Link

Before you install ProSeries software for network use

Out n About! for Outlook Electronic In/Out Status Board. Administrators Guide. Version 3.x

Introduction 1-1 Installing FAS 500 Asset Accounting the First Time 2-1 Installing FAS 500 Asset Accounting: Upgrading from a Prior Version 3-1

SOS Suite Installation Guide

Basics of Preventive Maintenance and Troubleshooting DRAFT

Contents. Getting Started...1. Managing Your Drives Backing Up & Restoring Folders Synchronizing Folders Managing Security...

Applies to: F1PG200ENau Belkin Analogue Telephone Adapter (ATA) Firmware release notes

Printer Performance and Troubleshooting Printers

Operating Instructions

Chapter 8 Router and Network Management

Dual HD Giganet NAS Enclosure User s Manual

3.5 EXTERNAL NETWORK HDD. User s Manual

PLEASE NOTE: The client data used in these manuals is purely fictional.

PHILIPS ie33/iu22 HARD DRIVE BACKUP

Honeywell Internet Connection Module

Using Continuous Operations Mode for Proper Backups

2014 Electrical Server Installation Guide

CA ARCserve and CA XOsoft r12.5 Best Practices for protecting Microsoft SQL Server

Understanding offline files

Chapter 6 Using Network Monitoring Tools

Licensing for BarTender s Automation Editions

Workflow Templates Library

A+ Guide to Software: Managing, Maintaining, and Troubleshooting, 5e. Chapter 3 Installing Windows

7.x Upgrade Instructions Software Pursuits, Inc.

Moving the Web Security Log Database

HYPERION SYSTEM 9 N-TIER INSTALLATION GUIDE MASTER DATA MANAGEMENT RELEASE 9.2

CLICK HERE TO ACCESS AN UP-TO-DATE ONLINE VERSION

PaperClip32. Installation Guide. for Workgroup and Enterprise Editions. Document Revision 2.1 1

Technology Announcement - SQL Server Database Transition

Install MS SQL Server 2012 Express Edition

Windows Small Business Server 2003 Upgrade Best Practices

Hands-On Microsoft Windows Server Chapter 12 Managing System Reliability and Availability

Networking Best Practices Guide. Version 6.5

Maintenance Guide. Outpost Firewall 4.0. Personal Firewall Software from. Agnitum

for Networks Installation Guide for the application on the server July 2014 (GUIDE 2) Lucid Rapid Version 6.05-N and later

for Networks Installation Guide for the application on the server August 2014 (GUIDE 2) Lucid Exact Version 1.7-N and later

QACenter Installation and Configuration Guide. Release 4.4.2

Maintaining the Content Server

4 Backing Up and Restoring System Software

GE Healthcare Life Sciences UNICORN Administration and Technical Manual

Step-by-Step Guide to Securing Windows XP Professional with Service Pack 2 in Small and Medium Businesses

Sage ERP MAS 90 Sage ERP MAS 200 Sage ERP MAS 200 SQL. Installation and System Administrator's Guide 4MASIN450-08

Moving the TRITON Reporting Databases

Sage 100 ERP. Installation and System Administrator s Guide

Remote Administration of Windows Servers Using Remote Desktop for Administration

FAQ - Frequently Asked Questions Sections of Questions

Senomix Timesheets for Mac OS X

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 16 Fixing Windows Problems

EUCIP IT Administrator - Module 2 Operating Systems Syllabus Version 3.0

Novell ZENworks Asset Management

JAMF Software Server Installation Guide for Windows. Version 8.6

Updated: May Copyright DBA Software Inc. All rights reserved. 2 Getting Started Guide

Samsung Auto Backup User Manual

Nortel Networks Call Center Reporting Set Up and Operation Guide

ADMINISTRATOR S GUIDE

Chapter 6 Using Network Monitoring Tools

for Networks Installation Guide for the application on a server September 2015 (GUIDE 2) Memory Booster version 1.3-N and later

Upgrade to Webtrends Analytics 8.7: Best Practices

Daylite Server Admin Guide (Dec 09, 2011)

IBM Rapid Restore PC powered by Xpoint - v2.02 (build 6015a)

Five Reasons Your Business Needs Network Monitoring

View CPU, Memory, Disk, and Network Usage in Activity Monitor.

FILE TRANSFER PROTOCOL (FTP) SITE

Deploying Windows Streaming Media Servers NLB Cluster and metasan

Updated: April Copyright DBA Software Inc. All rights reserved. 2 Getting Started Guide

Upgrading MySQL from 32-bit to 64-bit

Reporting works by connecting reporting tools directly to the database and retrieving stored information from the database.

MFR IT Technical Guides

Spector 360 Deployment Guide. Version 7.3 January 3, 2012

Understanding MS Access Security

Transcription:

Database Corruption And Prevention Micheal Fernando IT SHASTRA (INDIA) PVT. LTD. 106, Bldg 2, Sector-1, Millennium Business Park, Mahape, Navi Mumbai 400 701. INDIA Phone: 91-22-2778 1021 / 1022 Web Site : http://www.itshastra.com/ Email : info@itshastra.com

Introduction Anyone working with database some or the other time faces problem of database corruption. The Database corruption can result in major downtime if not handled properly and proper care is not taken to fix it. While developers typically use more advanced database tools for large projects, Microsoft Access has always been developer choice for Small database Application and also serves as a back-end data store by some third-party products. This article looks for actions to prevent corruption. Access is a file system relational database, storing every part of the database tables, queries, forms, reports, etc. inside one MDB file. It s very rare to see corruption on a local database, where a single copy of the MDB file is stored on the hard disk and only worked on from that machine. This solution is unacceptable, however, because data applications are most effective only if they can be shared over a network. You ll most often find Access being put to work in a multi-user environment. Database Engine A database engine is the underlying component that a Database Management System (DBMS) uses to create, retrieve, update and delete (CRUD) data from a database. Requests can send to the database engine via the DBMS's own user interface, and sometimes through a network port. About Jet Engine The default database engine underlying Microsoft Access is known as the Jet Engine. Using the appropriate Jet database, which corresponds to your version of the Access Jet Engine helps to maintain the stability of your databases. Each version of the Jet Engine uses a different method of writing to databases. Jet Engines are not backwards compatible so that older Jet Engines cannot perform read and write operations on newer Jet database file formats. When Jet begins a write operation, it sets a flag and then resets the flag when the operation is complete. If a write operation is interrupted, the flag remains set. The particular Jet database to be used with your version of Microsoft Access is as follows: Microsoft Access Version Jet Engine Recommended Jet Database Access 2.0 Jet 2.0 Jet 2.0 Access 95 Jet 3.0 Jet 3.0 Access 97 Jet 3.5 Jet 3.0 Access 2000 Jet 4.0 Jet 4.0 Access 2002 Jet 4.0 Jet 4.0 Access 2003 Jet 4.0 Jet 4.0 ITShastra White Papers, April 2006 Page 2 of 6 2006 IT Shastra (I) Pvt. Ltd.

Typical Causes of Database Corruption in Microsoft Access Database Is Suspect/Corrupted Because of Interrupted Write Operation if a database is open and is writing data & Access is incorrectly shut down, the Jet Database Engine may mark the file as suspect/corrupted. This can occur if the computer is manually turned off without first shutting down Windows or if power is lost. Other situations may not shut down Access but may still interfere with the writing of data to the disk by Jet while the database is open. This can occur, for example, when networks experience data collisions or when disk drives malfunction. If any of these interruptions occur, then Jet may mark the database as potentially corrupted. When Jet begins a write operation, it sets a flag and then resets the flag when the operation is complete. If a write operation is interrupted, the flag remains set. When you try to open that database again, Jet determines that the flag is set and then reports that the database is corrupted. In most cases, the data in the database is not actually corrupted, but the set flag alerts Jet that corruption may have occurred. In cases such as this, if you compact or repair, or do both, you can typically restore the database. Fortunately, there are ways to determine which user and which workstation is responsible for marking the file as suspect. Faulty Networking Hardware In this case, the file corruption does not involve the Jet Engine. Rather, the file is literally corrupted by some outside cause. The cause can be one or more links in the hardware chain between the computer that the database resides on and the computer that has the database open. This list includes, but is not limited to, network interface cards, network cabling, routers, and hubs. Hardware-based corruption is typically indicated by.mdb files that cannot be restored through the use of compacting, of repairing, or of Jetcomp. Hardware corruption typically occurs until the responsible hardware is repaired or is replaced. Opening and saving the.mdb File in Another Program There is no way to recover a.mdb file that is opened and then is saved from different program. For example, Microsoft Word permits you to open an Access database, and then to save it. (No purpose is served if you open a.mdb file in another application because all you see are extended characters.) Saving the file this way causes the.mdb file to prompt you for a database password when you try to open the file in Access. This occurs although the file may have never been password protected in Access. The password prompt occurs in such cases because the first byte range that Access checks when it opens a file is the location where the database password is. If that byte contains corrupted data, Access treats the file as password protected. Even if there was a way to get around the password prompt in this case, the database is still unrecoverable because the binary structure is scrambled and therefore unreadable to Access. You must recover a backup copy of the file as the only solution in this case. ITShastra White Papers, April 2006 Page 3 of 6 2006 IT Shastra (I) Pvt. Ltd.

Mismatched Versions of the Jet Database Engine If you run different versions of the Jet Database Engine in your environment, you can also cause corruption of an Access database. Different versions of Jet write to the database differently, and therefore can be the cause of corruption in a database. Other Reasons for the Corruption Too many users for the processing capability of the computer. Poor structuring of the software that interfaces with the database. Power outages. Not installing the proper or latest updates and services packs for the operating system and database software. Multiple users attempting to access and modify the same data at the same time. Using reserved words and reserved characters when naming database objects and fields Failure to periodically compact your database leads to fragmented data and indexes, unreliable table statistics and unpredictable queries Improperly disconnecting from a network If user leaves a connection to database open for Long Time Old network cables, overheating and over worked switches or hub, creaky old network cards and badly written device drivers Methods That Can Be Used to Prevent Corruption Avoid incorrect termination. Avoid incorrect termination of Microsoft Jet connections such as loss of power during database writes, manual shutdown, or allowing Task Manager to shut down the application.if power is lost during a database write, this can cause the database to be left in a suspect state. Avoid dropping network connections. Release All resources. When programming, close all DAO objects and ADO objects that you have open. Examples include Recordset, QueryDef, TableDef, and Database objects. Avoid for Fatal Errors. Fatal system errors almost always cause incorrect termination. If your database is prone to fatal errors, you must resolve the errors before the database becomes too damaged to open or to recover. Use the Compact and Repair utility regularly. Access files never get smaller, even if you delete data, until you compact them, and a larger file is a bigger target for packet loss and other causes of corruption over a network. If you have any data in your user s databases, set it to Compact On Close in the Options menu. If you ve split your data onto a separate back end, then compact it regularly. It s even possible to do this with VBA code, so you could set it to happen at a certain time, say midnight, if at all possible. No IPX use TCP/IP. Do not run IPX on a Windows NT-based Server where Jet databases are located across the network and the client is Microsoft Windows 95 with Internet Packet Exchange/Sequenced Packet Exchange (IPX/SPX). Instead, run TCP/IP on the Windows NTbased Server and a dual protocol stack of IPX and TCP/IP on the Win95 client. (Windows NT-to-Windows NT with IPX/SPX does not cause the problem, nor does Novell to any client.) Avoid continuous Open/Close. Avoid a large number of Open/Close Operations in a loop (40,000 successive open/close operations to over 1,000,000). Split your database. Rather than sticking every object your database uses in one massive ITShastra White Papers, April 2006 Page 4 of 6 2006 IT Shastra (I) Pvt. Ltd.

MDB file and sharing the whole thing over the network, split the database into two pieces: the front-end forms, reports, queries, and data access pages, and the back-end tables containing your data. Place a copy of your front-end database on the local hard disk of each machine and link back to the tables that are sitting on a fileserver. This means that far less data has to be dragged around the network and exposed to corruption. Your database will also run more quickly and will allow you to make design changes to the front end while still using live data. Take a close look at your virus-checking software. Any kind of TSR style real time virus checking can cause corruption in all kinds of files, Access more than any other. If you have a real-time monitor on your network, disable scanning of MDB files. Do remember though, MDB files are a good spot for virus writers looking to hide malicious code, so scan anything that comes into your network before letting it loose on your users. Don t leave the database open. Most backup software will back up Access databases even if they re open, so it s tempting to leave them that way. This only increases the possibilities of corruption, so get your users to close their applications, even over lunch hours Defragment your hard disk. MDB files often get quite big, and because they change in size so often, it s not unusual for them to be split into several hundred fragments. (I think 1,200 was my record, on a 60-MB MDB file.) This goes hand in hand with having a big-enough hard disk. Disks with little or no free space will become fragmented more quickly, and having less than 25 percent free space available on the drive will cause any defragmenter to work less efficiently. Upgrade to SR-1 of Access 2000. While Microsoft is very quiet on the subject of database corruption, it s just possible that it may happen less in SR-1. I don t have any proof, but it doesn t hurt and it may stop Access from crashing so often, which is a common cause of corruption. It s also worth downloading updates to the JET database engine. This is part of the Microsoft Data Access Components (MDAC) package, which is updated regularly and can be downloaded from Microsoft s Web site. Remember to close the connection. This may sound obvious (and I m sure you re all doing it anyway), but this is important if you use ADO or DAO to connect to an Access database. One little rs.close statement is all it takes, but without it, you ll get a database which is corrupted twice, three times, or even more each day! Methods to Fix Corruption Before sending your corrupt database to an Access Database Repair company you should first try following guidelines to fix the corruption yourself. Often the corruption level if treated immediately and correctly is only minor. If the corruption is left untreated then it is likely to worsen considerably in a short period of time. Backup the corrupt file as soon as possible. The repair utilities can sometimes have an adverse effect on treating the corruption if the corruption level is high. Therefore you should always ensure you have a backup of the corrupt file before trying to repair it. Delete.LDB file. When an Access database is opened by Access or the Jet database engine a new file with extension.ldb is created. This file is used for synchronizing multi-user file operations and is therefore not needed for repair purposes. If you cannot delete the.ldb file then it is highly likely that a user and/or program is still logged into the database. You should close all open instances of MsAccess.exe and also close any software that could be logged into the database. If you still cannot delete the.ldb file, try restarting the computer that the database is stored on. Use the built-in Access 'Compact & Repair' feature. Microsoft Access has a very useful ITShastra White Papers, April 2006 Page 5 of 6 2006 IT Shastra (I) Pvt. Ltd.

feature called 'Compact and Repair' accessible from the Tools/Database Utilities menu. Note: **You can access this menu option even when no database is loaded into Access, therefore if your database won't even open you can still try this method. ** Before Performing verify latest Service Packs are Installed. Use the Microsoft Jet Compact Utility. Microsoft have developed a utility called JetComp.exe which has been designed to try to correct minor corruption issues in Access databases. In our experience this is much more successful in repairing corruption than the built-in feature of Access. View more information about JetComp on Microsoft's Support web site: http://support.microsoft.com/kb/273956 Preventing corruption in future Backup your database regularly Compact your database regularly Switching to a Microsoft SQL server database will eliminate the database Corruption Problem entirely as SQL Server does not suffer from the same connection dropping as Microsoft Access JET Engine. References How to troubleshoot and repair a damaged Jet 4.0 database in Access 2000 = http://support.microsoft.com/kb/209137/ How to obtain the latest service pack for the Microsoft Jet 4.0 Database Engine = http://support.microsoft.com/kb/239114/#e04b0adaaa Database Corruption and Prevention - Database Solutions for Microsoft Access = http://www.databasedev.co.uk/corrupt-database.html Database Corruption: Why it happens and how to deal with it http://www.timetiger.com/databasecorruption.asp How To Open a Secured Access Database in ADO Through OLE DB http://support.microsoft.com/kb/191754/ Top 10 ways to prevent Access database corruption http://techrepublic.com.com/5100-10878_11-1060083.html The reasons behind Access corruption http://techrepublic.com.com/5100-10878_11-1060201.html Microsoft Database Repair Knowledge Base Articles http://www.datarevive.com/support/kb/kb2204.htm ITShastra White Papers, April 2006 Page 6 of 6 2006 IT Shastra (I) Pvt. Ltd.