Are blobs saved in special pages?

72 views
Skip to first unread message

Dany40

unread,
May 28, 2024, 2:06:46 PMMay 28
to firebird-support
Hello!

This is only to know. Today we received a broken 21GB database. On it, is a big table with a blob field (with a limit of 4 MB), which represent most of that 21 GB. We only could repair it by loosing that blobs fields for all the records.

So my question is: are the blobs saved on special or separated area or pages in the database?.

Thank you!

Dimitry Sibiryakov

unread,
May 28, 2024, 2:59:42 PMMay 28
to firebird...@googlegroups.com
Dany40 wrote 28.05.2024 20:06:
> So my question is: are the blobs saved on special or separated area or pages in
> the database?.

Firebird keeps everything inside of database including BLOBs.

--
WBR, SD.

Dany40

unread,
May 28, 2024, 3:05:31 PMMay 28
to firebird-support
Yes yes, I know. My question is because in this broken database, it seams we can rescue all the tables with all the fields data, but not the blobs. This is the first time I see that in 16 years of using Firebird. 

Carlos H. Cantu

unread,
May 28, 2024, 3:26:14 PMMay 28
to Dany40

In simple words: blobs can be stored inside the same data page as other fields/records, or it can be stored in blob pages (the decision is up to Firebird when writing the data, based on the size of the blob and the page free space). A single blob can occupy several blob pages.


[]s

Carlos

www.firebirdnews.org - www.FireBase.com.br

Dimitry Sibiryakov

unread,
May 28, 2024, 5:48:44 PMMay 28
to firebird...@googlegroups.com
Dany40 wrote 28.05.2024 21:05:
> My question is because in this broken database, it seams we can rescue all the
> tables with all the fields data, but not the blobs.

That makes me wonder how exactly you did "rescue" the tables?

--
WBR, SD.

Dany40

unread,
May 29, 2024, 10:00:18 AMMay 29
to firebird-support
Thank you!.

I will try to explain the 2 methods that we try (allways with a fresh copy of the corrupted database)
Method A
1) We run gfix.exe using the following command line: gfix.exe -v -full -user SYSDBA -password <your_sysdba_password>  Disk:\Path\your_database.fdb

2) After that we run gfix.exe with another switches combination: gfix.exe -mend -ig -user SYSDBA -password <your_sysdba_password> Disk:\Path\your_database.fdb

3) As Gfix fixes minor corruptions prepares database for backup. Then we backup database using gbak.exe (in the same directory with gfix.exe).
We run backup with the following command: gbak.exe -b -g -ig -user SYSDBA -password <your_sysdba_password> Disk:\Path\your_database.fdb Disk:\Path\backup.fbk

4) We restore database from backup. Runing command: gbak -c -user SYSDBA -password <your_sysdba_password> Disk:\Path\backup.gbk Disk:\Path\your_database.fdb

Method B
If method A did not work, we use IB SURGEON FIRSTAID as we are licensed users.
In the software there are different methods to recover a corrupted database.
There is particulary one that could recover data, low level reading pages sequentially .

Best regards.

Dimitry Sibiryakov

unread,
May 29, 2024, 10:22:49 AMMay 29
to firebird...@googlegroups.com
Dany40 wrote 29.05.2024 16:00:
> Method B
> If method A did not work, we use IB SURGEON FIRSTAID as we are licensed users.
> In the software there are different methods to recover a corrupted database.
> There is particulary one that could recover data, low level reading pages
> sequentially .

If this method recovered no BLOBs than most likely there was no BLOBs in
broken database. Were BLOB fields there all NULLs or contained some BLOB IDs
that weren't found? In the former case it looks like someone tried to recreate
database from script and the script extractor had no way to extract BLOBs.

--
WBR, SD.

Dany40

unread,
May 29, 2024, 2:35:16 PMMay 29
to firebird-support
The database is 21G and we think that there are at least 20 G of it that are blobs.
The recovered table after IBSURGEON method that is supposed to contain them, now has the BLOB field with NULL.
Our customer has no technical expertise or knowledge to do anything with the database,
so we figured that the script extractor that has no way to extract blobs is from IBSURGEON.
Is there a way to edit and write code page in the database if a code page not found error appeared?

Ann Harrison

unread,
May 31, 2024, 12:42:45 PMMay 31
to firebird...@googlegroups.com
On Tue, May 28, 2024 at 3:05 PM Dany40 <dgsc...@gmail.com> wrote:
Yes yes, I know. My question is because in this broken database, it seams we can rescue all the tables with all the fields data, but not the blobs. This is the first time I see that in 16 years of using Firebird. 

El martes, 28 de mayo de 2024 a las 15:59:42 UTC-3, sd escribió:
Dany40 wrote 28.05.2024 20:06:
> So my question is: are the blobs saved on special or separated area or pages in
> the database?.


It depends on the size of the blob.  Very small ones are stored on data pages.  Large ones are stored on separate pages that are listed in the record.  Extremely large ones have a page of pointers to blob pages. They should be recoverable.  What tool are you using for recovery?

Good luck,

Ann

You received this message because you are subscribed to the Google Groups "firebird-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebird-suppo...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/firebird-support/f03f363b-1458-4e49-b632-b434673efe55n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages