Monday, January 25, 2010

Database History File



[ Team LiB ]






Database History File


Recovery log files and the recovery history file are created automatically when a database is created. These log files are important if you need to recover data that is lost or damaged. You cannot directly modify a recovery log file or the recovery history file; however, you can delete entries from the recovery history file using the PRUNE HISTORY command. You can also use the rec_his_retentn database configuration parameter to specify the number of days that the recovery history file will be retained. The recovery history file is automatically updated whenever any of the following operations occur:


  • A database (or table spaces) is backed up.

  • A database (or table spaces) is restored.

  • A database (or table spaces) is rolled forward.

  • A table space is created.

  • A table space is altered.

  • A table space is quiesced.

  • A table space is renamed.

  • A table space is dropped.

  • A table is loaded.

  • A table is dropped.

  • A table is reorganized.


The file contains a summary of the backup information that can be used in case all or part of the database must be recovered to a given point in time. The information in the file includes


  • The copied part of the database and how it was copied

  • The time the copy was made

  • The location of the copy

  • The last time a restore was done


Every backup operation includes a copy of the recovery history file, which is linked to the database. Dropping a database deletes the recovery history file. Restoring data doesn't overwrite an existing history recovery file.


If the current database is unusable or unavailable and the associated history file is damaged or deleted, you can follow these steps to restore the file:






  1. Open the Journal. Click on the Journal option in the Control Center's toolbar or choose Start Programs IBM DB2 General Administration Tools Journal.


  2. Click the Database History tab to see the Database History files, as shown in Figure 16.26.



    Figure 16.26. The Journal's Database History page.






  3. In the Restore Database Recovery History Wizard, select an entry, right-click it, and select Restore to invoke the Restore image.



The recovery history file helps you locate information when you've performed a backup. For example, it can help you determine the location of a backup or in which backup a DB2 object can be found. If a backup is moved to different media�say, from disk to tape�this file can be updated to keep track of the new location of the backup.


Every DB2 backup contains a copy of this file, and it can be restored from any backup. If you choose to restore it, use caution to avoid overwriting the database's existing history file.


Note



Although the recovery history file is an ASCII file, manually editing the file should be done only at your own risk and isn't recommended.




Log files and the recovery history file are created automatically when a database is created. You cannot modify a log file or the recover history file; however, they are important should you need to use your database backup to recover lost or damaged data.






    [ Team LiB ]



    No comments: