Hitachi

Hitachi Advanced Database Setup and Operation Guide


12.7.4 Scheduled operations

The following operations need to be performed on a regular basis.

The following explains each of these operations in detail.

Organization of this subsection

(1) Moving audit trail files

The audit trail files in the audit trail directory need to be regularly moved to the audit trail storage directory. Based on the rules governing audit trail file retention determined in (3) Designing the directories used by the audit trail facility under 12.7.2 Design, audit trail files are moved to the audit trail storage directory when they are more than three months old.

Command execution example

find /mnt/audittrail/outputarea/audit -name "adbaud-*.aud" -and -mtime 93 -exec mv {} /mnt/audittrail/savearea/audit_bak \;
Important

The DB administrator performs this operation after logging in to the OS using the account of the HADB administrator.

(2) Deleting audit trail files

Audit trail files in the audit trail storage directory need to be deleted regularly. Based on the rules governing audit trail file retention determined in (3) Designing the directories used by the audit trail facility under 12.7.2 Design, audit trail files are deleted when they are more than a year old.

Command execution example

find /mnt/audittrail/savearea/audit_bak -name "adbaud-*.aud" -and -mtime 365 -exec rm -f {} \;
Important

The DB administrator performs this operation after logging in to the OS using the account of the HADB administrator.

You can automate the process of moving and deleting files by registering the following command in cron:

crontab -e
# The following are crontab settings. 
# Every day at 00:05, audit trail files older than three months are moved 
5 0 * * * /bin/find /mnt/audittrail/outputarea/audit -name "adbaud-*.aud" -and -mtime 93 -exec mv {} /mnt/audittrail/savearea/audit_bak \;
# Every day at 00:05, audit trail files older than one year are deleted 
5 0 * * * /bin/find /mnt/audittrail/savearea/audit_bak -name "adbaud-*.aud" -and -mtime 365 -exec rm -f {} \;