How to clean up a dictionary or other area that is running out of space?

Document ID : KB000050546
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Areas may eventually run out of available space, and actions can be taken to either free space or add more space to the area. For dictionary areas, additional steps can be taken to remove outdated or unused entity occurrences.

Solution:

Any database area which is running short of available space may contain logically deleted records (LDELs). Physically removing LDELs is an excellent first step in trying to make more space available in the area. The way to do that is to use the CLEANUP utility statement. The CLEANUP utility physically erases logically deleted records from all or some areas in a database segment. The syntax for this (in BCF or OCF) is:

 CLEANUP SEGMENT segment-name ________>   
   >___ USING subschema-name _________>   
   >_ _________________________ ______><;   
   | ______,______ |   
      |_ AREA __v_ area-name _|_ 

As you can see, you can run it for the entire database segment or you can specify it just for a particular area. More details of this utility can be located in the CA-IDMS Utilities manual, section 5.5: CLEANUP.

Before running this utility it may be desirable to determine the number of LDELs which it will process. The recommendation is to run PRINT SPACE with the FULL option, or IDMSDBAN, to determine the actual number of LDELs in each area. Both IDMSDBAN and the PRINT SPACE FULL utility report the same number of logically deleted records in an area, which is different than the number the CLEANUP utility reports. The number of LDELs reported in CLEANUP messages UT011020 and UT011021 reflect the number of LDELs encountered by the CLEANUP utility. Due to the architecture of how LDELs are removed, multiple LDELs might get removed for each one counted by the utility. To obtain an accurate count of the number of LDELs processed by the CLEANUP utility, an IDMSDBAN or PRINT SPACE FULL report should be created for the requested area(s), both before and after the execution of the CLEANUP utility. The LDEL count produced by IDMSDBAN/PRINT SPACE FULL is accurate. The count produced by CLEANUP only mentions the LDELs found by CLEANUP module itself, and not necessarily the total number of LDELs processed.

After running CLEANUP, it is often helpful to run a Print Space report on the area to see how much space is available.

If the area in question is a dictionary area, then the data occupying it is actually metadata: definitions of records, element, and other entities. Since dictionary entities are often used for testing and development, some of the data in this area may no longer be relevant; or may be related to older versions of production entities, which are no longer used. If the goal is to free as much space as possible, then it may also be advisable to remove any entity occurrences which still exist, but which are no longer being used. These are often associated with a userid for individuals no longer employed by the company. There are several ways to identify candidate occurrences, but the simplest is in IDD to issue a statement like this: DIS ALL <entity> WHERE PREPARED BY = '<userid>'.

If you have any users who are no longer employed at your site, or users who may have a lot of old definitions still present but not being used, you could run this type statement to see the schemas, records, elements, etc, that they created. For folks no longer at the site you could delete them outright (unless you think others may be using them); for current employees you can forward the search results to them, asking them to delete anything they're no longer using.

After any unused entities have been deleted, you could run CLEANUP again, then a PRINT SPACE. That will give you a truer sense of how much space is available. If it's not enough, we usually recommend using an UNLOAD/ RELOAD to add more pages to the area for a more permanent change, instead of using an EXPAND PAGE or EXTEND SPACE.

To summarize, several steps can help provide more space in an existing area:

  1. 1- First, if this is a dictionary area, you may wish to delete any entities possible, which are no longer being used.

    1. A good step to DIS ALL <entity> WHERE PREPARED BY = 'userid', in IDD.

    2. For users no longer employed, delete any entities no longer in use.

    3. Send reports to current employees asking them to delete anything unused.

  2. Run IDMSDBAN or a PRINT SPACE FULL report to determine the number of logically deleted records (LDELs) in the area.

  3. If LDELs exist, run CLEANUP utility to remove all logically deleted records.

  4. Run IDMSDBAN or a PRINT SPACE FULL report to verify that no more logically deleted records (LDELs) exist in the area.

  5. Run PRINT SPACE report to see the available space in the area.

  6. Finally, if more space is still required, we recommend that you follow the instructions in the Database Administration Guide, section 27.5, to increase the number of pages in the area, using UNLOAD/RELOAD to do so.