Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2003
    Posts
    78

    Unanswered: db2 list history backup command

    I'm curious about the list history command only I want the information in the last week. I've been looking in the command reference and they only use a hardcoded date. Does anyone know how to get it to work with the current date minus # days?


    db2 list history backup since 20080101 for database

    thanks for any help!

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    I don't know. But you could use the "date" utility to calculate the date 1 week ago and to format it according to the needs of LIST HISTORY.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  3. #3
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    there is a function that allows you to selct data from history file with sql
    SELECT * FROM TABLE(DB_HISTORY()) AS LIST_HISTORY
    in that case you can add where predicate and select data with days/date.. functions
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  4. #4
    Join Date
    Sep 2003
    Posts
    78
    Thanks, I used the db-history table like this:

    connect to rmdb5a user db2inst1 using ****;
    Select substr(comment,1,20), end_time
    from sysibmadm.DB_history
    Where comment like 'DB2 BACKUP%'
    Order by end_time desc
    FETCH FIRST 3 ROWS ONLY;
    connect reset;

    we never know until it's too late that our servers are down. I needed something to let me know if things were working and I also can quickly check out the backups.

Posting Permissions

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