Home > AS/400 Tips > iSeries administrator tips > Get rid of deleted records and improve performance
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

Get rid of deleted records and improve performance


John Kohan
10.10.2000
Rating: -3.76- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


As with most things in life, as your databases grow older, the larger and slower they become. The good news is that you can do something about it.

As programs delete records from the database, DB2/400 (unless told otherwise) just "marks" the record as deleted. Because these records are just "flagged" and not really deleted, they take up space and can affect your system's performance.

You can reclaim the storage space these records take up and get the DASD and performance back. First you need to identify the physical files that contain deleted records. IBM provides a command to do just that: "Display File Description" (DSPFD). If you run this command for all physical files in a given library to an outfile, you can query that file and see which files you want to reorganize.

Run the command with the following parameters:

DSPFD FILE(FILELIB/*ALL) TYPE(*MBR) OUTPUT(*OUTFILE) FILEATR(*PF) OUTFILE (YOURLIB/YOURFILE)

You can now query the data by running "RUNQRY *N YOURLIB/YOURFILE". Press F20 a few times, and you will see a column heading of "Deleted Records". This field will display the number of deleted records in each file. To calculate the approximate amount of space you will recover, take the number of deleted records and multiply that by the Maximum Record Length also found in the outfile.

Now that you have identified the files that are wasting space, the next step is to reclaim that DASD. IBM again provides a command to do that. The command is "Reorganize Physical File Member" (RGZPFM). This command will remove the deleted records, which will reduce the size of your physical file.

Before running this command, you will need an exclusive lock on this file. No one will have access to the file that is reorganizing until it is complete. Also, if during the reorganization the job is interrupted, you may possibly lose your data. Therefore, you should run this process right after a full backup of the files -- and during off-hours. This process can take several hours, depending on the size of the file and the speed of your processor.

The RGZPFM command will reorganize one file. To start this process, run RGZPFM FILE(FILELIB/FILE). I recommend you enter RGZPFM, press F4, then place your cursor on the heading at the top of the screen and press F1. This displays the IBM help text, which explains what this command will do and how it will do it.

You'd be surprised at the amount of DASD and performance improvement some systems experience from this. Depending how your software is written, the impact could be huge.

About the author
Kohan is a senior programmer analyst for a software development company. He has worked with the AS/400 since 1990 and has learned how to use the platform to solve business problems.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Systems Management
Can you trust all those trigger programs?
Are your backups complete?
Controlling remote command processing
Watch your profiles
Avoid locking issues
Send message to users at a remote site
Security journal receiver management
Top 10 backup commands
Tracking critical file access in real time
Create an iSeries Access image and update it with the latest Service Pack

iSeries administrator tips
Translating Linux for IBM i admins: Using GUI to make it easy
Translating Linux for IBM i admins: Working with jobs and networking
OpenOffice: What to know before making the transition from Microsoft Office
OpenOffice: An enterprise open source solution
Database performance comparisons on IBM i
Translating Linux for IBM i admins: User profile commands
Modern System i reports using Client Access
Tips for installing Lotus Domino server on a System i partition
The iSeries Blog has a new home on IT Knowledge Exchange
Virtualization for IBM i: Backups

DB2 UDB for iSeries
Expert advice on DB2
Make your database easy to read
Top 10 tips from our experts
DB2 expert Kent Milligan offers advice
Schedule stored procedures in DB2 UDB
Special features make creating tables simple
How to use DB2's cross-reference files to help manage your database -- Part II
How to use DB2's cross-reference files to help manage your database -- Part I
Revisit your database naming conventions
DB2/400 and DB2 UDB

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts