← Space Management
Oracle · Space Management

How to clean up core dump (cdump) files in Oracle

Reclaim disk space in the Oracle diagnostic destination by finding and deleting old core dump files under the cdump directory.

Tested on11g12c18c19c21c23ai26ai

Under $ORACLE_BASE/diag/rdbms/<db>/<instance>/cdump, Oracle drops core files whenever a session process crashes. On a busy or noisy database this directory can grow into tens or hundreds of GB. Delete old core files to reclaim space, then verify with df.

Deletes core files permanently. Only run in the actual cdump directory (pwd first), and consider keeping the most recent cores for support before deletion.

# 1) Find the diag destination and check which subdirs are the biggest
cd $ORACLE_BASE/diag/rdbms
du -sh */*/cdump 2>/dev/null | sort -h | tail

# 2) Go into the offending cdump directory
cd <db>/<instance>/cdump
pwd   # confirm you are in .../cdump before deleting

# 3) Preview which core files would be removed (older than 7 days)
find . -name 'core_*' -type f -mtime +7 -exec ls -lh {} \;

# 4) Delete them
find . -name 'core_*' -type f -mtime +7 -exec rm -f {} \;

# 5) Verify freed space
df -kh .
housekeepingcdumpdisk spaceshell