• Is it possible to have db2 alternate restore on different system wi

    From aarti.karve@gmail.com@21:1/5 to aarti...@gmail.com on Fri Sep 30 09:55:15 2016
    We managed to Take an out of place restore using ON = new restore loaction option on db2 Restore command

    Thanks enveryone
    On Friday, September 30, 2016 at 3:17:51 PM UTC+5:30, aarti...@gmail.com wrote:
    On Thursday, September 29, 2016 at 12:26:34 PM UTC+5:30, aarti...@gmail.com wrote:
    Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1 Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1

    Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).

    Is such a restore supported by db2 as we are seeing following error?


    SQL1277W A redirected restore operation is being performed. During a table space restore, only table spaces being restored can have their paths reconfigured. During a database restore, storage group storage paths and DMS
    table space containers can be reconfigured.
    DB20000I The RESTORE DATABASE command completed successfully.

    [db2inst1@XXX scripts]$ db2 restore db sample continue
    SQL1051N The path "/home/db2inst1" does not exist or is not valid. SQLSTATE=57019


    Thanks
    Aarti

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Lennart Jonsson@21:1/5 to aarti.karve@gmail.com on Sun Oct 2 10:04:50 2016
    On 09/29/2016 08:56 AM, aarti.karve@gmail.com wrote:
    Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1 Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1

    Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).

    Is such a restore supported by db2 as we are seeing following error?


    In general I find it easiest to let db2 generate a script from the
    backup image:

    db2 restore db aa redirect generate script aa.sql

    and then modify aa.sql so that it corresponds to the target

    /Lennart

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aarti.karve@gmail.com@21:1/5 to aarti...@gmail.com on Mon Oct 3 05:46:12 2016
    On Thursday, September 29, 2016 at 12:26:34 PM UTC+5:30, aarti...@gmail.com wrote:
    Prod db (source db2) : hosted on linux 6.X : installation : /home/db2inst1 Dev db (target db2) : hosted on linux 6.X : installation :/home/db2/db2inst1

    Our requirement is to perform an alternate db2 restore from Sourcedb2 (/home/db2inst1) to target db2 (/home/db2/db2inst1).

    Is such a restore supported by db2 as we are seeing following error?


    SQL1277W A redirected restore operation is being performed. During a table space restore, only table spaces being restored can have their paths reconfigured. During a database restore, storage group storage paths and DMS table space containers can be reconfigured.
    DB20000I The RESTORE DATABASE command completed successfully.

    [db2inst1@XXX scripts]$ db2 restore db sample continue
    SQL1051N The path "/home/db2inst1" does not exist or is not valid. SQLSTATE=57019


    Thanks
    Aarti

    Hi All

    We have used a command to generate the script and then updated the "ON" param with destination directory path
    db2 "restore db sample from /tmp/sample_Local/backup taken at 20160930022308 into test redirect generate script test.txt

    and then re-run a command
    db2 -tvf test.txt

    Things to keep in mind are:
    1. ensure the backup has been taken with the - permission = any
    2. ensure the destination folder has permissions as that of the db2inst1 example:
    ls -lrt /tmp/destination_restore/
    total 4
    drwxrwxr-x 3 db2inst1 db2iadm1 4096 Oct 3 13:33 db2inst1

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)