0

I'm using firebird nbackup method to backup my database by using this code:

nbackup -u systemdab -p masterskeys -B 0 DB01.FDB DB01.NBK

After complete backup, the size is smaller than original size. It might be caused of removing unused pages (I'm new to firebird please correct me if I'm wrong).

Is there any possible way to prevent removing of unused pages, or any way to get the amount of unused pages inside my database ?

Please let me know if you have any idea. Thanks.

Arioch 'The
  • 15,799
  • 35
  • 62
JK Ainz
  • 35
  • 7
  • You title was ambiguous. "Firebird backup", primary, is `gbak`. And `nbackup` was added much much later. Also, it is perhaps wrong term "removed" as `nbackup` does not modify the source database. It does make new copy for them, that is more correct to say - and to understand the picture. Now, WHY would you want to have made a copy of unused pages containing garbage? – Arioch 'The Aug 20 '19 at 07:21

1 Answers1

1

If GUI tools are okay you may install free edition of First AID from https://ib-aid.com/en/ibsurgeon-firstaid/

After you "open corrupt database" - but make sure the Firebird server itself does not have it opened at the moment - in the "Pages Summary" tab it will show you count and percentage of "free(unused) pages".

For command line, there is isql tool, which while names interactive SQL has options to run from pre-made script: https://firebirdsql.org/manual/isql.html

Starting with Firebird 3 it has unused page counter in show db command: http://tracker.firebirdsql.org/browse/CORE-5063

PAGE_SIZE 8192 
Number of DB pages allocated = 2095520 
Number of DB pages used = 2083825 
Number of DB pages free = 11695 

What about forcing incremental backup tool to make copies of garbage pages - I can not even imagine why would anyone want it.

Arioch 'The
  • 15,799
  • 35
  • 62