Database Administration (MOSC)

MOSC Banner

Oracle Linux date format used in alert log.

edited Feb 13, 2024 10:27PM in Database Administration (MOSC) 4 commentsAnswered ✓

I'm trying to create a shell script that I can schedule in CRON to run and grep the last 10 minutes of the alert log for specific errors. As part of this, I need to format the date for a shell script.

I'm trying to figure out how to format the date using +%Y-%m-%d %H, etc. to match what is in the alert log.

Here's an example of a date I have in my database alert log.

2024-01-31T10:21:41.125178-05:00 <-- how to match this?

sed -n "/^$(date --date='10 minutes ago' '+%Y-%m-%d %H:%M')/,\$p" 2test_alert_DM011.log| grep 'ORA"'

Tagged:

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center