Link to home
Start Free TrialLog in
Avatar of Scorelli
Scorelli

asked on

Is there a Sybase database repair tool?

I have a One Write Plus database that I am performing a forensic examination of.  It is obviously corrupted, and by googling some of the system sql language I'm fairly confident it is a sybase database.  I don't know much about sybase, so I need assistance in setting up an ODBC connection to this database.  It is possible it is password protected internally, but I won't know until I try, right?
Avatar of Joe Woodhouse
Joe Woodhouse

We'd need to know more - Sybase has three major database products and the rules are quite different between them...

Any chance you can find out more from the source? Ideally we'd want the version as well as the product.

Broadly speaking, there aren't any separate Sybase repair tools; the three main Sybase database products all ship with *some* repair functionality built in.

I say "some" because there is no guarantee they'll be able to fix any problems - mostly they're intended to warn of problems early.

The repair functions would depend on which Sybase product and version...
Avatar of Scorelli

ASKER

I googled the following query which I extracted from within the %database%.db file.  
 
"create view SYS.SYSCATALOG(creator,tname,dbspacename,tabletype,ncols,
primary_key,"check",remarks)as select(select user_name from SYS.SYSUSERPERM
where user_id=SYSTABLE.creator),table_name,(select dbspace_name from SYS.
SYSFILE where file_id=SYSTABLE.file"

and this was the result:
http://manuals.sybase.com/onlinebooks/group-pbarc/conn5/sqlug/@Generic__BookTextView/71355;pt=28076/*

I am not sure what version I am dealing with but here is a possibly interesting tidbit from the header of the file.  This software is circa 1998-2000, so I don't know how menaingful this is:
"Copyright (c) 1987, 1993 WATCOM International Corp."
The tables in the SQL and the header confirm is it Sybase Adaptive Server Anywhere, their small footprint product. Hard to tell what version it is from the information available.

It was designed to be minimal-maintenance and not require a DBA... but this in turn means many of the tricks a DBA might expect to work don't work here.

I'm not aware of any repair tool for ASA. Mostly it relies on a validation tool to confirm all was well, and backups if something breaks.

Since that won't do you any good, the only other supported method was to start the database (so you would need the ASA software of an appropriate vintage to run this .DB file), and do a physical unload and then rebuild of the database in an attempt to salvage the usable data. You *must* have the database engine and software to do this, this is useless against a lone .DB file. You will only be able to unload tables that are fully healthy. The only technique that seems to be available for databases with corruption in them is to (again, with the database up and running in the appropriate engine) attempt piece by piece unload of table data to file, perhaps forcing various indexes (or no index) in an attempt to bypass the corruption.

Suspect you're out of luck. Suggest you contact Sybase Tech Support (who will want you to pay in the absence of a maintenance agreement) and see if they have any undocumented tricks they can share with you. However I've just done a case search of Sybase cases for "ASA corruption" and I'm not seeing any magic tricks mentioned...

Sorry this isn't the answer you want. In some ways ASA is like the Apple Mac of Sybase databases - the upside is there is usually nothing you *need* to do to maintain it, but the downside is there is usually nothing you *can* do to maintain it.
Do you know where I can get my hands on the engine of proper vintage? I'd like to try this just so I can tell my client I tried everything....will the engine allow me to add records to a table?  I may want, using a forensic approach, to be able to determine what a record looks like, the encoding method, etc so that I can scour the unallocated clusters for orphaned records. To do that I would need to create a record and then examine a resultant file.
ASKER CERTIFIED SOLUTION
Avatar of Joe Woodhouse
Joe Woodhouse

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial