If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > db2 list history backup command

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-12-08, 15:43
chinatrain99 chinatrain99 is offline
Registered User
 
Join Date: Sep 2003
Posts: 73
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!
Reply With Quote
  #2 (permalink)  
Old 08-12-08, 15:52
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #3 (permalink)  
Old 08-13-08, 02:06
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
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
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #4 (permalink)  
Old 08-15-08, 10:57
chinatrain99 chinatrain99 is offline
Registered User
 
Join Date: Sep 2003
Posts: 73
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On