Magnet: database delta delivery tool


Published on

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Magnet: database delta delivery tool

  1. 1. Magnet: solution for database delta deliveries Martins Kemme
  2. 2. The Challenge You can’t deliver all database objects every time, because • it may take too much time to recreate all database objects • there are objects (like tables) that can’t be deleted and reinstalled (valuable data are there!)
  3. 3. Delta Delivery “Delta delivery” - deliver only the items, that were modified recently Changes that are new and need to be delivered now Previously delivered changes Time
  4. 4. Delta Delivery Challenges • Take only modified items plus related items • Decide what to do if this item has been modified several times? • Find out detailed info about each file • what it is? • how it must be installed? • Know the installation sequence • Make a note that now these changes have also been delivered
  5. 5. Magnet for Subversion repositories
  6. 6. What is Magnet? Java tool, that operates on SVN repositories and can • retrieve from Subversion repository only these files that are referenced in selected revisions • create installation file for files referenced in selected revisions • collect Subversion log messages from selected revisions into one text file (i.e. create documentation for the delivery) • add specific properties to revisions in Subversion repository marking that these revisions are collected
  7. 7. The Algorithm 1. Determine file type either by location (directory) or by file name 2. Determine file installation method from file type 3. Determine installation method parameters 4. Create installation script that contains calls of installation methods for each file
  8. 8. Magnet: the result • The following slides will present some examples of installation scripts generated automatically by the Magnet • These scripts can be run automatically by continuous integration engine or by person manually
  9. 9. Unix Script Example #!/bin/bash ### Load all installation functions . ./ ### Check if required Login Ids are entered else prompt to get them CHKSCHEME "APPS_ID" "APPS_ID" echo [INSTALLER] $SYSDATE Starting installation... echo [INSTALLER] Installing revision 5930 INSTALLBINARY XXCMP "../applnode-concurrent/appl_top/xxcmp/11.5.0/bin/ xxcmp_ar_loader.ctl" echo [INSTALLER] Installing revision 5935 RUNSQLPLUS $APPS_ID "@../dbinstall/apps/data_scripts/CMP-5048_DATAFIX.sql" echo [INSTALLER] $SYSDATE Installation finished.
  10. 10. SQL*Plus Script Example SET verify ON SET timing ON SPOOL &spool_file SET define off prompt [INSTALLER] Starting installation... prompt [INSTALLER] Installing TABLE conn &&ZV_HORIZON @branches/horizon/DB_scripts/ZV_HORIZON/table/gl_invoices.sql prompt [INSTALLER] Installing PACKAGE_BODY conn &&ZRZ_OWNER @trunk/source_code/DB_scripts/ZRZ_OWNER/package/p_legal_persons-b.sql prompt [INSTALLER] Installing GRANT conn &&ZV_ADMIN @trunk/source_code/DB_scripts/ZV_ADMIN/grant/771_setup_new_form.sql
  11. 11. Windows BAT file @echo off echo [INSTALLER] Starting installation... echo [INSTALLER] Installing TABLE call:RUNSQL %ZV_OWNER% @trunk/DB_source/ZV_OWNER/table/dmf_parts.sql call:RUNSQL %ZV_OWNER% @trunk/DB_source/ZV_OWNER/table/labels.sql echo [INSTALLER] Installing PACKAGE_SPECIFICATION call:RUNSQL %ZV_OWNER% @trunk/DB_source/ZV_OWNER/package/p_zc_prices-h.sql call:RUNSQL %ZV_OWNER% @trunk/DB_source/ZV_OWNER/package/p_legal_persons-h.sql echo [INSTALLER] Installing PACKAGE_BODY call:RUNSQL %ZV_OWNER% @trunk/DB_source/ZV_OWNER/package/p_zc_prices-b.sql call:RUNSQL %ZV_OWNER% @trunk/DB_source/ZV_OWNER/package/p_legal_persons-b.sql echo [INSTALLER] Installation finished. GOTO :EOF :RUNSQL ...etc...
  12. 12. Setup file Folder of collected files (either .sh, or .bat or .sql) Magnet List of deleted files Updated repository Consolidated log messages
  13. 13. Thank you! Martins.Kemme (at)