housekeeping.{ksh|cmd }
dbi services offers an intelligent housekeeping script to perform several types of operations on log files which are valid and identical for Microsoft Windows and Linux/Unix systems.
Archive continuously written files such as the Alert*.log or the dr*.log (Dataguard broker) log file or a third party file such as the Apache access_log or errog_log. The last nnn lines are kept In the original file.
Truncate files older than the threshold
Delete files older than the threshold
Compres (gzip) files older than the threshold
Oracle ADRCI (Automatic Diagnostic Repository Command Interpreter) purge.
This function is available for any installed oracle products which have a Diagnostic repository.
By default the adrci policies are disabled and the purge Is done with purge -age <days>
If the adrci policies are enabled, first the adrci policies are set then purge Is run.
The implementation consist of
Copy the conf. template
Adapt the configuration file This configuration file is composed of three sections:
- The Definition section, set default values for all operation types
- The Standard section, which is composed as follows
You can add your own policy for other ORACLE adrci compatible products.
- The Custom section
- The last feature is the customization of each line by adding digits between the double colons at the end of the line, like the 100 days from above example
- The static environment variables $ORACLE_BASE, $DMK_HOME are allowed and resolved.
- The text-based listener.log should only be added In oracle < 19c. In oracle >= 19c use the listener parameters LOG_FILE_NUM_LISTENER=<n>, LOG_FILE_SIZE_LISTENER=<n> Instead.
Syntax
Housekeeping with grid infra (ex ODA)
Review, adapt if needed, and use both housekeeping.oracle.conf (for Oracle) and housekeeping.grid.conf (for Grid) templates. The housekeeping for Oracle needs to be executed with oracle user and the housekeeping for Grid needs to be executed with grid user, albeit the installation was done without user seggregation. In this case, if no user seggregation was used during the installation, both housekeepings will be run with oracle user. Reminder that dbi Best Practises is to seggregate the role, having 2 linux users, oracle and grid.
Schedule the housekeeping in the appropriate oracle and grid crontab. The schedules should not be executed at the same time, as the housekeeping script is putting some locks. Recommendation is to give at least 3 hours before the 2 daily run.
Last updated