dbTalk Databases Forums  

Sybase 9 - issues salvaging data from a corrupted table (assertion failed)

sybase.public.sqlanywhere.general sybase.public.sqlanywhere.general


Discuss Sybase 9 - issues salvaging data from a corrupted table (assertion failed) in the sybase.public.sqlanywhere.general forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
SybaseInvestigator
 
Posts: n/a

Default Sybase 9 - issues salvaging data from a corrupted table (assertion failed) - 11-15-2007 , 07:19 AM






Hey guys!

I am working on a sybase 9.0.2.3137 database which is working but keeps
giving errors during validation. I know that the database is corrupted so i
attempted to perform an unload/reload on the database by skipping the
corrupted table. I tried to salvage the data from my corrupted table using
"order by" on the column "transactiontime" which is basically my primary key
and i keep getting assertion failed errors.

EACH time i tried to use ORDER BY statement on my transactiontime table (to
be able to find between which dates the corruption is) i am getting an
assertion failed error saying:

"Error at line 1
Internal database error ***ERROR*** Assertion failed: 200707 (9.0.2.3137)
Invalid table page encountered during a table scan (table id 476, page
0x31c1) -- transaction rolled back"

Since i cant salvage the data using that ORDER BY statement, i decided to
fetch my information for each day since Feb 2007. If i do the following
command: "select * from tblcorruptedtable where transactiontime = date for
each day", i am able to get the data but sometimes i will get the assertion
failed error whatever date i use (i even tried more recent months). What is
even more weird, is that i will run the same command twice on the same day
and one time it will work, another time it will give me the assertion failed
error.

Is there anyway of recovering the data from that table or will i be stuck
dropping the table and restarting it without any data?

Thanks a lot!



Reply With Quote
  #2  
Old   
 
Posts: n/a

Default Re: Sybase 9 - issues salvaging data from a corrupted table (assertion failed) - 11-15-2007 , 07:30 AM






In article <473c474b@forums-1-dub>, noemail (AT) noemail (DOT) com says...
Quote:
Hey guys!

I am working on a sybase 9.0.2.3137 database which is working but keeps
giving errors during validation. I know that the database is corrupted so i
attempted to perform an unload/reload on the database by skipping the
corrupted table. I tried to salvage the data from my corrupted table using
"order by" on the column "transactiontime" which is basically my primary key
and i keep getting assertion failed errors.

EACH time i tried to use ORDER BY statement on my transactiontime table (to
be able to find between which dates the corruption is) i am getting an
assertion failed error saying:

"Error at line 1
Internal database error ***ERROR*** Assertion failed: 200707 (9.0.2.3137)
Invalid table page encountered during a table scan (table id 476, page
0x31c1) -- transaction rolled back"

Since i cant salvage the data using that ORDER BY statement, i decided to
fetch my information for each day since Feb 2007. If i do the following
command: "select * from tblcorruptedtable where transactiontime = date for
each day", i am able to get the data but sometimes i will get the assertion
failed error whatever date i use (i even tried more recent months). What is
even more weird, is that i will run the same command twice on the same day
and one time it will work, another time it will give me the assertion failed
error.

Is there anyway of recovering the data from that table or will i be stuck
dropping the table and restarting it without any data?
Did you try just exporting its data with no ORDER BY or WHERE clause?
I.E. just "SELECT * FROM mytable OUTPUT TO..."

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).


Reply With Quote
  #3  
Old   
Mark Culp
 
Posts: n/a

Default Re: Sybase 9 - issues salvaging data from a corrupted table (assertionfailed) - 11-15-2007 , 08:36 AM



If you have a complete (set of) transaction log(s) from the time that the
database was created, or from the time of a good backup, then you could
create a new database (or start with the good back), dbtran the log, and
apply the resultant sql script to the new (or backup) database.
This will restore all of your data.
--
Mark Culp
SQLAnywhere Research and Development
iAnywhere Solutions Engineering
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------
SybaseInvestigator wrote:
Quote:
Hey guys!

I am working on a sybase 9.0.2.3137 database which is working but keeps
giving errors during validation. I know that the database is corrupted so i
attempted to perform an unload/reload on the database by skipping the
corrupted table. I tried to salvage the data from my corrupted table using
"order by" on the column "transactiontime" which is basically my primary key
and i keep getting assertion failed errors.

EACH time i tried to use ORDER BY statement on my transactiontime table (to
be able to find between which dates the corruption is) i am getting an
assertion failed error saying:

"Error at line 1
Internal database error ***ERROR*** Assertion failed: 200707 (9.0.2.3137)
Invalid table page encountered during a table scan (table id 476, page
0x31c1) -- transaction rolled back"

Since i cant salvage the data using that ORDER BY statement, i decided to
fetch my information for each day since Feb 2007. If i do the following
command: "select * from tblcorruptedtable where transactiontime = date for
each day", i am able to get the data but sometimes i will get the assertion
failed error whatever date i use (i even tried more recent months). What is
even more weird, is that i will run the same command twice on the same day
and one time it will work, another time it will give me the assertion failed
error.

Is there anyway of recovering the data from that table or will i be stuck
dropping the table and restarting it without any data?

Thanks a lot!

Reply With Quote
  #4  
Old   
SybaseInvestigator
 
Posts: n/a

Default Re: Sybase 9 - issues salvaging data from a corrupted table (assertion failed) - 11-15-2007 , 09:05 AM




<ns_dkerber (AT) ns_WarrenRogersAssociates (DOT) com> wrote

Quote:
In article <473c474b@forums-1-dub>, noemail (AT) noemail (DOT) com says...
Hey guys!

I am working on a sybase 9.0.2.3137 database which is working but keeps
giving errors during validation. I know that the database is corrupted so
i
attempted to perform an unload/reload on the database by skipping the
corrupted table. I tried to salvage the data from my corrupted table
using
"order by" on the column "transactiontime" which is basically my primary
key
and i keep getting assertion failed errors.

EACH time i tried to use ORDER BY statement on my transactiontime table
(to
be able to find between which dates the corruption is) i am getting an
assertion failed error saying:

"Error at line 1
Internal database error ***ERROR*** Assertion failed: 200707 (9.0.2.3137)
Invalid table page encountered during a table scan (table id 476, page
0x31c1) -- transaction rolled back"

Since i cant salvage the data using that ORDER BY statement, i decided to
fetch my information for each day since Feb 2007. If i do the following
command: "select * from tblcorruptedtable where transactiontime = date
for
each day", i am able to get the data but sometimes i will get the
assertion
failed error whatever date i use (i even tried more recent months). What
is
even more weird, is that i will run the same command twice on the same
day
and one time it will work, another time it will give me the assertion
failed
error.

Is there anyway of recovering the data from that table or will i be stuck
dropping the table and restarting it without any data?

Did you try just exporting its data with no ORDER BY or WHERE clause?
I.E. just "SELECT * FROM mytable OUTPUT TO..."

--
Remove the ns_ from if replying by e-mail (but keep posts in the
newsgroups if possible).
Hi, thanks for the quick reply!

Yes i actually tried to export the data to a text file without using the
order by / where statements and at some point during the export it will
crash with the assertion failed error.

After getting the error i checked the data in the exported file (which was
only 18 MB big and it should have been around 200 MB) and i wasnt able to
determine the corrupted dates because i was able to see data from the start
date and up to today in the file. So it means that the corruption seems to
be scattered a lot in that database table.







Reply With Quote
  #5  
Old   
SybaseInvestigator
 
Posts: n/a

Default Re: Sybase 9 - issues salvaging data from a corrupted table (assertion failed) - 11-15-2007 , 09:27 AM



Hi Mark,

Thanks for the reply.

Unfortunately i do not have good old backups and old transaction logs as the
issue was occuring for a couple of weeks before i was notified.


"Mark Culp" <reply_to_newsgroups_only_please_nospam_mark.cul p (AT) iAnywhere (DOT) com>
wrote in message news:473C594F.80F1C4F4 (AT) iAnywhere (DOT) com...
Quote:
If you have a complete (set of) transaction log(s) from the time that the
database was created, or from the time of a good backup, then you could
create a new database (or start with the good back), dbtran the log, and
apply the resultant sql script to the new (or backup) database.
This will restore all of your data.
--
Mark Culp
SQLAnywhere Research and Development
iAnywhere Solutions Engineering
-------------------------------------------------------------------------
** Whitepapers, TechDocs, bug fixes are all available through the **
** iAnywhere Developer Community at http://www.ianywhere.com/developer **
-------------------------------------------------------------------------
SybaseInvestigator wrote:

Hey guys!

I am working on a sybase 9.0.2.3137 database which is working but keeps
giving errors during validation. I know that the database is corrupted so
i
attempted to perform an unload/reload on the database by skipping the
corrupted table. I tried to salvage the data from my corrupted table
using
"order by" on the column "transactiontime" which is basically my primary
key
and i keep getting assertion failed errors.

EACH time i tried to use ORDER BY statement on my transactiontime table
(to
be able to find between which dates the corruption is) i am getting an
assertion failed error saying:

"Error at line 1
Internal database error ***ERROR*** Assertion failed: 200707 (9.0.2.3137)
Invalid table page encountered during a table scan (table id 476, page
0x31c1) -- transaction rolled back"

Since i cant salvage the data using that ORDER BY statement, i decided to
fetch my information for each day since Feb 2007. If i do the following
command: "select * from tblcorruptedtable where transactiontime = date
for
each day", i am able to get the data but sometimes i will get the
assertion
failed error whatever date i use (i even tried more recent months). What
is
even more weird, is that i will run the same command twice on the same
day
and one time it will work, another time it will give me the assertion
failed
error.

Is there anyway of recovering the data from that table or will i be stuck
dropping the table and restarting it without any data?

Thanks a lot!



Reply With Quote
  #6  
Old   
Jeff Albion (iAnywhere Solutions)
 
Posts: n/a

Default Re: Sybase 9 - issues salvaging data from a corrupted table (assertionfailed) - 11-15-2007 , 10:56 AM



If you have attempted to select around your data using a variety of
indexes and table scans (SELECT * FROM...), but still cannot access all
of the data (as per the instructions at:
http://www.ianywhere.com/developer/t...upt_pages.html
), you have two options:

1) Move forward and attempt to restore the data from other sources (hard
copies, etc.)

2) Open a case with Technical Support and request a salvage. The salvage
service is an additional cost on top of the case cost (if you do not
already have a support plan), and is billed at $360USD/hr, with a 1 hour
minimum commitment. The salvage engagement does not come with any
guarantees, but our engineers may be able to recover data from the
"middle" of the corruption that you may not be able to do with simple
SELECT statements.

-----

This is also an excellent time to review your backup and recovery
procedures. See: http://www.ianywhere.com/whitepapers/ASA_backup.html

A "typical" backup scenario involves frequent backups that perform the
following steps:

- Backup the database (using the dbbackup utility or the "BACKUP
DATABASE" SQL command)
- Make a copy of the back up to another file
- Start the backup copy on a separate server process
- Run dbvalidate on the backup copy
- Throw away the copy and keep the original backup

Regards,

SybaseInvestigator wrote:
Quote:
Hi, thanks for the quick reply!

Yes i actually tried to export the data to a text file without using the
order by / where statements and at some point during the export it will
crash with the assertion failed error.

After getting the error i checked the data in the exported file (which was
only 18 MB big and it should have been around 200 MB) and i wasnt able to
determine the corrupted dates because i was able to see data from the start
date and up to today in the file. So it means that the corruption seems to
be scattered a lot in that database table.

--
Jeff Albion, Product Support Analyst
iAnywhere Solutions

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0


Reply With Quote
  #7  
Old   
SybaseInvestigator
 
Posts: n/a

Default Re: Sybase 9 - issues salvaging data from a corrupted table (assertion failed) - 11-15-2007 , 12:07 PM



Thank you very much for your help Jeff!


"Jeff Albion (iAnywhere Solutions)" <firstname.lastname (AT) ianywhere (DOT) com> wrote
in message news:473c7a35 (AT) forums-1-dub (DOT) ..
Quote:
If you have attempted to select around your data using a variety of
indexes and table scans (SELECT * FROM...), but still cannot access all of
the data (as per the instructions at:
http://www.ianywhere.com/developer/t...upt_pages.html )
, you have two options:

1) Move forward and attempt to restore the data from other sources (hard
copies, etc.)

2) Open a case with Technical Support and request a salvage. The salvage
service is an additional cost on top of the case cost (if you do not
already have a support plan), and is billed at $360USD/hr, with a 1 hour
minimum commitment. The salvage engagement does not come with any
guarantees, but our engineers may be able to recover data from the
"middle" of the corruption that you may not be able to do with simple
SELECT statements.

-----

This is also an excellent time to review your backup and recovery
procedures. See: http://www.ianywhere.com/whitepapers/ASA_backup.html

A "typical" backup scenario involves frequent backups that perform the
following steps:

- Backup the database (using the dbbackup utility or the "BACKUP DATABASE"
SQL command)
- Make a copy of the back up to another file
- Start the backup copy on a separate server process
- Run dbvalidate on the backup copy
- Throw away the copy and keep the original backup

Regards,

SybaseInvestigator wrote:

Hi, thanks for the quick reply!

Yes i actually tried to export the data to a text file without using the
order by / where statements and at some point during the export it will
crash with the assertion failed error.

After getting the error i checked the data in the exported file (which
was only 18 MB big and it should have been around 200 MB) and i wasnt
able to determine the corrupted dates because i was able to see data from
the start date and up to today in the file. So it means that the
corruption seems to be scattered a lot in that database table.


--
Jeff Albion, Product Support Analyst
iAnywhere Solutions

iAnywhere Developer Community : http://www.ianywhere.com/developer
iAnywhere Documentation :
http://www.ianywhere.com/developer/product_manuals
ASA Patches and EBFs :
http://downloads.sybase.com/swd/summ...&timeframe =0



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.