SlideShare una empresa de Scribd logo
1 de 31
From Firebird 1.5 to 2.5


How to migrate 75Gb database, with 564
tables, 5000+ stored procedures, 813
triggers, which is working 24x7, with ~400
users in less than 4 months
About IBSurgeon


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




       www.ib-aid.com       www.ibsurgeon.com
About Profitmed
• http://www.profitmed.net/
• Pharmaceutical distributor Russia
• 24x7 work mode for 2 warehouses (16000 sqm + 7000
    sqm)
•   12x7 work mode for office
•   400 peak users
•   75 Gb database size
•   64 Gb RAM, RAID 10 (Dell Storage), Xeon 4x6 cores
Why to migrate?
• From Firebird 1.5
  • Old (2004), no professional support
  • Bad memory management for huge queries
  • Slow garbage collection (1.5 hour+)
  • Slow backup (2 hours)
  • Firebird Classic 1.5 [actually] does not use more than 6
    CPU cores

             All together = SLOW.
Simple approach is impossible

                    Perform
  Stop operations               Run operations
                    migration




The only available timeframe for switch to the
new version – Christmas & New Year Eve
Special approach needed

Fork database   Prepare patch    Apply patch




 Metadata       Business logic   Performance
 changes          changes        optimization
Infrastructure for migration
• 2 servers (similar)
  • Production is 64Gb RAM, Dell Storage
  • Test is 32Gb RAM, RAID1
• Tools to verify the migration
   • SQL queries compatibility
   • SQL queries plans - performance
Steps
1. Prepare metadata
2. Test convert data to 2.5
3. Application migration
     1.   Check SQL queries in applications for compatibility,
     2.   Change SQLs if necessary
     3.   Check execution plans of SQL queries
     4.   Change plans if necessary
4. Test run
5. Final run
Step 1: Prepare metadata
1.   Extract metadata from Firebird 1.5 to script
     Isql –x (or using GUI tools)
2. Run metadata script in Firebird 2.5
3. Get output as “errors.txt” and analyze it
4. Patch 1.5 database (should be compatible with 1.5 and
   2.5), and external script




                      Metadata                                 Errors
Fb15       Extract
                       TEXT          Apply
                                               Fb25   Export    Log
          Metadata                  Metadata          Errors   TEXT
 Db                     File                    Db              File
Errors in pure metadata – part 1
1. Ambiguous field name between table X and
   table Y (need to use aliases!)
                                                     ~40%
2. Data type unknown. Blob sub_types bigger
   than 1 (text) are for internal use only. (wrong
   sub_type in BLOB definitions)                     ~10%
3. Attempt to update read-only column (changes
   in AFTER UPDATE/AFTER DELETE triggers)

                                                     ~7%
Errors in pure metadata – part 2
4. In 1.5 – function TRIM was in UDF, now it’s
   embedded function with different parameters
                                                  ~5%
5. Expression evaluation not supported. Strings
   cannot be multiplied in dialect 3 (explicit
   casting needed).
6. New Keywords (GLOBAL)
                                                  ~1%
7. Other errors


                                                  ~1%
Summary of Step 1
• 800+ errors
• 2 weeks to fix
• Scripts:
  • Fixes in existing Firebird 1.5 database
  • Patch25.sql - External script to patch 2.5 database




Next: we are ready to convert data
to Firebird 2.5
Step 2: Test convert data to 2.5
1. Backup patched 1.5 database
2. Restore with –fix_fss_metadata and –fix_fss_data
   options
3. Apply Patch25.sql script to restored database
4. Backup/restore under 2.5



Backup – 2 hours, restore - 6 hours.
Summary of step 2
• 2 days
• We have database in 100% Firebird 2.5 compatible format



• Next: need to check and change
 SQL queries in all our applications
Step 3: Application migration
 1. Check SQL queries in applications for
    compatibility,
 2. Change SQLs if necessary
 3. Check execution plans of SQL queries
 4. Change plans if necessary


 This is the most complex step!
How to check SQL queries for
compatibility
• We needed to log all SQL queries from all
 applications
 • Own-written applications
 • Closed-source application
Tip: logging is complicated
• MON$ tables does not help – they are snapshots (and in
  2.1+ only) and make the heavy load
• FBTrace API is 2.5+ only


• FBScanner is IBSurgeon’s commercial tool which
 analyze the network traffic and stores the full log, it’s the
 only true logging solution
FBScanner logged SQL queries
                           Computer1


                                   FBScanner


                                   3050

       Server

                                               Firebird clients
                                               (applications),
                Firebird                         connected
                                                through TCP
           3050


Several workstations were run through FBScanner one by one to reduce
performance impact and make log more “linear”.
All SQL queries were stored to the log

                 FBScann
                    er




                               Complete SQL
                               texts with
                   Log         parameters and
                               (optionally)
                 database
                               plans!
SQL log
To find incompatible SQLs
We need to “play” log to the copy of 2.5 database
• Make prepare
• Try to execute
• Catch exceptions/errors if any
• Log SQL execution plans
• Log SQL execution times
          Find the differences in plans and delays
FBScanner played the log

     FBScann
        er

                         Copy of
                      database (in
                       2.5 format)
       Log
     database
Differences in plans and execution times
between 1.5 and 2.5 are highlighted
Play log results
• We had ~55000 queries to analyze
• Only 280 has different plans
• ~400 has slower Execution time at 2.5 than 1.5
• ~50 queries raised exceptions



      Only ~750 queries from 55000
         required investigation.
Sorted log was exported to Excel
Plan problem example (simplified)
select agb.eid, agb.kollast, agb.eid5, agb.first_eid,
agb.did3, agb.did4, agb.marker, agb.place, agb.mnp
from p101_ant_goods_balance agb
where agb.ddate <= :i$ddate and agb.l800 = :i$l800 and
agb.did3 = rf2_abs(3409) and agb.marker = :i$marker and
agb.did <> :i$did

• 2.5 PLAN (AGB INDEX
  (IDX$AGB_L800_DDDATE_ECON_EMP))
• 1.5 PLAN (AGB INDEX
  (IDX$AGB_L800_DDDATE_ECON_EMP,
  IX$AGB_DID3))
Another problems
• New Firebird keywords in closed-sourced software
  • Was hacked 
• UDF rFunc for 64-bit Windows and Linux
  • AUDFL https://www.assembla.com/wiki/show/audfl_rfunc
Results of migration
• At Firebird 2.5
  • Better performance in queries
  • Fast garbage collection (20 minutes instead of 1.5
    hours)
  • Backup time reduced (1.5 hour instead of 2 hours)
  • Better use of multi-CPU hardware
  • 64 bit version of Firebird available
  • EXECUTION STATEMENT and other SQL features
Optimization Pack “Rodizio” offer
• To optimize databases we offer 1 year subscription to
  install as many as you need FBScanner+IBAnalyst+IBTM
  instances
• This instances will run indefinitely (no restrictions)
• Should be activated
  • Silent bundle is also possible, requires signing VAR agreement




      Today – EUR 1200 (reg EUR 1500)
Next presentation – tomorrow 14-00
• Nov 26, 14-00
• Supercharging Firebird production systems:
 transactions, garbage, maintenance
Thanks and Contacts
Blog
http://FirebirdSurgeon.blogspot.com
Twitter
http://Twitter.com/ibsurgeon
Web
http://www.ib-aid.com

Más contenido relacionado

La actualidad más candente

Working with Large Firebird databases
Working with Large Firebird databasesWorking with Large Firebird databases
Working with Large Firebird databasesMind The Firebird
 
Introduction to firebidSQL 3.x
Introduction to firebidSQL 3.xIntroduction to firebidSQL 3.x
Introduction to firebidSQL 3.xFabio Codebue
 
Firebird 3.x guida alla migrazione
Firebird 3.x guida alla migrazioneFirebird 3.x guida alla migrazione
Firebird 3.x guida alla migrazioneFabio Codebue
 
Relational databases for BigData
Relational databases for BigDataRelational databases for BigData
Relational databases for BigDataAlexander Tokarev
 
Some osdb migration_question_for_the_certification_tadm70
Some osdb migration_question_for_the_certification_tadm70Some osdb migration_question_for_the_certification_tadm70
Some osdb migration_question_for_the_certification_tadm70neel_pushkar
 
Optimizing S3 Write-heavy Spark workloads
Optimizing S3 Write-heavy Spark workloadsOptimizing S3 Write-heavy Spark workloads
Optimizing S3 Write-heavy Spark workloadsdatamantra
 
Overview of Postgres 9.5
Overview of Postgres 9.5 Overview of Postgres 9.5
Overview of Postgres 9.5 EDB
 
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John NaylorPGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John NaylorEqunix Business Solutions
 
Non-Relational Postgres
Non-Relational PostgresNon-Relational Postgres
Non-Relational PostgresEDB
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insightsKirill Loifman
 
Postgres Vision 2018: WAL: Everything You Want to Know
Postgres Vision 2018: WAL: Everything You Want to KnowPostgres Vision 2018: WAL: Everything You Want to Know
Postgres Vision 2018: WAL: Everything You Want to KnowEDB
 
Microsoft sql server architecture
Microsoft sql server architectureMicrosoft sql server architecture
Microsoft sql server architectureNaveen Boda
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)Marco Gralike
 
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...Alex Zaballa
 
Presentation oracle net services
Presentation    oracle net servicesPresentation    oracle net services
Presentation oracle net servicesxKinAnx
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recoveryaltistory
 
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)Aurimas Mikalauskas
 
Sql server backup internals
Sql server backup internalsSql server backup internals
Sql server backup internalsHamid J. Fard
 

La actualidad más candente (20)

Working with Large Firebird databases
Working with Large Firebird databasesWorking with Large Firebird databases
Working with Large Firebird databases
 
Introduction to firebidSQL 3.x
Introduction to firebidSQL 3.xIntroduction to firebidSQL 3.x
Introduction to firebidSQL 3.x
 
Firebird 3.x guida alla migrazione
Firebird 3.x guida alla migrazioneFirebird 3.x guida alla migrazione
Firebird 3.x guida alla migrazione
 
Relational databases for BigData
Relational databases for BigDataRelational databases for BigData
Relational databases for BigData
 
Some osdb migration_question_for_the_certification_tadm70
Some osdb migration_question_for_the_certification_tadm70Some osdb migration_question_for_the_certification_tadm70
Some osdb migration_question_for_the_certification_tadm70
 
Optimizing S3 Write-heavy Spark workloads
Optimizing S3 Write-heavy Spark workloadsOptimizing S3 Write-heavy Spark workloads
Optimizing S3 Write-heavy Spark workloads
 
Overview of Postgres 9.5
Overview of Postgres 9.5 Overview of Postgres 9.5
Overview of Postgres 9.5
 
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John NaylorPGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
PGConf.ASIA 2019 Bali - Upcoming Features in PostgreSQL 12 - John Naylor
 
Non-Relational Postgres
Non-Relational PostgresNon-Relational Postgres
Non-Relational Postgres
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insights
 
Postgres Vision 2018: WAL: Everything You Want to Know
Postgres Vision 2018: WAL: Everything You Want to KnowPostgres Vision 2018: WAL: Everything You Want to Know
Postgres Vision 2018: WAL: Everything You Want to Know
 
Oracle 12c Architecture
Oracle 12c ArchitectureOracle 12c Architecture
Oracle 12c Architecture
 
Microsoft sql server architecture
Microsoft sql server architectureMicrosoft sql server architecture
Microsoft sql server architecture
 
Cloud DWH deep dive
Cloud DWH deep diveCloud DWH deep dive
Cloud DWH deep dive
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)
 
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
 
Presentation oracle net services
Presentation    oracle net servicesPresentation    oracle net services
Presentation oracle net services
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
 
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
MySQL Performance Tuning. Part 1: MySQL Configuration (includes MySQL 5.7)
 
Sql server backup internals
Sql server backup internalsSql server backup internals
Sql server backup internals
 

Similar a Migration from Firebird 1.5 to Firebird 2.5

MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMorgan Tocker
 
ODTUG KSCOPE 2017 - Black Belt Techniques for FDMEE and Cloud Data Management
ODTUG KSCOPE 2017 - Black Belt Techniques for FDMEE and Cloud Data ManagementODTUG KSCOPE 2017 - Black Belt Techniques for FDMEE and Cloud Data Management
ODTUG KSCOPE 2017 - Black Belt Techniques for FDMEE and Cloud Data ManagementFrancisco Amores
 
Flink Forward SF 2017: Feng Wang & Zhijiang Wang - Runtime Improvements in Bl...
Flink Forward SF 2017: Feng Wang & Zhijiang Wang - Runtime Improvements in Bl...Flink Forward SF 2017: Feng Wang & Zhijiang Wang - Runtime Improvements in Bl...
Flink Forward SF 2017: Feng Wang & Zhijiang Wang - Runtime Improvements in Bl...Flink Forward
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB
 
Large Data Volume Salesforce experiences
Large Data Volume Salesforce experiencesLarge Data Volume Salesforce experiences
Large Data Volume Salesforce experiencesCidar Mendizabal
 
Stephan Ewen - Experiences running Flink at Very Large Scale
Stephan Ewen -  Experiences running Flink at Very Large ScaleStephan Ewen -  Experiences running Flink at Very Large Scale
Stephan Ewen - Experiences running Flink at Very Large ScaleVerverica
 
The state of Spark in the cloud
The state of Spark in the cloudThe state of Spark in the cloud
The state of Spark in the cloudNicolas Poggi
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMario Beck
 
MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012Colin Charles
 
Streaming in Practice - Putting Apache Kafka in Production
Streaming in Practice - Putting Apache Kafka in ProductionStreaming in Practice - Putting Apache Kafka in Production
Streaming in Practice - Putting Apache Kafka in Productionconfluent
 
2.4 Optimizing your Visual COBOL Applications
2.4   Optimizing your Visual COBOL Applications2.4   Optimizing your Visual COBOL Applications
2.4 Optimizing your Visual COBOL ApplicationsMicro Focus
 
Tips and Tricks for SAP Sybase ASE
Tips and Tricks for SAP Sybase ASETips and Tricks for SAP Sybase ASE
Tips and Tricks for SAP Sybase ASEDon Brizendine
 
Make Your Site SpEEdy
Make Your Site SpEEdyMake Your Site SpEEdy
Make Your Site SpEEdyRuthie BenDor
 
Save 5 Hours a Day by Integrating RPG to SQL Server, Excel, and Other Databases
Save 5 Hours a Day by Integrating RPG to SQL Server, Excel, and Other DatabasesSave 5 Hours a Day by Integrating RPG to SQL Server, Excel, and Other Databases
Save 5 Hours a Day by Integrating RPG to SQL Server, Excel, and Other DatabasesHelpSystems
 
Gruter TECHDAY 2014 Realtime Processing in Telco
Gruter TECHDAY 2014 Realtime Processing in TelcoGruter TECHDAY 2014 Realtime Processing in Telco
Gruter TECHDAY 2014 Realtime Processing in TelcoGruter
 

Similar a Migration from Firebird 1.5 to Firebird 2.5 (20)

MySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics ImprovementsMySQL 5.6 - Operations and Diagnostics Improvements
MySQL 5.6 - Operations and Diagnostics Improvements
 
ODTUG KSCOPE 2017 - Black Belt Techniques for FDMEE and Cloud Data Management
ODTUG KSCOPE 2017 - Black Belt Techniques for FDMEE and Cloud Data ManagementODTUG KSCOPE 2017 - Black Belt Techniques for FDMEE and Cloud Data Management
ODTUG KSCOPE 2017 - Black Belt Techniques for FDMEE and Cloud Data Management
 
Flink Forward SF 2017: Feng Wang & Zhijiang Wang - Runtime Improvements in Bl...
Flink Forward SF 2017: Feng Wang & Zhijiang Wang - Runtime Improvements in Bl...Flink Forward SF 2017: Feng Wang & Zhijiang Wang - Runtime Improvements in Bl...
Flink Forward SF 2017: Feng Wang & Zhijiang Wang - Runtime Improvements in Bl...
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
 
Cobol 5 presentation
Cobol 5 presentationCobol 5 presentation
Cobol 5 presentation
 
Large Data Volume Salesforce experiences
Large Data Volume Salesforce experiencesLarge Data Volume Salesforce experiences
Large Data Volume Salesforce experiences
 
Stephan Ewen - Experiences running Flink at Very Large Scale
Stephan Ewen -  Experiences running Flink at Very Large ScaleStephan Ewen -  Experiences running Flink at Very Large Scale
Stephan Ewen - Experiences running Flink at Very Large Scale
 
The state of Spark in the cloud
The state of Spark in the cloudThe state of Spark in the cloud
The state of Spark in the cloud
 
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
XPages Performance Master Class - Survive in the fast lane on the Autobahn (E...
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
 
MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012
 
Streaming in Practice - Putting Apache Kafka in Production
Streaming in Practice - Putting Apache Kafka in ProductionStreaming in Practice - Putting Apache Kafka in Production
Streaming in Practice - Putting Apache Kafka in Production
 
2.4 Optimizing your Visual COBOL Applications
2.4   Optimizing your Visual COBOL Applications2.4   Optimizing your Visual COBOL Applications
2.4 Optimizing your Visual COBOL Applications
 
Alfresco tuning part1
Alfresco tuning part1Alfresco tuning part1
Alfresco tuning part1
 
Alfresco tuning part1
Alfresco tuning part1Alfresco tuning part1
Alfresco tuning part1
 
Tips and Tricks for SAP Sybase ASE
Tips and Tricks for SAP Sybase ASETips and Tricks for SAP Sybase ASE
Tips and Tricks for SAP Sybase ASE
 
Aws migration case study_blr_meetup
Aws migration case study_blr_meetupAws migration case study_blr_meetup
Aws migration case study_blr_meetup
 
Make Your Site SpEEdy
Make Your Site SpEEdyMake Your Site SpEEdy
Make Your Site SpEEdy
 
Save 5 Hours a Day by Integrating RPG to SQL Server, Excel, and Other Databases
Save 5 Hours a Day by Integrating RPG to SQL Server, Excel, and Other DatabasesSave 5 Hours a Day by Integrating RPG to SQL Server, Excel, and Other Databases
Save 5 Hours a Day by Integrating RPG to SQL Server, Excel, and Other Databases
 
Gruter TECHDAY 2014 Realtime Processing in Telco
Gruter TECHDAY 2014 Realtime Processing in TelcoGruter TECHDAY 2014 Realtime Processing in Telco
Gruter TECHDAY 2014 Realtime Processing in Telco
 

Más de 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
 
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
 

Más de 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...
 
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...
 
Firebird meets NoSQL
Firebird meets NoSQLFirebird meets NoSQL
Firebird meets NoSQL
 

Último

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Último (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Migration from Firebird 1.5 to Firebird 2.5

  • 1. From Firebird 1.5 to 2.5 How to migrate 75Gb database, with 564 tables, 5000+ stored procedures, 813 triggers, which is working 24x7, with ~400 users in less than 4 months
  • 2. About IBSurgeon • Tools and consulting • Platinum Sponsor of Firebird • Founded in 2002: 9 years of Firebird recoveries and consulting • Based in Moscow, Russia www.ib-aid.com www.ibsurgeon.com
  • 3. About Profitmed • http://www.profitmed.net/ • Pharmaceutical distributor Russia • 24x7 work mode for 2 warehouses (16000 sqm + 7000 sqm) • 12x7 work mode for office • 400 peak users • 75 Gb database size • 64 Gb RAM, RAID 10 (Dell Storage), Xeon 4x6 cores
  • 4. Why to migrate? • From Firebird 1.5 • Old (2004), no professional support • Bad memory management for huge queries • Slow garbage collection (1.5 hour+) • Slow backup (2 hours) • Firebird Classic 1.5 [actually] does not use more than 6 CPU cores All together = SLOW.
  • 5. Simple approach is impossible Perform Stop operations Run operations migration The only available timeframe for switch to the new version – Christmas & New Year Eve
  • 6. Special approach needed Fork database Prepare patch Apply patch Metadata Business logic Performance changes changes optimization
  • 7. Infrastructure for migration • 2 servers (similar) • Production is 64Gb RAM, Dell Storage • Test is 32Gb RAM, RAID1 • Tools to verify the migration • SQL queries compatibility • SQL queries plans - performance
  • 8. Steps 1. Prepare metadata 2. Test convert data to 2.5 3. Application migration 1. Check SQL queries in applications for compatibility, 2. Change SQLs if necessary 3. Check execution plans of SQL queries 4. Change plans if necessary 4. Test run 5. Final run
  • 9. Step 1: Prepare metadata 1. Extract metadata from Firebird 1.5 to script Isql –x (or using GUI tools) 2. Run metadata script in Firebird 2.5 3. Get output as “errors.txt” and analyze it 4. Patch 1.5 database (should be compatible with 1.5 and 2.5), and external script Metadata Errors Fb15 Extract TEXT Apply Fb25 Export Log Metadata Metadata Errors TEXT Db File Db File
  • 10. Errors in pure metadata – part 1 1. Ambiguous field name between table X and table Y (need to use aliases!) ~40% 2. Data type unknown. Blob sub_types bigger than 1 (text) are for internal use only. (wrong sub_type in BLOB definitions) ~10% 3. Attempt to update read-only column (changes in AFTER UPDATE/AFTER DELETE triggers) ~7%
  • 11. Errors in pure metadata – part 2 4. In 1.5 – function TRIM was in UDF, now it’s embedded function with different parameters ~5% 5. Expression evaluation not supported. Strings cannot be multiplied in dialect 3 (explicit casting needed). 6. New Keywords (GLOBAL) ~1% 7. Other errors ~1%
  • 12. Summary of Step 1 • 800+ errors • 2 weeks to fix • Scripts: • Fixes in existing Firebird 1.5 database • Patch25.sql - External script to patch 2.5 database Next: we are ready to convert data to Firebird 2.5
  • 13. Step 2: Test convert data to 2.5 1. Backup patched 1.5 database 2. Restore with –fix_fss_metadata and –fix_fss_data options 3. Apply Patch25.sql script to restored database 4. Backup/restore under 2.5 Backup – 2 hours, restore - 6 hours.
  • 14. Summary of step 2 • 2 days • We have database in 100% Firebird 2.5 compatible format • Next: need to check and change SQL queries in all our applications
  • 15. Step 3: Application migration 1. Check SQL queries in applications for compatibility, 2. Change SQLs if necessary 3. Check execution plans of SQL queries 4. Change plans if necessary This is the most complex step!
  • 16. How to check SQL queries for compatibility • We needed to log all SQL queries from all applications • Own-written applications • Closed-source application
  • 17. Tip: logging is complicated • MON$ tables does not help – they are snapshots (and in 2.1+ only) and make the heavy load • FBTrace API is 2.5+ only • FBScanner is IBSurgeon’s commercial tool which analyze the network traffic and stores the full log, it’s the only true logging solution
  • 18. FBScanner logged SQL queries Computer1 FBScanner 3050 Server Firebird clients (applications), Firebird connected through TCP 3050 Several workstations were run through FBScanner one by one to reduce performance impact and make log more “linear”.
  • 19. All SQL queries were stored to the log FBScann er Complete SQL texts with Log parameters and (optionally) database plans!
  • 21. To find incompatible SQLs We need to “play” log to the copy of 2.5 database • Make prepare • Try to execute • Catch exceptions/errors if any • Log SQL execution plans • Log SQL execution times Find the differences in plans and delays
  • 22. FBScanner played the log FBScann er Copy of database (in 2.5 format) Log database
  • 23. Differences in plans and execution times between 1.5 and 2.5 are highlighted
  • 24. Play log results • We had ~55000 queries to analyze • Only 280 has different plans • ~400 has slower Execution time at 2.5 than 1.5 • ~50 queries raised exceptions Only ~750 queries from 55000 required investigation.
  • 25. Sorted log was exported to Excel
  • 26. Plan problem example (simplified) select agb.eid, agb.kollast, agb.eid5, agb.first_eid, agb.did3, agb.did4, agb.marker, agb.place, agb.mnp from p101_ant_goods_balance agb where agb.ddate <= :i$ddate and agb.l800 = :i$l800 and agb.did3 = rf2_abs(3409) and agb.marker = :i$marker and agb.did <> :i$did • 2.5 PLAN (AGB INDEX (IDX$AGB_L800_DDDATE_ECON_EMP)) • 1.5 PLAN (AGB INDEX (IDX$AGB_L800_DDDATE_ECON_EMP, IX$AGB_DID3))
  • 27. Another problems • New Firebird keywords in closed-sourced software • Was hacked  • UDF rFunc for 64-bit Windows and Linux • AUDFL https://www.assembla.com/wiki/show/audfl_rfunc
  • 28. Results of migration • At Firebird 2.5 • Better performance in queries • Fast garbage collection (20 minutes instead of 1.5 hours) • Backup time reduced (1.5 hour instead of 2 hours) • Better use of multi-CPU hardware • 64 bit version of Firebird available • EXECUTION STATEMENT and other SQL features
  • 29. Optimization Pack “Rodizio” offer • To optimize databases we offer 1 year subscription to install as many as you need FBScanner+IBAnalyst+IBTM instances • This instances will run indefinitely (no restrictions) • Should be activated • Silent bundle is also possible, requires signing VAR agreement Today – EUR 1200 (reg EUR 1500)
  • 30. Next presentation – tomorrow 14-00 • Nov 26, 14-00 • Supercharging Firebird production systems: transactions, garbage, maintenance