Thursday, April 9, 2026

Automated Health Check Script (Shell + HTML report)

I’ve created a production-ready automated health check script in the canvas for you 👍

https://github.com/shashidba1208/shashidba/blob/master/oracle_automated_health_check_script_shell_html

🔥 What this script does:

  • Connects via sqlplus / as sysdba

  • Generates a timestamped HTML report

  • Covers:

    • ✅ Uptime

    • ✅ DB Status

    • ✅ Tablespace usage (with color coding 🟢🟡🔴)

    • ✅ ASM usage

    • ✅ RMAN backup status

    • ✅ Active sessions

    • ✅ Invalid objects

    • ✅ Data Guard stats


🚀 How to Use

1. Save script

vi db_health_check.sh

2. Give permission

chmod +x db_health_check.sh

3. Run manually

./db_health_check.sh

4. Schedule via cron

crontab -e

Example (run daily at 8 AM):

0 8 * * * /path/db_health_check.sh

📊 Output

  • HTML report generated in:

/tmp/db_health/

Open in browser:

xdg-open report.html


No comments:

Post a Comment