Db2 Tools for zOS

Db2 Tools for z/OS

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
Expand all | Collapse all

Reorg SHRLEVEL REFERENCe

  • 1.  Reorg SHRLEVEL REFERENCe

    Posted Wed August 28, 2024 12:25 PM

    Good day,

    I am assuming that there is no reason at all nowadays for making a reorg with the SHRLEVEL REFERENCE, am I wrong?

    Is there any case when it needs to be mandatory like that?

    I am reading manuals and presentations and if there's some case, I am not able to find or figure it out.

    Thanks!



    ------------------------------
    Soledad Martinez
    ------------------------------


  • 2.  RE: Reorg SHRLEVEL REFERENCe

    Posted Thu August 29, 2024 09:07 AM

    I can't recall the last time I ran a shrlevel reference reorg. If you can run any utility online as shrlevel change you should. (Maybe other than loads or certain image copies.) 



    ------------------------------
    Scott Walker
    Database Engineer IV - Db2 z/OS
    Navy Federal Credit Union
    Pensacola
    ------------------------------



  • 3.  RE: Reorg SHRLEVEL REFERENCe

    Posted Thu August 29, 2024 09:12 AM

    I noticed this is in the tools section. 

    1) If you are seeing shrlevel reference then it's probably a setting in the tool selection. 

    2) Any database change tool (I don't care the vendor) you should treat it as your assistant and always double check its work. Sometimes it will choose to drop/recreate when you know it can be done as an alter. Sometimes putting the change in slightly different will cause it to choose a different outcome. I've seen too many people over the years blindly take the results. Never do that.  On the flip side, sometimes you can run it and get hints such as list of packages to rebind etc. Anyway, I'm way off subject just wanted to share some related thoughts. 



    ------------------------------
    Scott Walker
    Database Engineer IV - Db2 z/OS
    Navy Federal Credit Union
    Pensacola
    ------------------------------



  • 4.  RE: Reorg SHRLEVEL REFERENCe

    Posted Thu August 29, 2024 02:16 PM
    For the most part, No.

    Share Level Change is the new best practice. Primary reason if something goes wrong it by far easier to fix or restart or terminate with not bad side effects. If something goes wrong with a SR you more than likely will need to recover the tablespace. That why if doing a SR, always take full copy before you start.

    Sent from my iPhone




  • 5.  RE: Reorg SHRLEVEL REFERENCe

    Posted Thu August 29, 2024 04:35 PM

    Hello,

    Yes, checking Bmc tools, Broadcom tools and even the ADM, none of them build their reorgs with a SHRLEVEL NONE/DATA-AVAILABLE NONE/REORGNONE by default, But it's curious that for IBM continue being the default, so the problem would be if you build one from scratch and forget to specify any other SHRLEVEL.

    The only point I found where it would be reaĺly needed is combined with REUSE:

    "REUSE - When used with SHRLEVEL NONE, specifies that REORG is to logically reset and reuse Db2-managed data sets without deleting and redefining them. If you do not specify REUSE and SHRLEVEL NONE, Db2 deletes and redefines Db2-managed data sets to reset them."

    But I cannot think about any situation I need to reuse them.

    Thank you very much for your inputs Scott, Douglas, very interesting!



    ------------------------------
    Soledad Martinez
    ------------------------------



  • 6.  RE: Reorg SHRLEVEL REFERENCe

    Posted Mon September 02, 2024 10:50 PM

    The only thing I'll add is that IBM will rarely change the defaults because many customers will have standard setups expecting those default so if they are changed they could experience unforeseen side effects …



    ------------------------------
    Bruce Williamson
    Senior DBA
    Commonwealth Bank of Australia
    Sydney NSW
    ------------------------------



  • 7.  RE: Reorg SHRLEVEL REFERENCe

    Posted Tue September 03, 2024 10:52 AM

    Hello Bruce,

    I was even thinking that at some point it will become deprecated. :-)

    But no, what you say makes more sense, thanks for this!



    ------------------------------
    Soledad Martinez
    ------------------------------



  • 8.  RE: Reorg SHRLEVEL REFERENCe

    Posted Tue September 03, 2024 04:02 AM

    You cannot run REORG SHRLEVEL CHANGE on a table space that is not logged (i.e., the table space has the LOGGED NO attribute). 

    In that case you have to run REORG SHRLEVEL REFERENCE and in some cases even a REORG SHRLEVEL NONE (if you want to do a part level REORG on a non-logged tablespace with NPIs). This is a very rare case, though. 

    See more info here: https://www.ibm.com/docs/en/db2-for-zos/13?topic=messages-dsnu1152i



    ------------------------------
    Jørn Thyssen
    Principal Solutions Advisor
    Rocket Software
    ------------------------------



  • 9.  RE: Reorg SHRLEVEL REFERENCe

    Posted Tue September 03, 2024 11:04 AM

    Hello Jørn,

    I had not thought about the not logged tablespaces at any moment, my fault, never have them in mind. Thank you so much for spotting this. 

    Now searching for also I found below Robert Caterrall's thread where just few months ago a person had this DSNU1152I message while doing such a reorg.

    Thank you very much!

    https://robertsdb2blog.blogspot.com/2010/12/reorg-and-db2-for-zos-partition-by.html?showComment=1712074384808&m=1#c6210101103208791395



    ------------------------------
    Soledad Martinez
    ------------------------------



  • 10.  RE: Reorg SHRLEVEL REFERENCe

    Posted Wed September 04, 2024 01:17 PM

    Hello Soledad and all,


    While there are some exception cases like NOT LOGGED table space, spatial index and expression index on LOB column which REORG does not support log apply today (and hence does not support SHRLEVEL CHANGE), I would say those scenarios are extremely limited and 99% of the users out there have always been using SHRLEVEL CHANGE for availability reason. 


    Having said that, if an end user can tolerate the read only outage caused by REORG SHRLEVEL REFERENCE execution, then running SHRLEVEL REFERENCE does give some additional performance incentive over SHRLEVEL CHANGE, as far as REORG performance is concerned.  For one thing, REORG does not utilize the mapping index for SHRLEVEL REFERENCE execution, so that's one less index to sort/build and lower the overall resource consumption by the REORG.  REORG SHRLEVEL REFERENCE would also avoid the LOG phase processing overhead altogether (unless it's running at the part level with a NPI on the tsp).   So if you are really nitpicking on optimizing REORG performance, SHRLEVEL REFERENCE could be appealing to you in some cases. 


    To be fair, a number of years/releases ago, Db2 development did try to initiate an effort to change the default SHRLEVEL NONE value to SHRLEVEL CHANGE for REORG, but it was met with immediate push back by the external communities for both resource consideration and potential impact to their existing workloads.  We might visit this again in the future but it might be in the context of deprecating SHRLEVEL NONE altogether. 

    Many thanks. 

    Ka Chun Ng
    STSM, Db2 for z/OS Development



    ------------------------------
    Ka Chun Ng
    ------------------------------



  • 11.  RE: Reorg SHRLEVEL REFERENCe

    Posted Thu September 05, 2024 10:58 AM

    Hello Ka Chun,

    Thanks for your reply and points, very interesting. Really appreciate also the explanation about why even IBM thinking about moving from NONE to CHANGE finally it was discarded for not being realistic due to some customers needs or concerns.

    Thank you very much!



    ------------------------------
    Soledad Martinez
    ------------------------------



  • 12.  RE: Reorg SHRLEVEL REFERENCe

    Posted Wed September 04, 2024 01:24 PM

    Hello Soledad and all,


    While there are some exception cases like NOT LOGGED table space, spatial index and expression index on LOB column which REORG does not support log apply today (and hence does not support SHRLEVEL CHANGE), I would say those scenarios are extremely limited and 99% of the users out there have always been using SHRLEVEL CHANGE for availability reason. 


    Having said that, if an end user can tolerate the read only outage caused by REORG SHRLEVEL REFERENCE execution, then running SHRLEVEL REFERENCE does give some additional performance incentive over SHRLEVEL CHANGE, as far as REORG performance is concerned.  For one thing, REORG does not utilize the mapping index for SHRLEVEL REFERENCE execution, so that's one less index to sort/build and lower the overall resource consumption by the REORG.  REORG SHRLEVEL REFERENCE would also avoid the LOG phase processing overhead altogether (unless it's running at the part level with a NPI on the tsp).   So if you are really nitpicking on optimizing REORG performance, SHRLEVEL REFERENCE could be appealing to you in some cases. 


    To be fair, a number of years/releases ago, Db2 development did try to initiate an effort to change the default SHRLEVEL NONE value to SHRLEVEL CHANGE for REORG, but it was met with immediate push back by the external communities for both resource consideration and potential impact to their existing workloads.  We might visit this again in the future but it might be in the context of deprecating SHRLEVEL NONE altogether. 

    Many thanks. 

    Ka Chun Ng
    STSM, Db2 for z/OS Development



    ------------------------------
    Ka Chun Ng
    ------------------------------