Personal tools
You are here: Home DB2 Scripts DB2 Shell Scripts to DB2 The recovery history file.
Navigation
Log in


Forgot your password?
 
Document Actions

The recovery history file.

The recovery history file keeps track of many useful events. Use scripts or administrative views to export and format the data contained in this file for future use.

Command syntax

Read syntax diagramSkip visual syntax diagram>>-LIST HISTORY--+-------------------+-------------------------->
    +-BACKUP------------+   
    +-ROLLFORWARD-------+   
    +-DROPPED TABLE-----+   
    +-LOAD--------------+   
    +-CREATE TABLESPACE-+   
    +-ALTER TABLESPACE--+   
    +-RENAME TABLESPACE-+   
    +-REORG-------------+   
    '-ARCHIVE LOG-------'   

>--+-ALL--------------------------------+----------------------->
   +-SINCE--timestamp-------------------+   
   '-CONTAINING--+-schema.object_name-+-'   
    '-object_name--------'    

>--FOR--+----------+--database-alias---------------------------><
    +-DATABASE-+   
    '-DB-------'

OBS: Be sure to prune the history file from time to time!


Here is a quick way to know what DDL were executed on your production DB:

db2 list history all for db MYPRODDB | grep DDL:

If you redirect the output to a file and/or insert the file into some other DB, you can keep an history of all the events returned by the list history command.

Another way to get information from the recovery history file is to use the administrative view:

db2 -x "SELECT EID, START_TIME, CMD_TEXT FROM SYSIBMADM.DB_HISTORY 
WHERE OPERATION IN ('A','N','O','T')" | tr -s " "
Security Awareness
Would you like your company to implement gamification into your security awareness program?





Polls