I am attempting to script a check showing when an Oracle database has been started and stopped.
I can search the alertSID.ora file for the string "Starting" and get the output
"Starting ORACLE instance (normal)"
However the line I am really interested in is the previous line which shows the date e.g.
Sat May 25 11:26:35 2002
Starting ORACLE instance (normal)
Does anyone have any ideas on how to display the line previous to the one you have searched for or have a better idea on how to do this?
I can search the alertSID.ora file for the string "Starting" and get the output
"Starting ORACLE instance (normal)"
However the line I am really interested in is the previous line which shows the date e.g.
Sat May 25 11:26:35 2002
Starting ORACLE instance (normal)
Does anyone have any ideas on how to display the line previous to the one you have searched for or have a better idea on how to do this?