Hitachi

Hitachi Advanced Database Setup and Operation Guide


12.3.2 Moving audit trail files (to audit trail long-term storage directory)

This subsection describes how to move audit trail files from the audit trail storage directory to the audit trail long-term storage directory.

The HADB administrator moves files that are older than the auditing period from the audit trail storage directory to the audit trail long-term storage directory.

Use the following procedure to move audit trail files:

■ Procedure for moving audit trail files
  1. Copy the audit trail files from the audit trail storage directory to the audit trail long-term storage directory.

  2. When the copy process has completed, delete the audit trail files at the source.

As needed, you can also use the gzip command of the OS to compress the audit trail files in the audit trail long-term storage directory.

The following is an example of moving audit trail files.

■ Example of moving audit trail files

In this example, audit trail files that have been stored for one year are moved from the audit trail storage directory (/mnt/audittrail/shorttimesavearea/audit_bak) to the audit trail long-term storage directory (/mnt/audittrail/longtimesavearea/audit_bak).

  1. Create a list of audit trail files that need to be moved.

    Using the find command of the OS, search for audit trail files that have been stored in the audit trail storage directory for a year, and create a list of audit trail files (/home/adbmanager/tmp/auditfilelist.txt) that need to be moved.

    find /mnt/audittrail/shorttimesavearea/audit_bak \
        -name "adbaud-????????-??????-???*.aud" -and -mtime 365 \
        > /home/adbmanager/tmp/auditfilelist.txt
  2. Copy the audit trail files that need to be moved.

    Use the cp command of the OS to copy all of the files in the list (/home/adbmanager/tmp/auditfilelist.txt) from the audit trail storage directory to the audit trail long-term storage directory.

    while read filename ; do
      cp ${filename} /mnt/audittrail/longtimesavearea/audit_bak
    done < /home/adbmanager/tmp/auditfilelist.txt
  3. Delete the audit trail files for which the copy process has completed.

    When the copy process has completed, use the rm command of the OS to delete the source files from the audit trail storage directory.

    while read filename ; do
      rm ${filename}
    done < /home/adbmanager/tmp/auditfilelist.txt
  4. Compress the audit trail files that you moved.

    Use the gzip command of the OS to compress the audit trail files you moved to the audit trail long-term storage directory.

    gzip /mnt/audittrail/longtimesavearea/audit_bak/*.aud
  5. Delete the list of audit trail files that need to be moved.

    Using the rm command of the OS, delete the list you created in step 1 (/home/adbmanager/tmp/auditfilelist.txt) of audit trail files that need to be moved.

    rm /home/adbmanager/tmp/auditfilelist.txt