How DB2 uses Locks to control Concurrency

Three different causes for concurrency in DB2.

  1. Lost updates- Two procesess A and B Accessing same row. A is updated the row, and then B also updates the same row. So A ‘s updates are lost.
  2. Accessing data which is not committed
  3. Unrepeatable read- without concurrency causes you to get different data each time you read.

    Because of all the above reasons DB2 apply Locks on all resources, to avoid Accessing data before even committing.

    Use of REBALANCE in REORG Utility

    The REBALANCE parameter in REORG utility is it balance the data between table space partitions.

    Three major benefits of REORG utility.

    • If you run REORG utility on index table space, it improves index performance
    • If you run REORG UTILTY on table space ,it optimizes data on table space
    • If you run REORG utility on LOB table space, it removes embedded free space, and makes pages contiguous.

    How to review COBOL program

    Sr.Developers main task is reviewing COBOL programs. The main point is as a reviewer you need to know points to consider for review.

    1.  First point is change log . The developer should write change log and his tag in change history
    2. Code alignment in the program. Beginning from ID division till exit-program or stop -Run,developer has to write program in such a way that readable to others
    3. Always look for , if developer commented out old code, with proper developer tag. Once review is done, he can remove old code.
    4. Program is written in top down approach or not
    5. The new changes should not damage old logic
    6. Evaluate and if condions should be reviewed carefully. Especially ‘and’, ‘or’ conditions.
    7. In the Copy books you need to review Redefine clauses properly. Else, the data may be overlapped with wrong data
    8.  Finally to verify if program is compiled and load module is created successfully.