Db2

 View Only
  • 1.  DB2 12.1 not able to restore DB2REMOTE backup from Minio

    Posted 7 days ago
    Edited by Ondřej Žižka 7 days ago

    I was able to configure MinIO to be able to backup Db2 database to that location.

    [db2inst1@db2121 ~]$ db2 backup database test to DB2REMOTE://minio//
    
    Backup successful. The timestamp for this backup image is : 20241210070932
    
    [db2inst1@db2121 ~]$ db2 archive log for database test
    DB20000I  The ARCHIVE LOG command completed successfully.

    Info about the location

    [db2inst1@db2121 ~]$ db2 list storage access
    
     Node Directory
    
    Node 1 entry:
    
    ALIAS=minio
    VENDOR=S3
    SERVER=https://minio.example.com
    USERID=****
    CONTAINER=informix-backup
    OBJECT=
    DBUSER=
    DBGROUP=SYSADM
    
     Number of entries in the directory = 1
    
    DB20000I  The LIST STORAGE ACCESS command completed successfully.

    Unfortunately, it is not possible to restore using a remote location. I dropped the database TEST before.

    [db2inst1@db2121 ~]$ db2 restore database test from DB2REMOTE://minio// taken at 20241210070932
    SQL2542N  No match for a database image file was found based on the source 
    database alias "TEST" and timestamp "20241210070932" provided.

    In the db2diag file, there can be seen the following errors:

    2024-12-10-08.30.14.396667+060 I320926E485           LEVEL: Info
    PID     : 72992                TID : 140518092695104 PROC : db2sysc 0
    INSTANCE: db2inst1             NODE : 000            DB   : TEST
    APPHDL  : 0-269                APPID: *LOCAL.db2inst1.241210073014
    AUTHID  : DB2INST1             HOSTNAME: db2121
    EDUID   : 1783                 EDUNAME: db2med.187.0 (TEST) 0
    FUNCTION: DB2 UDB, oper system services, SqloCosClient::Initialize, probe:9
    DATA #1 : String, 5 bytes
    minio
    
    2024-12-10-08.30.14.435593+060 E321412E573           LEVEL: Error
    PID     : 72992                TID : 140518092695104 PROC : db2sysc 0
    INSTANCE: db2inst1             NODE : 000            DB   : TEST
    APPHDL  : 0-269                APPID: *LOCAL.db2inst1.241210073014
    AUTHID  : DB2INST1             HOSTNAME: db2121
    EDUID   : 1783                 EDUNAME: db2med.187.0 (TEST) 0
    FUNCTION: DB2 UDB, database utilities, sqluMCInitRestoreMC, probe:1289
    MESSAGE : Media controller -- Unable to initialize device 
              DB2REMOTE://minio/informix-backup// (zrc = 0x00000000)
    
    2024-12-10-08.30.14.435746+060 E321986E590           LEVEL: Error
    PID     : 72992                TID : 140518092695104 PROC : db2sysc 0
    INSTANCE: db2inst1             NODE : 000            DB   : TEST
    APPHDL  : 0-269                APPID: *LOCAL.db2inst1.241210073014
    AUTHID  : DB2INST1             HOSTNAME: db2121
    EDUID   : 1783                 EDUNAME: db2med.187.0 (TEST) 0
    FUNCTION: DB2 UDB, database utilities, sqluMCInitRestoreMC, probe:1289
    MESSAGE : SQL2542N  No match for a database image file was found based on the 
              source database alias "" and timestamp "" provided.
    
    2024-12-10-08.30.14.435851+060 E322577E496           LEVEL: Error
    PID     : 72992                TID : 140518092695104 PROC : db2sysc 0
    INSTANCE: db2inst1             NODE : 000            DB   : TEST
    APPHDL  : 0-269                APPID: *LOCAL.db2inst1.241210073014
    AUTHID  : DB2INST1             HOSTNAME: db2121
    EDUID   : 1783                 EDUNAME: db2med.187.0 (TEST) 0
    FUNCTION: DB2 UDB, database utilities, sqluMCInitRestoreMC, probe:1289
    DATA #1 : String, 19 bytes
    TEST.20241210070932
    
    2024-12-10-08.30.14.435989+060 E323074E600           LEVEL: Error
    PID     : 72992                TID : 140517992031808 PROC : db2sysc 0
    INSTANCE: db2inst1             NODE : 000            DB   : TEST
    APPHDL  : 0-269                APPID: *LOCAL.db2inst1.241210073014
    AUTHID  : DB2INST1             HOSTNAME: db2121
    EDUID   : 187                  EDUNAME: db2agent (TEST) 0
    FUNCTION: DB2 UDB, database utilities, sqludMRResponse, probe:1171
    MESSAGE : SQL2542N  No match for a database image file was found based on the 
              source database alias "TEST" and timestamp "20241210070932" provided.
    

    Database is the following version:

    [db2inst1@db2121 ~]$ db2level
    DB21085I  This instance or install (instance name, where applicable: 
    "db2inst1") uses "64" bits and DB2 code release "SQL12010" with level 
    identifier "02010110".
    Informational tokens are "DB2 v12.1.0.0", "special_50594", 
    "DYN2411071022AMD64_50594", and Fix Pack "0".
    Product is installed at "/opt/ibm/db2/V12.1".

    Have you ever met this issue before?

    Thank you for any advice.

    ------------------------------
    Ondřej
    ------------------------------



  • 2.  RE: DB2 12.1 not able to restore DB2REMOTE backup from Minio

    Posted 7 days ago

    The same situation happened with the following version of Db2.

    [db2inst1@db2121 ~]$ db2level
    DB21085I  This instance or install (instance name, where applicable: 
    "db2inst1") uses "64" bits and DB2 code release "SQL12010" with level 
    identifier "02010110".
    Informational tokens are "DB2 v12.1.0.0", "s2410070955", "DYN2410070955AMD64", 
    and Fix Pack "0".
    Product is installed at "/opt/ibm/db2/V12.1".

    MinIO version is RELEASE.2024-11-07T00-52-20Z.



    ------------------------------
    Ondřej
    ------------------------------



  • 3.  RE: DB2 12.1 not able to restore DB2REMOTE backup from Minio

    Posted 5 days ago

    Seems it is very fussy about exact paths.

    Did you study this item which shows Db2-LUW recovery from S3 working https://www.triton.co.uk/aws-s3-recovery-for-db2-luw/ 

    Please temporarily enable DIAGLEVEL 4 and repeat, to show the LEVEL:Info db2diag and Warning entries in addition to Errors.



    ------------------------------
    Mike O'Reilly
    ------------------------------



  • 4.  RE: DB2 12.1 not able to restore DB2REMOTE backup from Minio
    Best Answer

    Posted 4 days ago

    Thank you @Mike O'Reilly I followed the exact step and it started to work.

    The only difference between the steps in the article and the steps I did was the following.

    I did:

    db2 "backup db TESTDB to DB2REMOTE://minio//"

    In the article, there is:

    db2 "backup db TESTDB to DB2REMOTE://minio//TESTDB/"

    So the issue was, that I stored the backup in the root of the bucket which looks like it is not expected, but I did not find any note about that. 

    But now. I can backup and restore to Minio.

    Thank you for your help.



    ------------------------------
    Ondřej
    ------------------------------



  • 5.  RE: DB2 12.1 not able to restore DB2REMOTE backup from Minio

    Posted 5 days ago

    Yes.   I remember facing this before..    Unfortunately that's the sad true.    you can backup , but it's totally useless.   you can't restore from it.. 

    Wait,  why do you have backup policy anyway ?  Is it supposed to be used to restore when needed ? ohhh..    really  ? 



    ------------------------------
    Samuel Pizarro
    ------------------------------



  • 6.  RE: DB2 12.1 not able to restore DB2REMOTE backup from Minio

    Posted 4 days ago

    Hello @Samuel Pizarro. Please read my post above. Maybe it can help you as well.



    ------------------------------
    Ondřej
    ------------------------------



  • 7.  RE: DB2 12.1 not able to restore DB2REMOTE backup from Minio

    Posted 4 days ago

    Thank you @Ondřej Žižka  

    I just noticed now that you are using 12.1.  I faced this issue in a past project,  and I believe it was 10.5 with PureScale  by that time, and I was pretty sure it was not supported..  We had to move our backups to a NAS device using NFS instead.  

    Good to know that this limitation is now gone ! 

    Thanks 



    ------------------------------
    Samuel Pizarro
    ------------------------------



  • 8.  RE: DB2 12.1 not able to restore DB2REMOTE backup from Minio

    Posted 11 hours ago

    Thanks for mentioning this. We'll do some digging to determine what's happening.  I don't expect, obviously, that you should be able to successfully backup but not restore from those images.  We do have in-house test coverage of scenarios just like this and they appear to be working as expected when interacting with other S3 storage so there may (just a guess at this point) be something specific to MinIO getting in your way. 



    ------------------------------
    Kelly Rodger
    Program Director - Db2 Next Gen Analytics and Watson Query Development
    IBM Canada - Markham
    Markham
    ------------------------------