Managing the Log and Diagnostic Files on Database Classic Cloud Service
The software components in Oracle Database Classic Cloud Service 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 that host single-instance databases include the cleandblogs
script to simplify this administrative task. This script runs weekly as a crontab
job to archive key files and remove old log and diagnostic files. It uses a configuration file named cleandblogs.cfg
to determine how long to retain each kind of log or diagnostic file. You can edit this file to change the default retention periods. This file is located at /var/opt/oracle/cleandb/cleandblogs.cfg
.
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 |
---|---|
|
Alert log ( Default value in file: 14 |
|
Listener log ( Default value in file: 14 |
|
Database audit ( Default value in file: 1 |
|
Core dump/files ( Default value in file: 7 |
|
Trace file ( Default value in file: 7 |
|
Data designated in the Automatic Diagnostic Repository (ADR) as having a long life (the Default value in file: 30 |
|
Data designated in the Automatic Diagnostic Repository (ADR) as having a short life (the Default value in file: 7 |
|
Default value in file: 30 |
|
cleandblogs log file retention in days. Default value in file: 14 |
Archiving Alert Logs and Listener Logs
When cleaning up alert and listener logs, cleandblogs
first archives and compresses the logs, operating as follows:
-
The current log file is copied to an archive file that ends with a date stamp.
-
The current log file is emptied.
-
The archive file is compressed using
gzip
. -
Any existing compressed archive files older than the retention period are deleted.
Running the cleandblogs Script Manually
The cleandblogs
script automatically runs weekly, but you can also run the script manually if the need arises.
-
Connect as the
oracle
user to the compute node.For detailed instructions, see Connecting to a Compute Node Through Secure Shell (SSH).
-
Change to the directory containing the
cleandblogs
script:$ cd /var/opt/oracle/cleandb
-
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
-
Close your connection to the compute node:
$ exit