Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1

    Unanswered: restore database on another machine and other tablespaces

    Good afternoon,
    I've done a backup online in a database and now I have to restore it to another machine with different tablespaces, can someone tell me the steps to take?
    I have DB2 8 and AIX 5.3

    Greetings and thank you very much.
    DBA DB2 for LUW

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    It is called a redirected restore. Look it up in the manual.

    Andy

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    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
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Hello Colleagues,
    I have a backup online with their logs and want to restore that backup to another machine I have an instance called the same as the backup, but the tablespaces and containers are different. Can anyone tell me the steps I should follow to have my database on another machine?

    Thank you very much for your help.
    DBA DB2 for LUW

  5. #5
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by georgipa View Post
    Hello Colleagues,
    I have a backup online with their logs and want to restore that backup to another machine I have an instance called the same as the backup, but the tablespaces and containers are different. Can anyone tell me the steps I should follow to have my database on another machine?

    Thank you very much for your help.
    This has been answered twice. Look in the manual and it will give you examples.

    Andy

  6. #6
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    do you have a problem with scrolling back in the answers ??
    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

  7. #7
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    to run a restore of the database I have to bring me all the tablespaces of the database where the backup or did some tablespaces?

    Thank you very much for your help.
    DBA DB2 for LUW

  8. #8
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by georgipa View Post
    to run a restore of the database I have to bring me all the tablespaces of the database where the backup or did some tablespaces?

    Thank you very much for your help.
    I am sorry, I do not understand the question.

    Andy

  9. #9
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    on the machine where I did the backup I have these tablespaces:

    Tablespaces for Current Database

    Tablespace ID = 0
    Name = SYSCATSPACE
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 8022
    Useable pages = 8022
    Used pages = 8022
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2005-10-07-08.33.32.000000

    Tablespace ID = 1
    Name = TEMPSPACE1
    Type = System managed space
    Contents = System Temporary data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 1
    Useable pages = 1
    Used pages = 1
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1

    Tablespace ID = 2
    Name = USERSPACE1
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 225
    Useable pages = 225
    Used pages = 225
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2011-12-19-10.15.04.000000

    Tablespace ID = 3
    Name = TSUDATOS
    Type = Database managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 3276800
    Useable pages = 3276672
    Used pages = 2463936
    Free pages = 812736
    High water mark (pages) = 2621312
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 4
    Minimum recovery time = 2012-01-19-11.19.05.000000

    Tablespace ID = 4
    Name = TSUINDICES
    Type = Database managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 1900544
    Useable pages = 1900480
    Used pages = 1142336
    Free pages = 758144
    High water mark (pages) = 1546016
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 2
    Minimum recovery time = 2005-06-16-09.58.34.000000

    Tablespace ID = 5
    Name = SYSTOOLSPACE
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 111
    Useable pages = 111
    Used pages = 111
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2011-02-01-10.02.01.000000

    Tablespace ID = 6
    Name = SYSTOOLSTMPSPACE
    Type = System managed space
    Contents = User Temporary data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 1
    Useable pages = 1
    Used pages = 1
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2005-10-24-10.40.10.000000

    Tablespace ID = 7
    Name = BACKUPTS
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 57
    Useable pages = 57
    Used pages = 57
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2006-06-22-14.23.10.000000

    Tablespace ID = 8
    Name = UOWTS
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 119
    Useable pages = 119
    Used pages = 119
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2006-06-22-14.49.25.000000

    Tablespace ID = 9
    Name = OTHERTS
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 10835
    Useable pages = 10835
    Used pages = 10835
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2006-06-22-14.49.25.000000

    Tablespace ID = 10
    Name = TSSNAP02
    Type = System managed space
    Contents = Any data
    State = 0x0000
    Detailed explanation:
    Normal
    Total pages = 2
    Useable pages = 2
    Used pages = 2
    Free pages = Not applicable
    High water mark (pages) = Not applicable
    Page size (bytes) = 4096
    Extent size (pages) = 32
    Prefetch size (pages) = 32
    Number of containers = 1
    Minimum recovery time = 2006-06-22-14.49.24.000000

    my question is whether in the restore I have to tell all tablespaces in the backup that I have or I can tell you some. the route of the container where I will run the restore is different.
    I've never done a restore redirect why these doubts.

    Greetings.
    DBA DB2 for LUW

  10. #10
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    For each container in the backup image, if the location is different on the restore, then you have to specify what the new container is. If all of them need to change, then you have to specify all of them in the restore.

    Andy

  11. #11
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    In v8, when restoring into a new db, you have to restore all tablespaces. Just do a redirected restore (restore... redirect, set containers... restore continue). If some tablespaces are using automatic storage, they're redefined using ON parameter. See example here: http://www.dbforums.com/db2/1643310-db2move-tuning.html

    If you get stuck, provide the following:

    source server:
    db2pd -d <db name> -tab

    target server:
    df -g

  12. #12
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    thank you very much for your quick response.
    The database already exists on the machine where I run the restore.
    Greetings.
    DBA DB2 for LUW

  13. #13
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Hi Colleagues,

    I am restoring my database with this command:

    db2 "restore database ulises from /UlisesBORRAR/BACKUP_ULISESRR TAKEN AT 20120708150002 to /UlisesBORRAR/ulises into ulises2 redirect without prompting"

    and show me this message error:

    SQL1277N Restore has detected that one or more table space containers are
    inaccessible, or has set their state to 'storage must be defined'.
    DB20000I The RESTORE DATABASE command completed successfully.

    Thank you for you help.
    DBA DB2 for LUW

  14. #14
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Quote Originally Posted by georgipa View Post
    Hi Colleagues,

    I am restoring my database with this command:

    db2 "restore database ulises from /UlisesBORRAR/BACKUP_ULISESRR TAKEN AT 20120708150002 to /UlisesBORRAR/ulises into ulises2 redirect without prompting"

    and show me this message error:

    SQL1277N Restore has detected that one or more table space containers are
    inaccessible, or has set their state to 'storage must be defined'.
    DB20000I The RESTORE DATABASE command completed successfully.

    Thank you for you help.
    Do you get this error on the RESTORE command above or on a subsequent command?

    Andy

  15. #15
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    this is the first command I run to restore my database.
    Greetings.
    DBA DB2 for LUW

Posting Permissions

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