Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2009
    Location
    Calgary, AB Canada
    Posts
    38

    Unanswered: Working on restoring prod data in dev environment

    .....and it's not going as smoothly as I expected it.


    I can't use db2move because I don't have any sense of time, and would hate to copy the WHOLE db nightly, so I'm using restore/rollforward.

    I have a backup strategy of a full online backup on Sunday, and incremental deltas Monday-Saturday, which also include the 'include logs' option. After the backups finish nightly, I transfer them over to the dev system and perform:

    (Sunday)
    db2 -v "restore db $dbname from /db2i1_home/backup taken at $takenDate newlogpath /db2i1_home/backup/backup_log logtarget /db2i1_home/backup/backup_log replace history file "

    (Monday-Saturday)
    db2 -v "restore db $dbname incremental from /db2i1_home/backup taken at $takenDate newlogpath /db2i1_home/backup/backup_log logtarget /db2i1_home/backup/backup_log replace history file "


    Then I rollforward using the logs that (supposedly) are included in the backup image:

    db2 -v "rollforward db $dbname to end of backup and complete overflow log path (/db2i1_home/backup/backup_log) noretrieve"



    My issue is that sometimes this works and sometimes it doesn't, but I'm not changing anything. At times, I receive the error telling me it's looking for the next logfile (which supposedly the noretrieve takes care of).

    I guess my question is, am I going about this the right way? Is there another alternative that I'm not thinking about?

    Thanks.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    I believe that logtarget path needs to be empty each time you do a restore.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2009
    Location
    Zoetermeer, Holland
    Posts
    746
    Quote Originally Posted by Marcus_A View Post
    I believe that logtarget path needs to be empty each time you do a restore.
    Yes, and do not forget your "regular" log-path. This should be empty. Overflow log path only works if the regular log path cannot be used.

Posting Permissions

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