Db2 for z/OS and its ecosystem

 View Only

Best practices for managing active logs in Db2 12 for z/OS and beyond

By Scott Lauritsen posted Wed June 01, 2022 06:28 PM

  

Best practices for managing active logs in Db2 12 for z/OS and beyond 

Recent Db2 releases have introduced many improvements to support ever-increasing workloads, and Db2 13 continues them.  With increasingly stringent recovery requirements and improved security capabilities, it might be a good time to take another look at how you manage active log data sets, and this blog entry is intended to help with that. 

Starting in Db2 12 at function level 500 or higher, you can increase the active log file size beyond the previous 4GB limit, up to 768GB.  As a former DBA, I really like the idea of going beyond 4GB active log data sets, but I suggest caution when allocating active logs larger than 256GB due to the increased archive log offload time.  When planning your active log sizing, you must balance the time it takes to offload from large active to archive logs, versus the reduced frequency of offloading to archive logs.   

 

In general, it is best to have 24 hours of active log data sets, and a minimum of 5 pairs of active logs.  More is better in case there are any archiving issues; therefore, I would be cautious about moving from many pairs of active logs to a very few larger pairs.  As always, it is best to test your solution to verify that you are getting the offload speed you want, while also maintaining enough adequately sized pairs for about 24 hours of active logs. 
 
Moving to larger active logs does require some SMS changes, analysis of your PRIQTY and SECQTY subsystem parameter settings, and PARMLIB considerations. See  Active log data sets storage requirements

Data set Limits for active logs 

The limit on how many active logs can be created is 93, but I prefer being well under that number of data sets and the larger active logs sizing can help accommodate such an approach.  Using well under the limit of 93 log pairs reduces your maintenance effort and allows the addition of more active logs in case of emergency. 

Encryption updates for active logs 

The process to add encrypted log data sets or update encrypted log data sets, to replace encryption keys with new keys, will be simplified with the new online delete support in Db2 13. See Encrypting log, catalog, and directory data sets with z/OS DFSMS data set encryption.  

Online delete for active logs in Db2 13 

Starting function level V13R1M500, Db2 13 supports new command parameters SET LOG REMOVELOG and DISPLAY LOG DETAIL to help simplify active log handling.  The new REMOVELOG option may require re-issuing if the data set is marked as removal pending during the first issuance.  If the user has a large data sharing group or the delete logs need to be completed within a very short time (such as changing encryption key all at once), the suggestion is to do it when the systems are quiet or have low activity levels.  For more information see, -SET LOG (Db2). 

Best practices for online handling of active logs in Db2 12 and before function level V13R1M500 


Deleting active logs:
  1. Stop Db2 member (might need to stop other members if they hold an ENQ on your active log). 
    You can issue the following command to identify them: 
         D GRS,RES=(*,<data-set-name>) 
  2. Run DSNJU004 to identify reusable active log datasets. 
  3. Run DSNJU003 DELETE to remove the active logs identified above. 
  4. Start the Db2 member. 
 

Adding new active logs: 

  1. Run DSNJU004 to identify an unused log data set number 
  2. Define new active log data sets 
  3. Format log data sets using program DSNJLOGF. (Strongly recommended but not required) 
  4. Use one of the following two options:  
  •          • Stop the Db2 member, run DSNJU003 NEWLOG to add the active log, and then start the Db2 member. 
                      • Issue the -SET LOG NEWLOG command. 

Deleting and re-adding active logs: 

  1. Stop Db2 member (might need to stop other members if they hold an ENQ on your active log).
    You can issue the following command to identify them: 
        
    D GRS,RES=(*,<data-set-name>) 
  2. Run DSNJU004 to identify reusable active log data sets. 
  3. Run DSNJU003 DELETE to remove the active logs identified above. 
  4. Rename active log data set (as a protective measure). 
  5. Define new active log data sets. 
  6. Format log data sets using program DSNJLOGF. (Strongly recommended but not required). 
  7. Run DSNJU003 NEWLOG to add the active log. 
  8. Start the Db2 member. 

 

Online handling for active logs in Db2 13 at function level 500 and later 

 
Deleting active logs: 

  1. Run DSNJU004 to identify potentially reusable active log data sets. 
  2. Issue the -DIS LOG DETAIL command to confirm not deleting the current active log. 
  3. Issue the -SET LOG REMOVELOG command.  If the log is flagged as removal pending, continue with the next step. Otherwise, if the log is deleted, you ‘re done. 
  4. Use the following commands to determine when the active logs marked as removal pending logs are no longer being used:
            • -DIS LOG DETAIL
            •
    D GRS,RES=(*,<data-set-name>)
  5. Re-issue the -SET LOG REMOVELOG command. 

    Adding new active logs: 

    1. Run DSNJU004 to identify an unused log dataset number 
    2. Define new active log data set 
    3. Format log data sets using program DSNJLOGF. (Strongly recommended but not required)  
    4. Db2 command -SET LOG NEWLOG command 


    More reading
     

    For more about managing the log, and the process for handling removal pending flags, be sure to also check out these topics in the Db2 13 documentation: 

     

    Acknowledgements 

    I would like to extend my appreciation to Paul McWilliams, Julie Chen, Sharon Roeder, and Haakon Roberts for their inputs and feedback that I incorporated into this blog. 

     

     


    #Db2forz/OS
    0 comments
    43 views

    Permalink