on 2017 Aug 23 7:43 AM
We have an old ASA9 database that has been corrupted, but from which we need to salvage as much as possible. Following the manual at Rebuilding a version 9 or earlier database with the Unload utility (dbunload), we get:
SQL Anywhere Unload Utility Version 17.0.4.2053
Connecting and initializing
***** SQL error: Internal database error *** ERROR *** Assertion failed: 201418 (9.0.2.3961)
Row (0x38c:0x7) has an invalid offset -- transaction rolled back
Unfortunately, we have only this .db
file (there do not appear to be any backups or transaction log files).
Check out Stellar Phoenix Repair for SQL Anywhere.
Also check out this "first glance" blog post ( thanks for remembering, Vlad! 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for this suggestion, which initially seemed to be extremely promising. Sadly, after scanning the database it reports that there are 0 tables/views/indexes/triggers within it (which is evidently nonsense as I can connect to SQL Anywhere and query dozens of tables without problem); I've called Stellar for support, but they say there's nothing more they can do.
If you can start the database with dbsrv9.exe, and connect to it with dbisql, you may be able to execute individual UNLOAD TABLE statements to extract the data from all but the one failing table.
"%ASANY9%\\win32\\dbspawn.exe"^ -f^ "%ASANY9%\\win32\\dbsrv9.exe"^ -c 100M^ -o dbeng9_log_ddd9.txt^ -os 10M^ -x none^ -zl^ -zp^ -zt^ ddd9.db "%ASANY9%\\win32\\dbisql.exe"^ -c "ENG=ddd9;DBN=ddd9;UID=dba;PWD=sql;CON=ddd9-1" UNLOAD TABLE t TO 'C:\\\\TEMP\\\\t.dta';
If you care about the failing table ( maybe you don't :), you may be able unload some of it using trial and error.
UNLOAD SELECT * FROM t WHERE pkey < 10000 TO 'C:\\\\TEMP\\\\t.dta';
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Breck, I forgot the software that you tested. Do you remember there was an application that you ran against your Foxhound database and it was able to read your tables? What was the name, I am too lazy to google today 🙂
p.s. my browser has corrected your name 😞
Without a backup or transaction log it will be difficult to recover all of your data.
Answers to your specific questions:
HTH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alas, the problem as described in the question arose when using dbunload (and indeed with the -u flag). I wonder how the Stellar product suggested by Breck was built without an understanding of the underlying format (perhaps they got access to such information through a separate licence agreement). And unfortunately, we do not have a support contract...
Yes, this is expected when you have corruption in a table. The intent is that you would attempt to unload the table that has corruption (using dbunload or the UNLOAD SQL statement) and that would give you at least some of the table contents. There is no easy way of recovering the row(s) on the page that has the corruption.
If the index is not corrupted, you can also try to craft a SQL statement that uses the UNLOAD statement ordered by the primary key (or some other index) in ASC and then DESC order. This will give you all - or most - of the rows from the table before and after the corruption (assuming there is only one page in the database that is corrupted). If there are more than one page corrupted then restricting the index range may allow you to extract more rows fro the table.
HTH
User | Count |
---|---|
81 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.