Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1

    Unanswered: how many logs are used in delete?

    Hi colleagues,
    I am using db2 9.7 and i executed a delete in table, I need to know how many logs are used in this delete?

    Thank you for advanced.
    DBA DB2 for LUW

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    You can calculate log space used. Something like this:
    Code:
    begin
      declare l_bytes bigint;
    
      select uow_log_space_used into l_bytes
      from table(mon_get_unit_of_work(mon_get_application_handle(), -1));
    
      delete ...;
    
      select uow_log_space_used - l_bytes into l_bytes
      from table(mon_get_unit_of_work(mon_get_application_handle(), -1));
    end/
    Regards,
    Mark.

  3. #3
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Hi colleagues,
    There is another way to know how many logs have been used in a transaction?

    Thank you for advanced.
    DBA DB2 for LUW

  4. #4
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    There is another way to know how many logs have been used in a transaction?
    Did you tried the suggestion?
    Quote Originally Posted by mark.b View Post
    Hi,

    You can calculate log space used. Something like this:
    Code:
    begin
      declare l_bytes bigint;
    
      select uow_log_space_used into l_bytes
      from table(mon_get_unit_of_work(mon_get_application_handle(), -1));
    
    ...
    
    end/
    And what results did you got from that?

    Note:
    The code might be not complete.
    You may want to add some more codes to get the results and display them.

  5. #5
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    If you are not able to change your application, then you can create an event monitor for unit of work.
    Then you format the output by the EVMON_FORMAT_UE_TO_TABLES procedure.

    You get the same uow_log_space_used element but for whole transaction...
    Regards,
    Mark.

Posting Permissions

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