473,761 Members | 6,993 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PRUNE HISTORY question

UDB LUW (Windows) 8.1 FP9a

I issued a PRUNE HISTORY 20050819 AND DELETE and was surprised to see
that the archived log files were not physically deleted. The history
record of the 20050818 backup was correctly deleted from the history
file. I then issued a PRUNE LOGFILE PRIOR TO Snnnnnnn.LOG command which
did delete the logs. Both commands completed with no errors. LOGRETAIN
parameter is set to RECOVERY.

What does the 'AND DELETE' option do?
Phil Sherman
Nov 12 '05 #1
3 10483
Is AND DELETE really right?
A look up in the Command Ref. gives:
Command Syntax
-PRUNE----+-HISTORY--timestamp----+--------------------+-+---><
| '-WITH FORCE OPTION--' |
'-LOGFILE PRIOR TO--log-file-name--------------'
So, I'm wondering??Than ks, Pierre.
--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"Phil Sherman" <ps******@ameri tech.net> a écrit dans le message de news:
k4************* **@newssvr22.ne ws.prodigy.net. .. UDB LUW (Windows) 8.1 FP9a

I issued a PRUNE HISTORY 20050819 AND DELETE and was surprised to see that
the archived log files were not physically deleted. The history record of
the 20050818 backup was correctly deleted from the history file. I then
issued a PRUNE LOGFILE PRIOR TO Snnnnnnn.LOG command which did delete the
logs. Both commands completed with no errors. LOGRETAIN parameter is set
to RECOVERY.

What does the 'AND DELETE' option do?
Phil Sherman


Nov 12 '05 #2
My interpretation of the manual is that it's supposed to delete the log
files. This should avoid having to look up the first active log file in
the oldest backup in the history file to delete obselete logs.
From my manual:

IBM® DB2® Universal Database Command Reference Version 8.2 SC09-4828-01

Command syntax:
PRUNE HISTORY timestamp [WITH FORCE OPTION] [AND DELETE]
PRUNE LOGFILE PRIOR TO log-file-name

Command parameters:

HISTORY timestamp
Identifies a range of entries in the recovery history file that will be
deleted. A complete time stamp (in the form yyyymmddhhmmss) , or an
initial prefix (minimum yyyy) can be specified. All entries with time
stamps equal to or less than the time stamp provided are deleted from
the recovery history file.

WITH FORCE OPTION
Specifies that the entries will be pruned according to the time stamp
specified, even if some entries from the most recent restore set are
deleted from the file. A restore set is the most recent full database
backup including any restores of that backup image. If this parameter is
not specified, all entries from the backup image forward will be
maintained in the history.

AND DELETE
Specifies that the associated log archives will be physically deleted
(based on the location information) when the history file entry is
removed. This option is especially useful for ensuring that archive
storage space is recovered when log archives are no longer needed. Note:
If you are archiving logs via a user exit program, the logs cannot be
deleted using this option.

LOGFILE PRIOR TO
log-file-name Specifies a string for a log file name, for example
S0000100.LOG. All log files prior to (but not including) the specified
log file will be deleted. The LOGRETAIN database configuration parameter
must be set to RECOVERY or CAPTURE.

Phil Sherman
Pierre Saint-Jacques wrote:
Is AND DELETE really right?
A look up in the Command Ref. gives:
Command Syntax
-PRUNE----+-HISTORY--timestamp----+--------------------+-+---><


| '-WITH FORCE OPTION--' |
'-LOGFILE PRIOR TO--log-file-name--------------'
So, I'm wondering??Than ks, Pierre.

Nov 12 '05 #3
I stand corrected or should I say updated as I used the wrong version of
manuals.
I think, maybe, perhaps, ... the DELETE would then delete the log files in
the archive IF you use LOGARCHMETH1 or 2 in the parms.
To my way of thinking, this would be the only way that DB2 would know where
to find the log files to delete.

The parm. works with other parm (NUM_DB_BACKUPS ) = 3.
The timestamp will identify the oldest back entries to delete and their
associated logs if it is older (3) than the timestamp entry.

That's MHO but I can't verify from here, Pierre.

--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"Phil Sherman" <ps******@ameri tech.net> a écrit dans le message de news:
vQ************* **@newssvr22.ne ws.prodigy.net. ..
My interpretation of the manual is that it's supposed to delete the log
files. This should avoid having to look up the first active log file in
the oldest backup in the history file to delete obselete logs.
From my manual:

IBM® DB2® Universal Database Command Reference Version 8.2 SC09-4828-01

Command syntax:
PRUNE HISTORY timestamp [WITH FORCE OPTION] [AND DELETE]
PRUNE LOGFILE PRIOR TO log-file-name

Command parameters:

HISTORY timestamp
Identifies a range of entries in the recovery history file that will be
deleted. A complete time stamp (in the form yyyymmddhhmmss) , or an initial
prefix (minimum yyyy) can be specified. All entries with time stamps equal
to or less than the time stamp provided are deleted from the recovery
history file.

WITH FORCE OPTION
Specifies that the entries will be pruned according to the time stamp
specified, even if some entries from the most recent restore set are
deleted from the file. A restore set is the most recent full database
backup including any restores of that backup image. If this parameter is
not specified, all entries from the backup image forward will be
maintained in the history.

AND DELETE
Specifies that the associated log archives will be physically deleted
(based on the location information) when the history file entry is
removed. This option is especially useful for ensuring that archive
storage space is recovered when log archives are no longer needed. Note:
If you are archiving logs via a user exit program, the logs cannot be
deleted using this option.

LOGFILE PRIOR TO
log-file-name Specifies a string for a log file name, for example
S0000100.LOG. All log files prior to (but not including) the specified log
file will be deleted. The LOGRETAIN database configuration parameter must
be set to RECOVERY or CAPTURE.

Phil Sherman
Pierre Saint-Jacques wrote:
Is AND DELETE really right?
A look up in the Command Ref. gives:
Command Syntax
-PRUNE----+-HISTORY--timestamp----+--------------------+-+---><


| '-WITH FORCE OPTION--' |
'-LOGFILE PRIOR TO--log-file-name--------------'
So, I'm wondering??Than ks, Pierre.


Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2341
by: vbfoobar | last post by:
Hello, My question is: Is there an easy mean to make Python "command history" persistent across interpreter invokations? PS: In the case the question above is not clear, I rephrase it below verbosely... When I work from the Python prompt, I enjoy features
2
3398
by: bwmiller16 | last post by:
Guys - Does the PRUNE logfile command do anything other than just do a simple delete of the files? Or is there more to it internally in DB2? Thanks in Advance, -B
3
5777
by: pike | last post by:
DB2V8.1 (fp7a) on AIX 5.2. These files are taking up ca. 100KB, and I'd like to prune them. Is there a safe way to do this? Thank you for your advice.
3
1765
by: Girish Sahani | last post by:
hi ppl, Here is a simple function to remove those keys of a dictionary whose values are less than some specified value. But it isnt working. Please help. def prune(d,cp): l = for rule,value in d.iteritems(): #print value if value >= cp:
4
2684
by: Arne Garvander | last post by:
How can I prune double slashes from a string? <appSettings> <add key="pdfroot" value="p:\E-Switch Secure\PDF_dwgs\"/> </appSettings> string path = ConfigurationManager.AppSettings; path = path.Replace("\\\\", "\\"); // Doesn't work path = path.Replace(@"\\", @"\"); // Doesn't work -- Arne Garvander (I program VB.Net for fun and C# to get paid.)
0
1429
by: ummaria | last post by:
Hello, I have posted a question related to this problem before but I never got the full understanding of the concept. I would really appreciate if someone could help me, my deadline for the design of the project is in 2 days and I'm still having doubts :( The system I'm developing is a VB/ASP.NET web application connected to a MS SQL Server Express. The requirement is to be able to view a report that shows actions performed on all the...
0
1256
by: Nyh | last post by:
I tried to explain the best I can but it is very difficult to do. Here it goes. I have three history tables. Teacher, student and school. School and teacher, and school and student are linked together. I need to make a query that makes in one query a temporary table that list all the students that had a teacher change at some given date in the past. For example: If I give the query the following date 01/01/2007 it needs to give me all...
1
1480
by: Phydeux | last post by:
I've got a folder area on our file server (Win 2003) where our copiers deposit scans so users can pick them up. The structure is ..\Scanned Files\Username\ where the username is that user's name. Unfortunately not everyone cleans up after themselves, so I need a script that can prune out all the files older than 30 days but leave the folders. I plan to set this up as a scheduled task to be run each morning after backups run. I know...
0
1555
by: lemnitzer | last post by:
Full Article: http://iamthewitness.com/FreedmanFactsAreFacts.html <-------- KEY DOCUMENT Steamy Excerpts: Will you be patient with me while I review here as briefly as I can the history of that political emergence and disappearance of a nation from the pages of history?
0
9376
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10136
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9988
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8813
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7358
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6640
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3911
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3509
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.