SlideShare a Scribd company logo
1 of 37
Firebird databases recovery and
protection for enterprises and ISVs


    Alexey Kovyazin,
    IBSurgeon
About IBSurgeon


                   • Tools and consulting
                   • Platinum Sponsor of Firebird
                     Foundation
                   • Founded in 2002: 9 years of Firebird
                     and InterBase recoveries and
                     consulting
                   • Based in Moscow, Russia




       www.ib-aid.com   www.ibsurgeon.com
Agenda
1. Is Firebird reliable?
2. What happens when database crashes
3. Standard means to recover database
     • Tips and tricks
4.     Approaches for recovery
     • FBDataGuard approach
     • FirstAID approach
5.     Offer for developers
IS FIREBIRD RELIABLE?
Is database corruption a problem only for
Firebird?
 • All databases are being corrupted from time time:
   • MSSQL
     www.google.com/search?q=MSSQL+database+corruption
   - Oracle
   - http://www.google.com/search?q=Oracle+database+corruption
   - MySQL, MS Access, DB2, Sybase, etc, etc (and InterBase)
Corruption is a matter of statistics
•   HDD fails
•   RAM fails
•   …
•   Automobiles fail
•   Electronics fails
•   Space shuttles fall

The same is for
hardware & software
combination we use with
Firebird
How to live in “corruptions” world?
1. This is impossible to exclude
   (prevent) corruption at all (if you are
   not God)
2. Realistic approach is to decrease
   the chance of corruption –
   i.e., increase system stability,
Common reliability levels are:
99%, 99.5%, 99,9%, 99.99%, etc
Examples of reliability
                    • It’s 3 days stop of
•99%                 your business
                     (e.g., December 23-
                     25 )

•99,5%              • About 1 day stop

•99,9%
                    • 3.5 hours stop
•99,99%
                    • 20 minutes
Why Firebird corrupted?
                 %
60
50
40
30
20
10
 0
                          %
How to achieve 99,5% Firebird stability?

• Buy good hardware with RAID
• Perform backup/restore every day



 It’s much easier and cheaper to
 achieve 99,5% reliability for Firebird
 than for other databases.


Yes, Firebird is reliable!
But it happens…
• No backups
• No administrator
• Serious hardware fails
• Big database and 24/7 workmode – can’t do
 backup/restore everyday

• What to do?
WHAT HAPPENS WHEN
DATABASE CRASHES?
Firebird inside looks like a forest…

                 Database



      System                    User’s
      metadata                   data


   Data      Index       Data            Index
  pages      pages      pages            pages
…with only 2 trees
• System data pages
  • Contains information about tables, indices, stored
    procedures. This information is used to store and read
    user data pages
• User data pages
  • Contains actual users data


• Indices?
   • Indices always can be recreated
   • System indices can be a problem
What corruption means for Firebird?
• For some reason Firebird engines cannot read
 one or several pages and fails to build database
 image
 • For HDD corruptions - many pages
 • RAM corruptions – few pages


Corruptions appear at:
1. Users screen (“internal Firebird software
   consistency check” error message)
2. In firebird.log
Heavy and Easy corruptions
• Easy corruptions
  • Users data are corrupted (partially)
  • User’s indices corrupted
• Heavy corruptions
  • System data are damaged (We can’t read users data!)
STANDARD MEANS TO
RECOVER DATABASE
Standard way to recover
• Stop Firebird server.
• Make a copy of Firebird database.
• Start Firebird server and run the following commands:


gfix.exe -v -full
gfix.exe -mend –ig
gbak -b –g -v

• If backup completed successfully, restore database:
 gbak -c -v -user SYSDBA -pass masterkey
 path_to_backup path_to_database
Tips
1. Try to run them all, even if gfix shows errors.
2. Always use switch –ig for gbak to ignore checksum
   errors
3. Always use switch –g for gbak to suppress garbage
   collection (and to workaround index errors)
4. Use –v switch to have detailed output
Restore errors
• After fixing corruptions it's a often to see "Cannot commit
 index" error at restore step.
  • In Firebird 2.0 and later this comes as a warning and database will
   be not brought on-line

• 1) IBDataPump (free tool)
  http://www.clevercomponents.com/demo/datapump/IBPu
  mp.zip
  2) Create only metadata database
• gbak -c -m
• 3) Run IBDataPump and set partially repaired database
  as Source, and fresh empty database as target
Effectiveness
• Gbak+Gfix can recover almost all easy
  corruptions
• What they cannot do:
 • Heavy corruptions with a lot of losses
 • System data corruptions
IBSURGEON TOOLS
Metadata repository


       METADATA
                        Copy in repository


      User tables
                      Keeps copy of raw
                      metadata
        Indices


        BLOBS
FBDataGuard


   Metadata
                FBDataGuard
              Extractor extracts
              all possible data
                                     New
                                   database
     User



     BLOBs
Demo
Up to 99% of successful recoveries!
And also
• FBDataGuard does monitoring and health checks
• Backups and maintenance schedule
• 26 parameters to check
• Email alerts
• Web-console
Example with TEMP


 FBDataGuard
found the temp
 files size = N                Not enough
                    Not          space –
                  enough    administrator will
                   space     have alert and
                  M – N<X   recommendation
 Free space at                 to increase
TEMP- locations                   TEMP
      =M
Example alert




Too big temporary files

Total size of all temporary files 3 Gb is more than recommended: 500 Mb

Firebird creates temporary files for some SQL queries (PLAN SORT). Too big size of
temporary files can indicate performance problems. This is not a strictly defined
number, so this threshold depends on particular database and application.
Index problem example


                    non-activated
FBDataGuard       indices usually
  found non-                               Administrator will
                      indicates              get alert and
activated index                           recommendation to
 after restore       corruption
                                             check indices
                       (missed
                   Foreign Keys)
                                  Possible
                                perfomance
                                  problem
                                 prevented!
Example of backup problem resolution


FBDataGuard
  found the
backup size =
     M                 Not                      Backup
                                         cancelled, database
                     enough                 status is set to
                      space              Critical, administrato
                      M>=N                     r got alert
  FBDataGuard
found free space
                              Corruption of
at backups’ disk =
                              backup was
        N
                               prevented!
Example of backup problem alert



• Job backup@[ server-0000 / db-0000 ] malfunction
• Unexpected job backup@[ server-0000 / db-0000 ] error:
 There is not enough space on the disk
Example of good backup notification
Hardware and UNDELETE failures
• HDD corruption
• Flash-drive corruption
• UNDELETE problem
FBFirstAID
• If we don’t have copy of system metadata
  (i.e., FBDataGuard)
• Trying to recover data
• Must be combined with standard tools
• 3.0 version to be released at January 2012!



• Successful recovery chances –
 80%
Offers for ISVs
• To protect databases we offer 1 year subscription to install
  as many as you need FBDataGuard instances
• This instances will run indefinitely (no restrictions)
• Should be activated
  • Silent bundle is also possible, requires signing VAR agreement




       For conference attendees – EUR 900 (reg
       EUR 1200 - 25%)
Next presentation from IBSurgeon
• How to migrate 75Gb Firebird 1.5 to 2.5?
• 5000+ stored procedures, 500+ tables, 400 users and 24x7
 workmode




•Mission Impossible, Part
 5 (Starring Firebird!)

More Related Content

What's hot

Top 10 DB2 Support Nightmares #9
Top 10 DB2 Support Nightmares  #9Top 10 DB2 Support Nightmares  #9
Top 10 DB2 Support Nightmares #9Laura Hood
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...Mark Wong
 
Top 10 DB2 Support Nightmares #8
Top 10 DB2 Support Nightmares  #8Top 10 DB2 Support Nightmares  #8
Top 10 DB2 Support Nightmares #8Laura Hood
 
Top 10 DB2 Support Nightmares #7
Top 10 DB2 Support Nightmares  #7 Top 10 DB2 Support Nightmares  #7
Top 10 DB2 Support Nightmares #7 Laura Hood
 
Business Continuity Presentation
Business Continuity PresentationBusiness Continuity Presentation
Business Continuity Presentationperry57123
 
Are the Native SQL Server Backup Utilities Holding You Back?
Are the Native SQL Server Backup Utilities Holding You Back?Are the Native SQL Server Backup Utilities Holding You Back?
Are the Native SQL Server Backup Utilities Holding You Back?SQLDBApros
 
Deduplication without performance hits: Intel Xeon processor E5-2697v2-powere...
Deduplication without performance hits: Intel Xeon processor E5-2697v2-powere...Deduplication without performance hits: Intel Xeon processor E5-2697v2-powere...
Deduplication without performance hits: Intel Xeon processor E5-2697v2-powere...Principled Technologies
 
Storage for Microsoft®Windows Enfironments
Storage for Microsoft®Windows EnfironmentsStorage for Microsoft®Windows Enfironments
Storage for Microsoft®Windows EnfironmentsMichael Hudak
 
Disaster Recovery Plan Whitepaper
Disaster Recovery Plan Whitepaper Disaster Recovery Plan Whitepaper
Disaster Recovery Plan Whitepaper Actian Corporation
 
Kroll Ontrack Recovering Your Virtual Data
Kroll Ontrack Recovering Your Virtual DataKroll Ontrack Recovering Your Virtual Data
Kroll Ontrack Recovering Your Virtual DataDave Logue
 
Top 10 DB2 Support Nightmares #10
Top 10 DB2 Support Nightmares  #10Top 10 DB2 Support Nightmares  #10
Top 10 DB2 Support Nightmares #10Laura Hood
 

What's hot (12)

Top 10 DB2 Support Nightmares #9
Top 10 DB2 Support Nightmares  #9Top 10 DB2 Support Nightmares  #9
Top 10 DB2 Support Nightmares #9
 
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
PostgreSQL Portland Performance Practice Project - Database Test 2 Filesystem...
 
Top 10 DB2 Support Nightmares #8
Top 10 DB2 Support Nightmares  #8Top 10 DB2 Support Nightmares  #8
Top 10 DB2 Support Nightmares #8
 
Top 10 DB2 Support Nightmares #7
Top 10 DB2 Support Nightmares  #7 Top 10 DB2 Support Nightmares  #7
Top 10 DB2 Support Nightmares #7
 
Backup strategy
Backup strategyBackup strategy
Backup strategy
 
Business Continuity Presentation
Business Continuity PresentationBusiness Continuity Presentation
Business Continuity Presentation
 
Are the Native SQL Server Backup Utilities Holding You Back?
Are the Native SQL Server Backup Utilities Holding You Back?Are the Native SQL Server Backup Utilities Holding You Back?
Are the Native SQL Server Backup Utilities Holding You Back?
 
Deduplication without performance hits: Intel Xeon processor E5-2697v2-powere...
Deduplication without performance hits: Intel Xeon processor E5-2697v2-powere...Deduplication without performance hits: Intel Xeon processor E5-2697v2-powere...
Deduplication without performance hits: Intel Xeon processor E5-2697v2-powere...
 
Storage for Microsoft®Windows Enfironments
Storage for Microsoft®Windows EnfironmentsStorage for Microsoft®Windows Enfironments
Storage for Microsoft®Windows Enfironments
 
Disaster Recovery Plan Whitepaper
Disaster Recovery Plan Whitepaper Disaster Recovery Plan Whitepaper
Disaster Recovery Plan Whitepaper
 
Kroll Ontrack Recovering Your Virtual Data
Kroll Ontrack Recovering Your Virtual DataKroll Ontrack Recovering Your Virtual Data
Kroll Ontrack Recovering Your Virtual Data
 
Top 10 DB2 Support Nightmares #10
Top 10 DB2 Support Nightmares  #10Top 10 DB2 Support Nightmares  #10
Top 10 DB2 Support Nightmares #10
 

Similar to Firebird database recovery and protection for enterprises and ISV

Firebird Anti-Corruption Approach
Firebird Anti-Corruption ApproachFirebird Anti-Corruption Approach
Firebird Anti-Corruption ApproachAlexey Kovyazin
 
Firebird's Big Databases (in English)
Firebird's Big Databases (in English)Firebird's Big Databases (in English)
Firebird's Big Databases (in English)Alexey Kovyazin
 
Fail-Safe Cluster for FirebirdSQL and something more
Fail-Safe Cluster for FirebirdSQL and something moreFail-Safe Cluster for FirebirdSQL and something more
Fail-Safe Cluster for FirebirdSQL and something moreAlexey Kovyazin
 
Technical track-afterimaging Progress Database
Technical track-afterimaging Progress DatabaseTechnical track-afterimaging Progress Database
Technical track-afterimaging Progress DatabaseVinh Nguyen
 
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14Kyle Hailey
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationKyle Hailey
 
CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013Andrew Khoury
 
database backup and recovery
database backup and recoverydatabase backup and recovery
database backup and recoverysdrhr
 
Kscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKyle Hailey
 
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod ColledgeDb As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledgesqlserver.co.il
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with BarmanEDB
 
Proact ExaGrid Seminar Presentation KK 20220419.pdf
Proact ExaGrid Seminar Presentation KK 20220419.pdfProact ExaGrid Seminar Presentation KK 20220419.pdf
Proact ExaGrid Seminar Presentation KK 20220419.pdfKarel Kannel
 
Agile Data: revolutionizing data and database cloning
Agile Data: revolutionizing data and database cloningAgile Data: revolutionizing data and database cloning
Agile Data: revolutionizing data and database cloningKyle Hailey
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'Kyle Hailey
 
Database Dumps and Backups
Database Dumps and BackupsDatabase Dumps and Backups
Database Dumps and BackupsEDB
 
Data Virtualization: revolutionizing database cloning
Data Virtualization: revolutionizing database cloningData Virtualization: revolutionizing database cloning
Data Virtualization: revolutionizing database cloningKyle Hailey
 
A Backup Today Saves Tomorrow
A Backup Today Saves TomorrowA Backup Today Saves Tomorrow
A Backup Today Saves TomorrowAndrew Moore
 
Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadMarius Adrian Popa
 

Similar to Firebird database recovery and protection for enterprises and ISV (20)

Firebird Anti-Corruption Approach
Firebird Anti-Corruption ApproachFirebird Anti-Corruption Approach
Firebird Anti-Corruption Approach
 
Firebird's Big Databases (in English)
Firebird's Big Databases (in English)Firebird's Big Databases (in English)
Firebird's Big Databases (in English)
 
Fail-Safe Cluster for FirebirdSQL and something more
Fail-Safe Cluster for FirebirdSQL and something moreFail-Safe Cluster for FirebirdSQL and something more
Fail-Safe Cluster for FirebirdSQL and something more
 
Technical track-afterimaging Progress Database
Technical track-afterimaging Progress DatabaseTechnical track-afterimaging Progress Database
Technical track-afterimaging Progress Database
 
IBM DB2
IBM DB2IBM DB2
IBM DB2
 
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14DevOps, Databases and The Phoenix Project UGF4042 from OOW14
DevOps, Databases and The Phoenix Project UGF4042 from OOW14
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualization
 
CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013CQ5.x Maintenance Webinar 2013
CQ5.x Maintenance Webinar 2013
 
database backup and recovery
database backup and recoverydatabase backup and recovery
database backup and recovery
 
Kscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data PlatformKscope 14 Presentation : Virtual Data Platform
Kscope 14 Presentation : Virtual Data Platform
 
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod ColledgeDb As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
Db As Behaving Badly... Worst Practices For Database Administrators Rod Colledge
 
PostgreSQL continuous backup and PITR with Barman
 PostgreSQL continuous backup and PITR with Barman PostgreSQL continuous backup and PITR with Barman
PostgreSQL continuous backup and PITR with Barman
 
Proact ExaGrid Seminar Presentation KK 20220419.pdf
Proact ExaGrid Seminar Presentation KK 20220419.pdfProact ExaGrid Seminar Presentation KK 20220419.pdf
Proact ExaGrid Seminar Presentation KK 20220419.pdf
 
Agile Data: revolutionizing data and database cloning
Agile Data: revolutionizing data and database cloningAgile Data: revolutionizing data and database cloning
Agile Data: revolutionizing data and database cloning
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'
 
Database Dumps and Backups
Database Dumps and BackupsDatabase Dumps and Backups
Database Dumps and Backups
 
Data Virtualization: revolutionizing database cloning
Data Virtualization: revolutionizing database cloningData Virtualization: revolutionizing database cloning
Data Virtualization: revolutionizing database cloning
 
Resolving problems & high availability
Resolving problems & high availabilityResolving problems & high availability
Resolving problems & high availability
 
A Backup Today Saves Tomorrow
A Backup Today Saves TomorrowA Backup Today Saves Tomorrow
A Backup Today Saves Tomorrow
 
Tuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy WorkloadTuning Linux Windows and Firebird for Heavy Workload
Tuning Linux Windows and Firebird for Heavy Workload
 

More from Mind The Firebird

Tips for using Firebird system tables
Tips for using Firebird system tablesTips for using Firebird system tables
Tips for using Firebird system tablesMind The Firebird
 
Using Azure cloud and Firebird to develop applications easily
Using Azure cloud and Firebird to develop applications easilyUsing Azure cloud and Firebird to develop applications easily
Using Azure cloud and Firebird to develop applications easilyMind The Firebird
 
A year in the life of Firebird .Net provider
A year in the life of Firebird .Net providerA year in the life of Firebird .Net provider
A year in the life of Firebird .Net providerMind The Firebird
 
How Firebird transactions work
How Firebird transactions workHow Firebird transactions work
How Firebird transactions workMind The Firebird
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceMind The Firebird
 
Creating logs for data auditing in FirebirdSQL
Creating logs for data auditing in FirebirdSQLCreating logs for data auditing in FirebirdSQL
Creating logs for data auditing in FirebirdSQLMind The Firebird
 
Firebird Performance counters in details
Firebird Performance counters in detailsFirebird Performance counters in details
Firebird Performance counters in detailsMind The Firebird
 
Understanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQLUnderstanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQLMind The Firebird
 
Threading through InterBase, Firebird, and beyond
Threading through InterBase, Firebird, and beyondThreading through InterBase, Firebird, and beyond
Threading through InterBase, Firebird, and beyondMind The Firebird
 
New SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad KhorsunNew SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad KhorsunMind The Firebird
 
Orphans, Corruption, Careful Write, and Logging
Orphans, Corruption, Careful Write, and LoggingOrphans, Corruption, Careful Write, and Logging
Orphans, Corruption, Careful Write, and LoggingMind The Firebird
 
Firebird release strategy and roadmap for 2015/2016
Firebird release strategy and roadmap for 2015/2016Firebird release strategy and roadmap for 2015/2016
Firebird release strategy and roadmap for 2015/2016Mind The Firebird
 
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...Mind The Firebird
 
Working with Large Firebird databases
Working with Large Firebird databasesWorking with Large Firebird databases
Working with Large Firebird databasesMind The Firebird
 
Stored procedures in Firebird
Stored procedures in FirebirdStored procedures in Firebird
Stored procedures in FirebirdMind The Firebird
 
Superchaging big production systems on Firebird: transactions, garbage, maint...
Superchaging big production systems on Firebird: transactions, garbage, maint...Superchaging big production systems on Firebird: transactions, garbage, maint...
Superchaging big production systems on Firebird: transactions, garbage, maint...Mind The Firebird
 

More from Mind The Firebird (20)

Tips for using Firebird system tables
Tips for using Firebird system tablesTips for using Firebird system tables
Tips for using Firebird system tables
 
Using Azure cloud and Firebird to develop applications easily
Using Azure cloud and Firebird to develop applications easilyUsing Azure cloud and Firebird to develop applications easily
Using Azure cloud and Firebird to develop applications easily
 
A year in the life of Firebird .Net provider
A year in the life of Firebird .Net providerA year in the life of Firebird .Net provider
A year in the life of Firebird .Net provider
 
How Firebird transactions work
How Firebird transactions workHow Firebird transactions work
How Firebird transactions work
 
SuperServer in Firebird 3
SuperServer in Firebird 3SuperServer in Firebird 3
SuperServer in Firebird 3
 
Copycat presentation
Copycat presentationCopycat presentation
Copycat presentation
 
Using ТРСС to study Firebird performance
Using ТРСС to study Firebird performanceUsing ТРСС to study Firebird performance
Using ТРСС to study Firebird performance
 
Overview of RedDatabase 2.5
Overview of RedDatabase 2.5Overview of RedDatabase 2.5
Overview of RedDatabase 2.5
 
Creating logs for data auditing in FirebirdSQL
Creating logs for data auditing in FirebirdSQLCreating logs for data auditing in FirebirdSQL
Creating logs for data auditing in FirebirdSQL
 
Firebird Performance counters in details
Firebird Performance counters in detailsFirebird Performance counters in details
Firebird Performance counters in details
 
Understanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQLUnderstanding Numbers in Firebird SQL
Understanding Numbers in Firebird SQL
 
Threading through InterBase, Firebird, and beyond
Threading through InterBase, Firebird, and beyondThreading through InterBase, Firebird, and beyond
Threading through InterBase, Firebird, and beyond
 
New SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad KhorsunNew SQL Features in Firebird 3, by Vlad Khorsun
New SQL Features in Firebird 3, by Vlad Khorsun
 
Orphans, Corruption, Careful Write, and Logging
Orphans, Corruption, Careful Write, and LoggingOrphans, Corruption, Careful Write, and Logging
Orphans, Corruption, Careful Write, and Logging
 
Firebird release strategy and roadmap for 2015/2016
Firebird release strategy and roadmap for 2015/2016Firebird release strategy and roadmap for 2015/2016
Firebird release strategy and roadmap for 2015/2016
 
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
Nbackup and Backup: Internals, Usage strategy and Pitfalls, by Dmitry Kuzmenk...
 
Working with Large Firebird databases
Working with Large Firebird databasesWorking with Large Firebird databases
Working with Large Firebird databases
 
Stored procedures in Firebird
Stored procedures in FirebirdStored procedures in Firebird
Stored procedures in Firebird
 
Firebird on Linux
Firebird on LinuxFirebird on Linux
Firebird on Linux
 
Superchaging big production systems on Firebird: transactions, garbage, maint...
Superchaging big production systems on Firebird: transactions, garbage, maint...Superchaging big production systems on Firebird: transactions, garbage, maint...
Superchaging big production systems on Firebird: transactions, garbage, maint...
 

Recently uploaded

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 

Recently uploaded (20)

SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 

Firebird database recovery and protection for enterprises and ISV

  • 1. Firebird databases recovery and protection for enterprises and ISVs Alexey Kovyazin, IBSurgeon
  • 2. About IBSurgeon • Tools and consulting • Platinum Sponsor of Firebird Foundation • Founded in 2002: 9 years of Firebird and InterBase recoveries and consulting • Based in Moscow, Russia www.ib-aid.com www.ibsurgeon.com
  • 3. Agenda 1. Is Firebird reliable? 2. What happens when database crashes 3. Standard means to recover database • Tips and tricks 4. Approaches for recovery • FBDataGuard approach • FirstAID approach 5. Offer for developers
  • 5. Is database corruption a problem only for Firebird? • All databases are being corrupted from time time: • MSSQL www.google.com/search?q=MSSQL+database+corruption - Oracle - http://www.google.com/search?q=Oracle+database+corruption - MySQL, MS Access, DB2, Sybase, etc, etc (and InterBase)
  • 6. Corruption is a matter of statistics • HDD fails • RAM fails • … • Automobiles fail • Electronics fails • Space shuttles fall The same is for hardware & software combination we use with Firebird
  • 7. How to live in “corruptions” world? 1. This is impossible to exclude (prevent) corruption at all (if you are not God) 2. Realistic approach is to decrease the chance of corruption – i.e., increase system stability, Common reliability levels are: 99%, 99.5%, 99,9%, 99.99%, etc
  • 8. Examples of reliability • It’s 3 days stop of •99% your business (e.g., December 23- 25 ) •99,5% • About 1 day stop •99,9% • 3.5 hours stop •99,99% • 20 minutes
  • 9. Why Firebird corrupted? % 60 50 40 30 20 10 0 %
  • 10. How to achieve 99,5% Firebird stability? • Buy good hardware with RAID • Perform backup/restore every day It’s much easier and cheaper to achieve 99,5% reliability for Firebird than for other databases. Yes, Firebird is reliable!
  • 11. But it happens… • No backups • No administrator • Serious hardware fails • Big database and 24/7 workmode – can’t do backup/restore everyday • What to do?
  • 13. Firebird inside looks like a forest… Database System User’s metadata data Data Index Data Index pages pages pages pages
  • 14. …with only 2 trees • System data pages • Contains information about tables, indices, stored procedures. This information is used to store and read user data pages • User data pages • Contains actual users data • Indices? • Indices always can be recreated • System indices can be a problem
  • 15. What corruption means for Firebird? • For some reason Firebird engines cannot read one or several pages and fails to build database image • For HDD corruptions - many pages • RAM corruptions – few pages Corruptions appear at: 1. Users screen (“internal Firebird software consistency check” error message) 2. In firebird.log
  • 16. Heavy and Easy corruptions • Easy corruptions • Users data are corrupted (partially) • User’s indices corrupted • Heavy corruptions • System data are damaged (We can’t read users data!)
  • 18. Standard way to recover • Stop Firebird server. • Make a copy of Firebird database. • Start Firebird server and run the following commands: gfix.exe -v -full gfix.exe -mend –ig gbak -b –g -v • If backup completed successfully, restore database: gbak -c -v -user SYSDBA -pass masterkey path_to_backup path_to_database
  • 19. Tips 1. Try to run them all, even if gfix shows errors. 2. Always use switch –ig for gbak to ignore checksum errors 3. Always use switch –g for gbak to suppress garbage collection (and to workaround index errors) 4. Use –v switch to have detailed output
  • 20. Restore errors • After fixing corruptions it's a often to see "Cannot commit index" error at restore step. • In Firebird 2.0 and later this comes as a warning and database will be not brought on-line • 1) IBDataPump (free tool) http://www.clevercomponents.com/demo/datapump/IBPu mp.zip 2) Create only metadata database • gbak -c -m • 3) Run IBDataPump and set partially repaired database as Source, and fresh empty database as target
  • 21. Effectiveness • Gbak+Gfix can recover almost all easy corruptions • What they cannot do: • Heavy corruptions with a lot of losses • System data corruptions
  • 23. Metadata repository METADATA Copy in repository User tables Keeps copy of raw metadata Indices BLOBS
  • 24. FBDataGuard Metadata FBDataGuard Extractor extracts all possible data New database User BLOBs
  • 25. Demo
  • 26. Up to 99% of successful recoveries!
  • 27. And also • FBDataGuard does monitoring and health checks • Backups and maintenance schedule • 26 parameters to check • Email alerts • Web-console
  • 28. Example with TEMP FBDataGuard found the temp files size = N Not enough Not space – enough administrator will space have alert and M – N<X recommendation Free space at to increase TEMP- locations TEMP =M
  • 29. Example alert Too big temporary files Total size of all temporary files 3 Gb is more than recommended: 500 Mb Firebird creates temporary files for some SQL queries (PLAN SORT). Too big size of temporary files can indicate performance problems. This is not a strictly defined number, so this threshold depends on particular database and application.
  • 30. Index problem example non-activated FBDataGuard indices usually found non- Administrator will indicates get alert and activated index recommendation to after restore corruption check indices (missed Foreign Keys) Possible perfomance problem prevented!
  • 31. Example of backup problem resolution FBDataGuard found the backup size = M Not Backup cancelled, database enough status is set to space Critical, administrato M>=N r got alert FBDataGuard found free space Corruption of at backups’ disk = backup was N prevented!
  • 32. Example of backup problem alert • Job backup@[ server-0000 / db-0000 ] malfunction • Unexpected job backup@[ server-0000 / db-0000 ] error: There is not enough space on the disk
  • 33. Example of good backup notification
  • 34. Hardware and UNDELETE failures • HDD corruption • Flash-drive corruption • UNDELETE problem
  • 35. FBFirstAID • If we don’t have copy of system metadata (i.e., FBDataGuard) • Trying to recover data • Must be combined with standard tools • 3.0 version to be released at January 2012! • Successful recovery chances – 80%
  • 36. Offers for ISVs • To protect databases we offer 1 year subscription to install as many as you need FBDataGuard instances • This instances will run indefinitely (no restrictions) • Should be activated • Silent bundle is also possible, requires signing VAR agreement For conference attendees – EUR 900 (reg EUR 1200 - 25%)
  • 37. Next presentation from IBSurgeon • How to migrate 75Gb Firebird 1.5 to 2.5? • 5000+ stored procedures, 500+ tables, 400 users and 24x7 workmode •Mission Impossible, Part 5 (Starring Firebird!)