In most cases the following solution would be enough to fix the database:
Firebird 2.5
1 |
cd C:\Program Files (x86)\Firebird\Firebird_2_5\bin |
Firebird 3
1 |
gfix -mend -full -ignore -user SYSDBA -pas masterkey "C:\Program Files (x86)\SBZ systems\EMDI\dbs\main2.fdb" |
If it is not fixed try the following solution:
First backup
1 |
gbak -b -v -user SYSDBA -password "masterkey" C:\Program Files (x86)\SBZ systems\EMDI\dbs\main.FDB C:\Program Files (x86)\SBZ systems\EMDI\dbs\main.fbk |
and finally restore
1 |
gbak -c -user SYSDBA -password masterkey C:\Program Files (x86)\SBZ systems\EMDI\dbs\main.fbk C:\Program Files (x86)\SBZ systems\EMDI\dbs\main.fdb |
You can download our software, which makes the process automatically.
The process can also be done automatically with the script:
https://github.com/sbzsystems/windows-batch-scripts/blob/main/fix_firebird_db.bat