Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2003
    Location
    Thailand
    Posts
    42

    Cool Unanswered: Suggest me online backup

    1.I never been online backup. Usually I backup offline and export data.
    Please suggest me online backup ,transaction backup and restore it .


    Thank you so mush

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Based on the experiences of some people on this forum, I would say that on-line backup should only be used if you cannot force users off the system because of system availability requirements. If you do use on-line backups, you probably should practice recovery scenarios (including roll forward recovery) on a test system.

  3. #3
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    We have at the moment the off-line backup. But like Marcus_A said we have the problem of 24 X 7. So the users at some point must be forced off the system to execute the off-line backup.

    There is one big difference with off-line backup and on-line backup.
    If something goes wrong (!!!) then the data can be restored to last backup with off-line backup option. So this means if you make a off-line backup one's a day (just say at the morning) and the crash appears at the evening then the data from the morning to the evening are permanently lost!

    With on-line backup there is LOGRETAIN option set to ON. This means that logs are not reused after the end of transaction - logs retain. So you can make restore to the time you wish (just say 1 minutes before crash).

    Because of log retain (on-line backup) you have to make sure to have enough disk space to save all the necesery logs.

    To enable the on-line backup do the following:
    1. Change parameters of LOGRETAIN and USEREXIT to ON
    db2 update db cfg for database using logretain on
    db2 update db cfg for database using userexit on

    2. Restart the database
    db2stop force
    db2start

    3. First you have to make the off-line backup before you can make the on-line backup because your database becomes to "backup pending state".
    db2 backup database database to c:\\directory

    4. On-line backup command
    db2 backup database database online to c:\\directory without prompting

    5. You have to backup non-active logs to the external media (for test to the diferent directory). You have to do this with operating system command: copy!!!

    6. Connect
    db2 connect to database user user using password

    All this procedure is for Windows environment. On UNIX systems just replace the "c:\\directory" to the "/directory".

    Disabling the on-line backup.
    If you would like to disable the on-line backup do the following:
    1. Turn off LOGRETAIN and USEREXIT
    db2 update db cfg for database using logretain off
    db2 update db cfg for database using userexit off

    2. Restart database
    db2stop force
    db2start

    3. Connect
    db2 connect to database user user using password

    Hope this helps,
    Grofaty

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    As Grofaty mentioned, with on-line backups you must use LOGRETAIN, but one can use LOGRETAIN even with off-line backups to enable roll forward recovery. Roll forward recovery using the logs (after a restore of a backup) is NOT restricted to the type of backup if LOGRETAIN is set up properly.

  5. #5
    Join Date
    Jan 2003
    Posts
    1,605
    Hi,

    Marcus_A you are totaly corect. The roll forward recovery is posible no mather if you do on-line backup or off-line backup.

    The main diferent between on-line backup and off-line backup is that you have to force applications before making the off-line backup. With on-line backup there can be applications connected to database during backup process.

    So I would suggest to have on-line backup if 24 x 7 system availability is reguired. If there are no such reguirements then is no need of on-line backup.

    There is also one advantage of using on-line backup - automation process. You can shedule backup when ever you wish. With off-line backup there is problem with connected applications, because forcing application is asynchronous. So writting the batch program to force applications and make backup can be challengeble.

    Hope this helps,
    Grofaty

  6. #6
    Join Date
    Mar 2003
    Posts
    343
    One word of caution about online backups - make sure you retain the logs which were active during the backup. The o/p of the list history backup gives the earliest log and the current log. However, there could be transactions spanning over several logs before the earliest and after the current which is why you might need all logs. Also, take online backups with the knowledge that the database may not be consistent - that is the reason the logs are required for recovery.

  7. #7
    Join Date
    Mar 2003
    Posts
    343

    Question

    Marcus_A and Grofaty,

    If an offline back is taken of a database configured for online backups which is partitioned, then the catalog node has to be backed up first. Two questions a] Does the offline backup fail if a user gets in inbetween or does it wait for the user to disconnect? b] So, for a large DB there could be a significant time difference between the catalog node backup and the rest of the nodes - how does db2 sync up? If the backup was an online backup, then, the restore would have to be followed with a rollforward to the minimum point in time. Does this apply to the offline backup of the online db?

Posting Permissions

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