Fixing tacct errors

If you are using the accounting system to charge users for system resources, the integrity of the /var/adm/acct/sum/tacct file is quite important. Occasionally, mysterious tacct records appear that contain negative numbers, duplicate user numbers, or a user number of 65,535. You can fix these problems.

You must have root user or adm group authority.
To patch a tacct file, perform the following steps:
  1. Move to the /var/adm/acct/sum directory by typing:
    cd /var/adm/acct/sum
  2. Use the prtacct command to check the total accounting file, tacctprev, by typing:
    prtacct tacctprev
    The prtacct command formats and displays the tacctprev file so that you can check connect time, process time, disk usage, and printer usage.
  3. If the tacctprev file looks correct, change the latest tacct .mmdd file from a binary file to an ASCII file. In the following example, the acctmerg command converts the tacct.mmdd file to an ASCII file named tacct.new:
    acctmerg -v < tacct.mmdd > tacct.new
    Note: The acctmerg command with the -a flag also produces ASCII output. The -v flag produces more precise notation for floating-point numbers.

    The acctmerg command is used to merge the intermediate accounting record reports into a cumulative total report (tacct). This cumulative total is the source from which the monacct command produces the ASCII monthly summary report. Since the monacct command procedure removes all the tacct.mmdd files, you recreate the tacct file by merging these files.

  4. Edit the tacct.new file to remove the bad records and write duplicate user number records to another file by typing:
    acctmerg -i < tacct.new > tacct.mmdd
  5. Create the tacct file again by typing:
    acctmerg tacctprev < tacct.mmdd > tacct