Db2

Db2

Connect with Db2, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  Restoring VERY old Db2 Backups

    Posted 6 days ago

    I am hoping someone has dealt with this topic and has an easy answer.

    We are required to keep our Db2 backups for 35 years. (Not sure why, but sometimes, the government just has rules, let's just leave it at that).  So, I have never thought about it, but I was recently asked the question, "10 years from now, if we get a request to restore a backup taken today, would we be able to?".

    Well, I had a couple of thoughts that came to me that would inhibit the ability to restore, but the one I am wondering if any of you have dealt with is about Db2 Versions and restoring a database.  I have restored a v11.1 database to a v11.5 installation, and it does work.  But how far back could I expect to be compatible?  Could I restore a v9 or v10 database to v11.5 or even to v12?  How far back can a Db2Upgrade work?

    Any thought on this would be very helpful.  Thanks in advance.



    ------------------------------
    Edward Spencer
    ------------------------------


  • 2.  RE: Restoring VERY old Db2 Backups

    Posted 6 days ago

    Here are some of the migration strategies:

    1. V9.7 -> V10.5  (Backup/Restore);
    2. V10.5 -> V11.5 (backup/restore)

    or:

    1. Unload data from V9.7 (export or db2move);
    2. Run db2look to create script to re-create all db2 objects;
    3. run a/m script in V11.5 to create database and all objects;
    4. reload all data (import or LOAD).

      Try looking at Db2  load from cursor , by connecting cursor remotely.  Remember to reset any sequence, identity columns , etc. ... etc

      Actually -  most of the time (unless migrating from V11.x to V11.y (x <y)) - I would recommend rebuilding database(s) - one can catch some old artifacts no longer needed and review authorization/privileges to conform to current company security requirements ...


    ------------------------------
    Jan Nelken
    Db2 (LUW) DBA
    Open for work
    Katowice or Krakow
    +48 783 109 863
    ------------------------------



  • 3.  RE: Restoring VERY old Db2 Backups

    Posted 6 days ago

    I do hope those are offline backups for LUW, as you can't use online backups to restore to later versions. You also can't roll-forward logs through Db2 versions, as I'm sure you know.

    You also have fixpacks and changes between versions that may affect your ability to restore - 10.5 log and lsn changes come to mind.

    Anything older than 11.1 has to be restored/upgraded to Db2 10.5 Fix Pack 7 or later first, then upgraded to the later version.  (11.5 and 12.1 say the same thing) https://www.ibm.com/docs/en/db2/11.1.0?topic=servers-recovering-through-db2-server-upgrade

    I had to ponder this issue a few years back for a financial institute.  My thoughts then were that you would need to archive the matching Db2 installation media alongside those backups, or you may well struggle with the restores. Also whatever build info applied to the servers and/or database installations.  Other problems then arise in that you need a compatible OS for the Db2 installation, compatible hardware etc.  You may be able to get around that with VM images, but it will be messy.  If it is just the data that needs to be retained for 35 years, then export to CSV, compress and store with the DDL for the tables. Db2 backups from older versions are going to be tedious if you need to retrieve them 10+ years from now. Not to mention all the security holes from using old versions.

    Short answer - 10 years, maybe, but with effort.  More than that you may very well need your friendly neighbourhood IBM support to help out with installation images etc.

    Cheers



    ------------------------------
    Greg Palgrave
    ------------------------------



  • 4.  RE: Restoring VERY old Db2 Backups

    Posted 6 days ago
    Hi Edward,

    platform please?

    There are OBIDs and PSIDs of relevance here. The best option is to have the original DB2 Catalogs backed up to go with your backups. On z/OS we can restore to newly defined objects with some translation. Other platforms offer other things, and a set of container images with the right releases come to mind.

    best regards,





  • 5.  RE: Restoring VERY old Db2 Backups

    Posted 6 days ago

    For the reason stated in the replied responses your best option if you must retain this data that long would be to Unload the data for each table into file along with a  2nd file of DDL (DB2Look to copy the DDL).  When I have done this I copy the whole database DDL then issue IXF exports on the tables.   These export are not fast depending on the size of the object and could cause some contention issues.    

    As stated (Due to releases, online vs offline, fixpacks, OS migrations, Changes/Depreciation to the SQL ) the backup can't be uses and are worthless at this point.  If for some reason if you would need to recover the old information you would need the software/fixpack for LUW not to mention the Computer environment to install the software on as the software may not be able to be installed on modern day hardware.



    ------------------------------
    Douglas Partch
    CEO
    Database Nerds
    Omaha NE
    ------------------------------



  • 6.  RE: Restoring VERY old Db2 Backups

    Posted 5 days ago

    Hi Edward,

    all of it is said already. Export the data with DDL and hopefully with a text description of the data model. All binary stuff won't survive that long. Actually a former customer of mine (gov too) is doing this in that way.

    35 years ago for Db2 LUW this would be OS/2 with extended edition. DB2 for Windows wasn't out then. A friend of mine was successful to get OS/2 running in a VMware container, but sometimes such software might not run on nowadays hardware anymore.

    The data from the first landing on the moon is still available, but almost unreadable as the data fields and hardware is not available anymore.

    So export to ASCII (or UTF-8!) is the way to go.

    Cheers



    ------------------------------
    Roland Schock
    IBM Champion and IBM Gold Consultant
    ------------------------------