DB2 incremental online backup and recovery

  Why should we carry out on-line incremental backups » 

  Online backup means that the time to allow other types of connections, rather than Tingdiao database 

  Incremental means that do not need to back up every time a large database. 

  At the same time means that you can return to the database before the collapse of the state, not your last backup of the state, reduce the maximum possible data loss. 

  On-line database set up to support the incremental backup 

  db2 online incremental backups need for a type of archive records, rather than recycling record type, and db2 create a database records the use of the default type, it is necessary to set up archive records there are two types: 

  •   Changes logretain for recovery or on, 
  •   To change for the on userexit 

  This db2 logs will not be recycled, but growing, so will be able to engage incremental backup and restore to the collapse of the database point in time 

  db2 incremental backups need to tracemod is on, this database will be recorded on the page in the physical changes of some pages, so dirty tag 

  Below is a script can set these: 

  connect to testdb; 
  update db cfg using logretain on; 
  update db cfg using trackmod on; 
  db2stop force; 

  Normally should set up a backup db2 mirrorlogpath logs, 

  update db cfg using mirrologpath you think that the path to safety 

  How to conduct online backup » 

  backup db testdb online to back up the path (full backup) 

  backup db testdb online incremental to backup path (incremental backup) 

  backup db testdb online incremental delta to back up the path (delta backup) 

  How to use the backup file restoration » 

  1. View backup files point in time, and verify that it is available 

  db2ckbkp-hd: \ db2bak \ TEST.0 \ DB2 \ NODE0000 \ CATN0000 \ 20050523 \ 225141.001 

  2. Db2 tell you to restore order sequence 

  db2ckrst-d test2-r database-t 20050529210521 

  3. Implementation of the last orders given by the command sequence 

  The database will revert to backup the moment, after the implementation of the log should be before the roller (At this point in a database linked to the former Roller temporary status, will not be able to use) 

  rollforward db testdb to end of logs and complete 

  Of course, if you do not need to think before rolling (the last time this backup will be lost after the change), can also 

  rollforward db testdb stop 

  Published in 2005, 06月18æ—¥10:15 AM 

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • DZone
  • Netvouz
  • NewsVine
  • Technorati

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button