Managing the Log and Diagnostic Files on Exadata Cloud at Customer

The software components in Oracle Database Exadata Cloud at Customer generate a variety of log and diagnostic files, and not all these files are automatically archived and purged. Thus, managing the identification and removal of these files to avoid running out of file storage space is an important administrative task.

Database deployments on Exadata Cloud at Customer include the cleandblogs script to simplify this administrative task. The script runs daily as a cron job on each compute node to archive key files and remove old log and diagnostic files.

The cleandblogs script operates by using the adrci (Automatic Diagnostic Repository [ADR] Command Interpreter) tool to identify and purge target diagnostic folders and files for each Oracle Home listed in /etc/oratab. It also targets Oracle Net Listener logs, audit files and core dumps.

On Exadata Cloud at Customer, the script is run separately as the oracle user to clean log and diagnostic files that are associated with Oracle Database, and as the grid user to clean log and diagnostic files that are associated with Oracle Grid Infrastructure.

The cleandblogs script uses a configuration file to determine how long to retain each type of log or diagnostic file. You can edit the file to change the default retention periods. The file is located at /var/opt/oracle/cleandb/cleandblogs.cfg on each compute node.

The following table lists the parameters that appear in the cleandblogs.cfg file, providing a description and the default retention period in days for each file type.

Parameter Description and Default Value

AlertRetention

Alert log (alert_instance.log) retention value in days.

Default value: 14

ListenerRetention

Listener log (listener.log) retention value in days.

Default value: 14

AuditRetentionDB

Database audit (*.aud) retention value in days.

Default value: 1

CoreRetention

Core dump/files (*.cmdp*) retention value in days.

Default value: 7

TraceRetention

Trace file (*.tr* and *.prf) retention value in days.

Default value: 7

longpRetention

Data designated in the Automatic Diagnostic Repository (ADR) as having a long life (the LONGP_POLICY attribute). For information about ADR, see "Automatic Diagnostic Repository (ADR)" in Oracle Database Administrator's Guide for Release 18, 12.2, 12.1 or 11.2.

Default value: 14

shortpRetention

Data designated in the Automatic Diagnostic Repository (ADR) as having a short life (the SHORTP_POLICY attribute). For information about ADR, see "Automatic Diagnostic Repository (ADR)" in Oracle Database Administrator's Guide for Release 18, 12.2, 12.1 or 11.2.

Default value: 7

LogRetention

Log file retention in days for files under /var/opt/oracle/log and log files in ACFS under /var/opt/oracle/dbaas_acfs/log.

Default value: 14

LogDirRetention

cleandblogs log file retention in days.

Default value: 14

ScratchRetention

Temporary file retention in days for files under /scratch.

Default value: 7

Archiving Alert Logs and Listener Logs

When cleaning up alert and listener logs, cleandblogs first archives and compresses the logs, operating as follows:

  1. The current log file is copied to an archive file that ends with a date stamp.

  2. The current log file is emptied.

  3. The archive file is compressed using gzip.

  4. Any existing compressed archive files older than the retention period are deleted.

Running the cleandblogs Script Manually

The cleandblogs script automatically runs daily on each compute node, but you can also run the script manually if the need arises.

  1. Connect to the compute node as the oracle user to clean log and diagnostic files that are associated with Oracle Database, or connect as the grid user to clean log and diagnostic files that are associated with Oracle Grid Infrastructure.

    For detailed instructions, see Connecting to a Compute Node Through Secure Shell (SSH).

  2. Change to the directory containing the cleandblogs script:

    $ cd /var/opt/oracle/cleandb
  3. Run the cleandblogs script:

    $ ./cleandblogs.pl

    When running the script manually, you can specify an alternate configuration file to use instead of cleandblogs.cfg by using the --pfile option:

    $ ./cleandblogs.pl --pfile config-file-name
  4. Close your connection to the compute node:

    $ exit