Alert log check (java)
Job details
Name: |
Alert log check (java) |
Platform: |
Oracle |
Category: |
Availability |
Description: |
This check reads and looks for errors in the database alert log. Uses embedded java to read files. |
Long description: |
This check reads and looks for errors in the database alert log. Uses embedded java to read files. |
Version: |
2.7 |
Default schedule: |
0,10,20,30,40,50 * * * |
Requires engine install: |
Yes |
Compatibility tag: |
.[type=‘instance’ & databasetype=‘oracle’]/.[hasengine=‘YES’ & (version like ‘10.2%’) & enable_java = ‘1′ ] |
Parameters
Name |
Default value |
Description |
alertlog name |
AUTO |
The name of the Oracle alert log. If set to AUTO, we will try to figure out the alert log file name ourself. |
alertlog directory name |
AUTO |
The name of the directory we are looking for the alert log in. If set to AUTO, we will try to figure out where the alert log file is located. |
alertlog error text |
ORA- |
Defines which strings (errors) the Check must look for. Values must be separated with commas (,). Text is case and space sensitive, so “ ORA-, Error” is looking for “ ORA-” and “ Error”, different from “ORA-,Error” which looks for “ORA-” and “Error”. |
alertlog line HWM |
0 |
Each time the Check read the alert log, it registers how many rows have been checked. The next time |
alertlog read lines |
4000 |
Number of lines to maximum read on each run. |
alertlog error text allowed |
|
Specifies the error strings which are excluded. Values must be separated with commas (,). Text is case and space sensitive, so “ ORA-, Error” is looking for “ ORA-” and “ Error”, different from “ORA-,Error” which looks for “ORA-” and “Error”. This list is filtering away errors found by “alertlog error text”, so if “ORA-” is searched for in “alertlog error text” parameter, and “ORA-600″ is in “alertlog error text allowed” parameter, then “ORA-600″ messages are not reported on. |
Job Summary
- Purpose: The purpose of this job is to monitor the Oracle alert log for errors using a Java-based approach to reading file data.
- Why: This job is crucial for maintaining the health of Oracle instances by promptly identifying and addressing errors captured in the alert logs. It ensures the system operates efficiently and reduces downtime.
- Manual checking: To manually check the Oracle alert log for errors, you would typically navigate to the alert log file location and review the entries manually or use script-based log parsing methods.
Job Configuration
- “Comp-query” restricts this job to Oracle instances with version resembling ‘10.2%’ where Java is enabled.
- “Default-Schedule”: This check runs every 10 minutes as indicated by the schedule “0,10,20,30,40,50 * * * *”.
Implementation Details
- “Force-install”: True — indicates a mandatory installation of the job.
- SQL and Java procedures used to implement log monitoring include creating necessary tables and compiling Java-based procedures to read and update the log data.
Database Interactions
- Tables such as “dbw_alert_data”, “dbw_alert_error_history”, “dbw_alert_config”, “dbw_alert_err_text”, and “dbw_alert_good_text” are utilized to store configurations, log data, and error information.
- Java source code is used to read the alert log, filter lines, and manage error tracking dynamically based on the specified rules.
Alert Log Monitoring Logic
- “dbw_alert_readfilenlines” procedure reads specified lines from the alert log, skipping the lines that were previously read, managed by high water mark (“alertlog line HWM“) to optimize the performance.
- “dbw_alert_filecheck” procedure checks file availability and permissions to ensure the alert log can be accessed and read by the job.
- Log errors matching specific patterns (“alertlog error text”) are recorded, and errors meeting exclusion criteria (“alertlog error text allowed”) are ignored.
Error Handling
- In case of file access or Java session issues, the system attempts to clear and restart the Java session, ensuring robustness in monitoring operations.
- Detailed error records are maintained through logging mechanisms to provide transparency and traceability for debugging.
Report Generation
- “Alert log report”: This report summarizes the findings, showing error counts over various dates as well as providing details on specific errors detected during each check execution.
- Data visualization and tables offered in the report facilitate easier understanding and quick inspection of potential issues within the Oracle instance.
By continuously monitoring the alert logs and reporting specific issues, the dbWatch job helps in proactive maintenance and supports the administrative teams in ensuring optimal performance and stability of the database environments.