Help..need to repair corrupted db!

comp.databases.gupta (1995-2015)
straig...

Help..need to repair corrupted db!

Post by straig... » 19 May 2005, 10:15

 Posted by:  straig...@gmail.com 

Hi,

Maybe a long shot posting here, but I am looking for some help in
repairing a corrupted database in SQLBASE server.

We have no good backup of the database, it looks as if it has been
corrupted for quite a while. Our application which uses this DB still
works, although it is running into problems all the time, and is a key
application in our business.

I first tried reorganizing the database which didn't work. I scrapped
the dbs file as it was now no good and took back in a backup. I tried a
segmented unload of the database using a control file, it gets so far
(produced about 2.5gb of unload data, the db itself is just under 2gb)
and then throws the error 00703 Fatal SQLBASE system failure (VIO IPN)

If I try an UPDATE STATISTICS I get the same error. If I try a check
database I get CHECK Failure (ROW BEN) Corrupted row page for table
DB.MY_TABLE

Everything I have read tells me to unload as much as I can, drop the
bad row and recreate the database and populate with the unloaded data.
There are two problems, 1. I don't know the schema of the database, how
can I view this at a glance? 2. I am pretty much a newbie to SQL so I
need exact commands :D

Thanks in advance for any help!

Oliver

Re: Help..need to repair corrupted db!

Post by Oliver » 19 May 2005, 21:45

 Posted by:  Oliver <oli...@demus-online.de> 

Hi,
had once a similar problem, but it worked just fine, to export the
database in a textfile (SQL-Statements) and import it in a new DB File.

Oliver

CONP

Re: Help..need to repair corrupted db!

Post by CONP » 14 Jul 2005, 04:55

 Posted by:  CONP <co...@ihug.com.au> 

If you can connect to the database, then it isn't entirely corrupt which is a good thing
try the command
UNLOAD DATABASE C:DATABASE.SQL;
Open the DATABASE.SQL file in SQL Talk and load each table one by one.
If the DATABASE.SQL file is too large, then you can unload each table one by one

The command below will display all your created databases.
SELECT DISTINCT TBNAME FROM SYSCOLUMNS WHERE TBNAME NOT LIKE 'SYS%';

Insert each table name into the line below and execute
UNLOAD DATA SQL <table name>.SQL <table name>;

The command below will create a file that will load all the tables into a new database
UNLOAD SCHEMA C:SCHEMA.SQL;

Create a new blank database, run the SCHEMA.SQL file and then run each <table name>.sql one by one until you get an error in one of
the files
Use the LOAD SQL <table name>.sql; command
Once an error has occurred, open the SQL file and check for corrupt data and remove it and run it again. If it still occurs, check
how many values have been inserted and go to that line number in the SQL file name
So if 500 rows have been inserted, go to the 501st row of the SQL file and see if that's corrupt and remove it. Keep doing this
until you complete the LOAD for that table successfully. Then repeat for each table.

Good Luck

Return to “comp.databases.gupta”

Who is online

Users browsing this forum: [Ccbot] and 0 guests