Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655

    Unanswered: DB2 command to delete old logs for disk space ?

    Hi Guys,


    I am having an error in db2diag.log as

    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

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    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.

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  4. #4
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    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

  5. #5
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    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

  6. #6
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    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.

  7. #7
    Join Date
    Sep 2008
    Location
    Toronto,Canada
    Posts
    655
    Thanks sathyaram,

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

    Thanks for help anyway
    DBFinder

Posting Permissions

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