Saturday, February 8, 2025

How to select/filter specific lines from the oracle database alert log?

Usually when verifying the alert log entries to troubleshoot any database specific issue, it will take a good amount of time if the alert log is huge like 10MB or 20MB etc.. During such situations, if we know the exact error time, to filter specific lines from alert log, please use below script.
awk '$0 >= "2025-01-19T00:00:00" && $0 <= "2025-01-25T00:00:00" {print $0; getline; print $0}' /u02/app/oracle/diag/rdbms/test1/TEST1/trace/alert_TEST1.log > selected_alert.txt
in the above command, selected_alert.txt contains your required output lines from the alert log.
reference article :
https://ermannkara.wordpress.com/2025/02/06/filter-a-specific-time-range-in-the-alert-log-and-write-the-results-to-a-txt-file/

No comments:

Post a Comment

Minimalistic Oracle: A SQL-centric and a session-centric way to query V...

Minimalistic Oracle: A SQL-centric and a session-centric way to query V... : Version 1: SQL-Centric  This version starts from V$SQL and...