Subject Re: [firebird-support] gfix -sweep Versus gbak -g
Author Carlos H. Cantu
Re: [firebird-support] gfix -sweep Versus gbak -g gbak -g does exactly the inverse of what you are thinking: It *disables* the garbage collection in the backup process. So, your backup is not collecting any garbage!

PS: You can try FireBase discussion list for PT-BR "support" ;)

Carlos
Firebird Performance in Detail - 
http://videos.firebirddevelopersday.com
www.firebirdnews.org - www.FireBase.com.br





Hello folks!
I’m Brazilian so sorry about some mistakes in the text below…

We have a new (~2 years old) system developed using Firebird 2.5.1 Classic. We use Delphi XE2 + Datasnap with a strict transaction control, only 3 or 4 places on the application server control de entire transaction scope.
 
At the beginning of this project we developed a “task manager” (will call TM) that runs a daily backup (gbak –g) on the production database and then it restores that backup into a new database for testing purpose. Our clients are not 24x7 usage (Accounting purpose software) so this task starts at 10PM. The intent of this is:

*Make a backup;
* Collect the garbage generated;
* Test if a corruption is found (If I can’t backup AND restore that database and alert is raised and the system stops for maintenance);
 
When a new version is released it is MANDATORY (by the TM) doing a backup and restore cycle. 
 
All runs fine those years but last week our big client (140 simultaneous users, 16Gb database) tell us the system is running slow and slow. We test a report that run in FIRST time in 10 seconds. SECOND try and 40 seconds! 3 and 1 minute and 40 seconds. I disconnect all users and ran a backup, nothing. 
 
Ran a gstat ans discovered that HAS old records versions what is odd to me because I always presume that running a gbak –g will collect all garbage AND discard old record versions. Then I run gfix –sweep and 10 minutes later the system runs smooth with every report try running in 5 seconds.
 
Now my question: Does gbak –g do not remove old record version? I must run gfix –sweep regularity (In a daily basis)? Besides server slow down, are any danger involving run gfix –sweep in a production database?
 
Thanks!!
Fabiano.