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 command to delete old logs for disk space ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-02-09, 12:03
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
DB2 command to delete old logs for disk space ?

Hi Guys,


I am having an error in db2diag.log as

Quote:
INSTANCE: DB2 NODE : 000
EDUID : 7852
FUNCTION: DB2 Common, OSSe, ossFileDelete, probe:40
MESSAGE : ECF=0x9000003F=-1879048129=ECF_FILE_SHARE
File sharing violation
CALLED : OS, -, DeleteFile
OSERR : 32 "The process cannot access the file because it is being used by another process."
DATA #1 : String, 41 bytes
C:\SQLLIB\\DB2DAS00\tmp\stm1178\s2lo.2744
DATA #2 : String, 105 bytes
Search for ossError*Analysis probe point after this log entry for further
self-diagnosis of this problem.

2009-11-02-06.29.01.675000-300 I5256F316 LEVEL: Error
PID : 2744 TID : 7852 PROC : db2dasstm.exe
INSTANCE: DB2 NODE : 000
EDUID : 7852
FUNCTION: DB2 Tools, DB2 administration server, handleRunCmd, probe:100
DATA #1 : signed integer, 4 bytes
-1879048129

2009-11-02-06.29.01.706000-300 I5574F673 LEVEL: Error (OS)
PID : 2744 TID : 7852 PROC : db2dasstm.exe
INSTANCE: DB2 NODE : 000
EDUID : 7852
FUNCTION: DB2 Common, OSSe, ossFileDelete, probe:40
MESSAGE : ECF=0x9000003F=-1879048129=ECF_FILE_SHARE
File sharing violation
CALLED : OS, -, DeleteFile
OSERR : 32 "The process cannot access the file because it is being used by another process."
DATA #1 : String, 42 bytes
C:\SQLLIB\\DB2DAS00\tmp\stm1178\s2lo.12744
DATA #2 : String, 105 bytes
Search for ossError*Analysis probe point after this log entry for further
self-diagnosis of this problem.

2009-11-02-06.29.01.706000-300 I6249F316 LEVEL: Error
PID : 2744 TID : 7852 PROC : db2dasstm.exe
INSTANCE: DB2 NODE : 000
EDUID : 7852
FUNCTION: DB2 Tools, DB2 administration server, handleRunCmd, probe:110
DATA #1 : signed integer, 4 bytes
-1879048129
This started appearing after I had setup delete logs windows scheduler job that uses FORFILES command to delete logs older than 2 days.

However, I am not sure if I am right.

Is there a way to purge old logs via DB2 ??

We want to keep 2 days logs only because disk space limitation.

DB2 V 9.5 FP4 on Windows Server 2k3

Thanks
DBFinder
Reply With Quote
  #2 (permalink)  
Old 11-02-09, 23:00
db2girl db2girl is offline
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 1,816
You can use the prune command, but it only works with the logs in the active log directory. You can use db2adutl if you archive them to TSM.
Reply With Quote
  #3 (permalink)  
Old 11-03-09, 17:07
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Do you mean transaction logs?
If yes, you seem to be deleting more than what you intended ... You are trying to delete files being used by db2 tools db.
For space, I would delete transaction logs from archive directory and files from db2dump directory. Make sure you understand the implications deleting transaction logs if you want to recover from a backup.
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 11-03-09, 17:22
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Yes, Transaction Logs.

I delete 2 days old logs at 12:05 am by a batch file which uses FORFILES command.
My question is that, when we are not archieving logs, which other utilities might be needing logs ??

Secondly, is it possible that I may delete via DB2 instead of OS directly. That way DB2 will know that this file has been removed.

Please advise,
Regards
DBFinder
Reply With Quote
  #5 (permalink)  
Old 11-03-09, 17:26
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Quote:
Originally Posted by db2girl View Post
You can use the prune command, but it only works with the logs in the active log directory. You can use db2adutl if you archive them to TSM.
Thanks Bella,

You provided me what I needed. We have both kind of setup. One is archieved and one is not.

Thanks again

DBFinder
Reply With Quote
  #6 (permalink)  
Old 11-03-09, 17:41
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Also, search for auto_del_rec_obj in db2 9.5 documentation
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 11-04-09, 03:43
DBFinder DBFinder is offline
Registered User
 
Join Date: Sep 2008
Location: Toronto,Canada
Posts: 606
Thanks sathyaram,

The entry in diaglog relates to auto_maint. Nothing to do with transaction logs.

Thanks for help anyway
DBFinder
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