Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Join Date
    Dec 2012
    Posts
    53

    Unanswered: db2 redirect restore

    Hi all

    I need steps to perform redirect restore

    Myscenario:

    i have to databases one on prod and another on quality and db names are different on two servers.
    all the table spaces on prod are "managed by automatic "

    restore command that i know is

    "db2 restore db prd from /backup_path taken at <timestamp> into quality redirect generate script <filename> "
    how to edit the table spaces in script file. if i am not wrong the storage paths for tablespaces managed by automatic will be generated by db only.
    so how can i edit the paths in script file? please help me its very urgent...

    thanks

  2. #2
    Join Date
    Sep 2012
    Posts
    177
    Chaitanya,

    Try to run the command:

    for ex:

    1 ) db2 restore db YYY from /tisdev/temp taken at 20130111234814 into UUU redirect generate script UUU.CLP without rolling forward

    2 ) db2 -tvf UUU.CLP

    By using VI editor try to change the path of the tablespace storage paths..

    Thanks,
    laxman..

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    if you want to keep automatic storage : the path can be set with the path option in restore
    command
    see : RESTORE DATABASE - IBM DB2 9.7 for Linux, UNIX, and Windows
    redirected is not needed (can be used for sample of options)
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  4. #4
    Join Date
    Apr 2012
    Posts
    156
    Just did this the other day,
    db2 RESTORE DATABASE prd FROM /backup_path TAKEN AT 20121219161003 ON 'new storage path 1' , 'new storage path 2' into quality

  5. #5
    Join Date
    Dec 2012
    Posts
    53
    thanks every one for your suggestions, i am going try today, if any error occurs please help me with that. I need some doccument for monitiring the health of db from cmd prompt. if any one have please forward to my mail-- chaitanya2487@gmail.com

  6. #6
    Join Date
    Dec 2012
    Posts
    53
    I have 35 tablespaces, in that 2 are SMS remaining all are managed by automatic. I have to do redirect restore or restore with on path ?

  7. #7
    Join Date
    Apr 2012
    Posts
    156
    That is handled as follows:
    1. db2 RESTORE DATABASE prd FROM /backup_path TAKEN AT 20121219161003 ON 'new storage path 1' , 'new storage path 2' into quality
    2. When you hit enter DB2 will come back with a message saying you can set any containers that need to be changed. (not sure the exact message but something to that effect)
    3. You can change the SMS tablespaces at this point with the following command:
    db2 SET TABLESPACE CONTAINERS FOR 1 USING ( PATH 'New_Path' );

    4. After setting the containers for the SMS tablespace you need to continue the restore with the following command:
    db2 RESTORE DATABASE prd CONTINUE;

    **Note the restore continue command uses the prd db as the name at this point.
    **Make sure you know the tablespace number for each SMS tablespace you will be changing the path on.

  8. #8
    Join Date
    Dec 2012
    Posts
    53
    on Prd the structure is like /db2- in that we have /db2prd and /prd and in /prd i have /tbsp1,/tbsp2,/tbsp3,/tbsptemp defined for table space storage.

    My concern is in restore command-- ON <path> which paths ihave to specify
    or
    is there any command to extract definition of db command used to create on prd.

  9. #9
    Join Date
    Apr 2012
    Posts
    156
    Not sure on the concern, you just specify the new paths. If you have 4 paths on production and your path on the new system will be different you just supply the path(s). To generate the redirected restore script you can do the following:
    restore db prd FROM /backup_path TAKEN AT 20121219161003 redirect
    generate script REDIRECT_RESTORE_SCRIPT.txt
    This will generate a file with everything you need. This is documented at:
    IBM DB2 9.7 Information Center for Linux, UNIX, and Windows

  10. #10
    Join Date
    Dec 2012
    Posts
    53
    due to some problems task has been postponed to today
    I have small doubt after restoring from prd to quality, will db name on quality will change or remain same.
    please please help urgent

  11. #11
    Join Date
    Apr 2012
    Posts
    156
    The dbname will be whatever you restore into. If you restore into a db with the same name it will have that name, if you restore into a different name it will have that name. If you need more info, send the command you are planning on running and we can tell you what your command will do.

  12. #12
    Join Date
    Dec 2012
    Posts
    53
    thanks for reply
    I did the restore, completed sucessfully

  13. #13
    Join Date
    Feb 2013
    Posts
    10
    I did restore using "db2 restore db ABCD from c:\TEMP\foo taken at 20130131111652 on C: into ABCD logtarget C:\TEMP\logs". However I do not understand why files on in differect directories. Eg. C:\DB2\ABCD\T0000X and C:\DB2\SQL00004 and C:\DB2\SQLDBDIR.

    Also 2nd question, why when do I"db2 list tablespace containers for 4", it still has "G:" instead of "C:"?

    Thanks

  14. #14
    Join Date
    Feb 2013
    Posts
    10
    so I did "db2 set tablespace containers for 4 using (path 'C:\DB2\ABCD\T0000004\C0000000.USR')"

    SQL20319N command SET TABLESPACE CONTAINERS are not allowed for tablespace with automatic storage. SQLSTATE = 55061

    Then I did "db2 list tablespaces", I got

    Table space ID = 4
    Name = TAB16K
    Type = Database managed space
    Contents = All permanent data. GENERAL
    igt tablespace.
    Mode = 0x2001100
    Detailed explanation:
    outstanding reload
    Storage must be defined
    Memory can be defined


    What did I do wrong here, help please? Thanks.

  15. #15
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    for automatic storage you redirect the restore with path as option of restore command
    set ts containers is only for sms-dms and non-automatic
    list tablespace does not show the automatic storage setting
    use a sysibmadm view to show this
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •