[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
System Management Guide: Operating System and Devices

Fixing tacct Errors

If you are using the accounting system to charge user 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.

Prerequisites

You must have root user or adm group authority.

Patch a tacct File

  1. Move to the /var/adm/acct/sum directory:
    cd /var/adm/acct/sum
  2. Use the prtacct command to check the total accounting file, tacctprev:
    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 all right, 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:
    acctmerg -i < tacct.new > tacct.mmdd
  5. Create the tacct file again:
    acctmerg tacctprev < tacct.mmdd > tacct

[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]