This repository contains a shell script that generates a usage report for Oracle ASM diskgroups, with a special focus on FRA / recovery diskgroups (for example +RECO, +FRA). The report shows total space, used space, free space and usage percentage, helping DBAs monitor capacity and plan growth in Exadata, ExaCC and on-prem environments.
The script is designed to be simple, portable and easy to integrate with cron, monitoring tools or email notifications.
- Collects ASM diskgroup usage information from
V$ASM_DISKGROUP - Shows, for each diskgroup:
- Name
- Total size (GB)
- Used size (GB)
- Free size (GB)
- Usage percentage
- Can optionally filter only FRA / recovery diskgroups (by name pattern)
- Output is plain text / pipe-separated, easy to parse with other tools
- Suitable for scheduled execution via cron
- Safe to run in production environments (read-only views)
The core logic of the script is based on a query similar to:
SELECT name,
total_mb,
free_mb,
(total_mb - free_mb) AS used_mb,
ROUND( (total_mb - free_mb) / total_mb * 100, 2 ) AS pct_used
FROM v$asm_diskgroup
ORDER BY name;
- Linux environment
- Bash
- SQL*Plus client installed
- Oracle Grid / ASM environment configured (ORACLE_HOME for Grid, ORACLE_SID for ASM instance)
- User with access to
V$ASM_DISKGROUP(typicallysysasmor OS authentication as grid/asm owner)
-
Clone the repository:
git clone https://github.com/guborges/oracle-asm-diskgroup-usage-report.git cd oracle-asm-diskgroup-usage-report -
Edit the script configuration:
- Set how you connect to ASM:
- OS authentication (for example, running as grid user with
sqlplus / as sysasm) - Or a connect string if you prefer
- OS authentication (for example, running as grid user with
- Optionally set a name pattern to focus on FRA / recovery diskgroups (for example
+RECO%)
- Set how you connect to ASM:
-
Make the script executable:
chmod +x asm_diskgroup_usage.sh -
Run the script:
./asm_diskgroup_usage.sh # or, with an explicit connect string: ./asm_diskgroup_usage.sh "+asm_user/password@+ASM as sysasm" -
Example output:
DISKGROUP|TOTAL_GB|USED_GB|FREE_GB|PCT_USED DATA | 914.00 | 580.15| 333.85| 63.49 RECO | 228.00 | 25.88| 202.12| 11.35
This output can be sent by email, ingested by monitoring tools or stored for capacity trending.
oracle-asm-diskgroup-usage-report/
├── asm_diskgroup_usage.sh
└── README.md
- The script is intentionally minimal to keep it easy to read and adapt.
- You can extend it to:
- Highlight diskgroups above a certain usage threshold (for example 80% or 90%)
- Generate HTML or CSV reports
- Send alerts by email or webhook when usage exceeds a limit
- Store historical data in a table or file for trending
The approach works well in Exadata / ExaCC environments where FRA growth in ASM diskgroups must be monitored closely to avoid backup and archive log issues.
MIT License