|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How data are stored in FireBird's datapage?
It is known that actual data are stored in form of data records (structure "rhd") (or data record fragments, structure "rhdf") starting from bottom of FireBirds datapage (page of type 5), actually - they are stored in array:
"RHD->rhd_data" (or "RHDF->rhdf_data"). Well the question is - how those data can be retrieved in textual form? There can be at least two issues: 1) What about compression - what it means in this case, What algorithm/functions ("SQZ_decompress" from "sqz.cpp") can I use for decompression (maybe nice sample can be found in "dmp.cpp"); (well - it seems to me that this compression is something very different from e. g. password encryption in Firebird) 2) what about record format - maybe the ..._data corresponds to some format version, some relevant description in field "RDB$FORMATS.RDB$DESCRIPTOR" (for specified relatioon and format version). Is this descriptior necessary for converting "..._data" data array in textual form (as for use in SQL scripts)? How such a transformation can be done. Generally - is there any tool for extracting textual data directly from "*.fdb" file? Thanks for any idea in adavnce! ![]() |
|
#2
|
|||
|
|||
|
1) yes, compression and encryption are two different things
2) yes, rdb$descriptor is necessary x) what do you mean by "extracting textual data" ? Is IBSurgeon the tool you want ? ?) what are you trying to achieve at all ?? ![]() |
|
#3
|
|||
|
|||
|
thanks, indeed - IBSurgeon seems to be the tool that I need, I'll try it, however - I'm afraid - can it work against corrupted database file?
Well - actually I need this information for handling corrupted database file. About "textual data" - I meant the data in form as SQL query result, something similar, by this. Actually - data in rhd_data isn't in such a form (field by field for specified row=record) |
|
#4
|
|||
|
|||
|
There are many kinds of corruption. IBSurgeon can ignore many of them (because it reads database page by page, and is not concerned about integrity). But IBSurgeon also does not interpret contents of rows, you would have to do a lot of additional work to correctly assign data to columns etc.
Do you want to recover data from already corrupted database, or do you want to be prepared for such accident ? Much much much easier and cheaper would be to prevent corruptions and make regular backups ... ![]() |
|
#5
|
|||
|
|||
|
Yes, I see that IBSurgeon decompress data only, but does the interpretation is so hard? Where can be found such an example (at least in Firebird code - maybe somwhere near the SQL statement preparation, compilation, execution) I think, that one should decompress data into array of bytes and follow the field definitions stored in RDB$DESCRIPTOR in order to make the right transformation betwwen necessary amount of bytes into some human-readable value.
Actually - in could be great to create some insert script directly from database file. Well - actually I have some scripts for metadata change - all they can be executed whithout any error, however - after some small time after upgrade the signatures of corruption appears and normal read of data appears to be impossible. Where the mistake can be? ![]() |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > How data are stored in FireBird's datapage? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|