Informix

Informix

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

 View Only
  • 1.  Backup smartblobs seperate and move from 11.70 to 14.10

    Posted Thu October 05, 2023 05:12 AM

    Hello,

    is there a smooth way to backup smartblobs from 11.70 to 14.10 (different server)?

    System would be RHEL7 and RHEL8

    Thanks



    ------------------------------
    Marc Demhartner
    ------------------------------


  • 2.  RE: Backup smartblobs seperate and move from 11.70 to 14.10

    Posted Thu October 05, 2023 06:51 AM

    If the smartblob spaces are logged, and the table has a primary key, you can use ER to move the table from one server to a new one and maintain them in sync until turnover!



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 3.  RE: Backup smartblobs seperate and move from 11.70 to 14.10

    Posted Thu October 05, 2023 08:13 AM

    Thanks but this would be cold backup with manual move to different server



    ------------------------------
    Marc Demhartner
    ------------------------------



  • 4.  RE: Backup smartblobs seperate and move from 11.70 to 14.10

    Posted Thu October 05, 2023 08:23 AM

    Ahh. Then unload by insertingbthe data into an external table and reload by reading from an external table.



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 5.  RE: Backup smartblobs seperate and move from 11.70 to 14.10

    Posted Thu October 05, 2023 09:04 AM

    Ok, that step i wanted to avoid. Is there a way to use dbexport or dbunload ?



    ------------------------------
    Marc Demhartner
    ------------------------------



  • 6.  RE: Backup smartblobs seperate and move from 11.70 to 14.10

    Posted Thu October 05, 2023 10:15 AM

    dbexport can do it, but it only exports the entire database so not a single table or handful of tables. There is no dbunload, only dbload.

    You can use myexport in external table mode. If you don't want to have to hand build the external tables, myschema can generate them for you:

    art@Elezar-II:~/GoogleDrive/MyConsulting/Scripts$ myschema -d art -t systables --export-scripts /dev/null
    Writing full schema DDL to:       /dev/null
    art@Elezar-II:~/GoogleDrive/MyConsulting/Scripts$ dir art.systables.export.sql
    -rw-rw-r-- 1 art art 827 Oct  5 10:14 art.systables.export.sql
    art@Elezar-II:~/GoogleDrive/MyConsulting/Scripts$ cat art.systables.export.sql
    CREATE EXTERNAL TABLE IF NOT EXISTS systables_external (  
           tabname VARCHAR(128,0),
           owner CHAR(32),
           partnum INTEGER,
           tabid SERIAL(3421),
           rowsize SMALLINT,
           ncols SMALLINT,
           nindexes SMALLINT,
           nrows FLOAT,
           created DATE,
           version INTEGER,
           tabtype CHAR(1),
           locklevel CHAR(1),
           npused FLOAT,
           fextsize INTEGER,
           nextsize INTEGER,
           flags SMALLINT,
           site VARCHAR(128,0),
           dbname VARCHAR(128,0),
           type_xid INTEGER,
           am_id INTEGER,
           pagesize INTEGER,
           ustlowts DATETIME YEAR TO FRACTION(5),
           secpolicyid INTEGER,
           protgranularity CHAR(1),
           statchange SMALLINT,
           statlevel CHAR(1)
    ) USING ( FORMAT "DELIMITED",  
       DATAFILES ( "disk:/home/art/GoogleDrive/MyConsulting/Scripts/systables.unl" ),  
       DELIMITER "|", DELUXE, ESCAPE ON );  
    INSERT INTO systables_myexport  
       SELECT * FROM systables;
    DROP TABLE systables_myexport;



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 7.  RE: Backup smartblobs seperate and move from 11.70 to 14.10

    Posted Thu October 05, 2023 10:17 AM

    Oops, that got away from me. You may have to edit the file to add a path to the blob file location, see the SQL Syntax manual for details.



    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 8.  RE: Backup smartblobs seperate and move from 11.70 to 14.10

    Posted Fri October 06, 2023 05:54 AM

    There is a separate file per smart blob column in the same location as the main external table file, following the same conventions as the UNLOAD statement:

    https://www.ibm.com/docs/en/informix-servers/14.10?topic=file-unloading-smart-large-objects

    See also another easier way to use this:

    https://www.oninitgroup.com/faq-items/load-and-unload-functions



    ------------------------------
    Doug Lawry
    Oninit Consulting
    ------------------------------