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
Expand all | Collapse all

Ontape restore with differenct Db Chunk spaces

  • 1.  Ontape restore with differenct Db Chunk spaces

    Posted 4 days ago

    Hi all, hopefully this is an easy one for you all, but getting a straight answer at our end is eluding us.

    Periodically, we do a Live to Test restore of a level 0 backup. We are using ontape for the backup and restore.

    We've recently had a situation where the DB chunk names and spaces are different between Live and one of our test systems. 

    1. can we use an ontape restore to restore where there are different Db chunks on the target system?
    2. if so, what is the right procedure / process / commands?
    3. if not, what would be the best approach to resolve and align the chunks on the target system (e.g. at time of next restore)

    note that we've done restores successfully many times in the past, but the DB Chunks have always been in alignment.

    below are the errors we received the last time we tried this with the different Db chunk names:

    - Cannot open Chunk: '/data/dbs/erp/erpdata/erp_erpdata_8.dbs'

    - Cannot Open Primary Chunk '/data/dbs/erp/erpdata/erp_erpdata_8.dbs', errno = 2

    below are the commands we usually use for the restore

    • onmode k
    • ontape –r
    • onmode –m

    Any help or guidance appreciated.

    ps.  we think the answer is option 3, above...

    Many thanks!

    mark



    ------------------------------
    Mark Clayton
    ------------------------------


  • 2.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 4 days ago

    Hi Mark,

    This is very achievable.  Take a look at the "rename" option when you run the ontape.  You can specify a mapping file to map the filenames of the chunks from the source system (prod) to the names of the chunks on the target system (test).

    The format of the file is:

    source-chunk source-offset target-chunk target-offset

    With the restore, run:  ontape -r -rename -f <mapping_file>

    Rename chunks during a restore - IBM Documentation



    ------------------------------
    Mike Walker
    xDB Systems, Inc
    www.xdbsystems.com
    ------------------------------



  • 3.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 4 days ago

    Hi Mike, thanks for the quick reply.  (we had a friendly bet running with my team that the community would answer our informix quicker than another [unnamed] party!)

    We'll review that option.  I take it the rename method aligns the import file chunk structure to be the same as the target system?  Is there way to re-align the target system chunk names to match that of the source (i.e. "destroy" the old chunks in the target, create new chunks then run the level0 restore)?

    Many thanks!

    mark



    ------------------------------
    Mark Clayton
    ------------------------------



  • 4.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 4 days ago

    Not automatically.  Assuming that you are using cooked files, you can just manually create empty files on your target that match the source system and the run the restore.  You don't need to actually add chunks to the target, just having the empty files there with the appropriate permissions and ownership is sufficient.  You will need to delete the old chunks to reclaim the space.  You can use symbolic links to point to your old chunks if you want to but that might be overcomplicating things.  Just remember that, unless you use a mapping file, all of the files listed on the source system as chunks must exist on the target system or the restore will fail.



    ------------------------------
    Mike Walker
    xDB Systems, Inc
    www.xdbsystems.com
    ------------------------------



  • 5.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 3 days ago

    Hi Mike, thanks for further advice.  We'll go down that path - we can do some tests and make sure we got it right.

    Cheers

    mark



    ------------------------------
    Mark Clayton
    ------------------------------



  • 6.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 4 days ago
    Mark:

    First, Mike's recommendation is the preferred fix for your problem.

    Next, the alternative, old school, solution, just for completeness and if anyone reading the thread has an older version of Informix that does not support redirected restores (ie the rename option) , you can create symbolic links at the original paths that point to the actual paths on the target restore system. 

    This might be the answer to your question about  a "way to re-align the target system chunk names to match that of the source (i.e. "destroy" the old chunks in the target, create new chunks". However, I'm not sure what you are asking here. A restore completely overwrites whatever was in the chunk files/devices, if anything, when you restore. You could just touch empty files with the original chunk paths if you have the space on those filesystems and do the restore that way, Is that what you are asking?

    Art



    Art S. Kagel, President and Principal Consultant
    ASK Database Management


    Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference.  Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves.









  • 7.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 3 days ago

    Hi Art, thanks for the reply and advise too.  We're on 12.10 so not too old.  We'll review as per Mike suggestion above.  I guess we want to keep the process simple and simple for the future as well. Appreciate the reply.

    Cheers

    mark



    ------------------------------
    Mark Clayton
    ------------------------------



  • 8.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 4 days ago
    Hi,

    It would help to know the version of the Informix the backup was done with.

    Wayne Martin




  • 9.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 3 days ago

    Hi Wayne, 12.10.  Thanks for the reply. as noted above we'll try and align via Mike's suggestion.  Cheers. mark



    ------------------------------
    Mark Clayton
    ------------------------------



  • 10.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 4 days ago
    Use the rename option under ontape either via command line or file

    originalpath offset targetpath offset

    or just create the  appropriate links

    ln -s targetpath originalpath

    Cheers
    Paul

    On 8/11/2025 10:23 PM, Mark Clayton via IBM TechXchange Community wrote:
    010001989c4e35e4-6fa339f8-b3aa-46b7-b76e-a81c15fbb861-000000@email.amazonses.com">
    Hi all, hopefully this is an easy one for you all, but getting a straight answer at our end is eluding us. Periodically, we do a Live to Test... -posted to the "Informix" group





  • 11.  RE: Ontape restore with differenct Db Chunk spaces

    Posted 3 days ago

    Hi Paul, thanks too for the reply and advice.  Appreciate that.

    Cheers, mark



    ------------------------------
    Mark Clayton
    ------------------------------