This article explains how to automatically remove old Oracle Text temporary files from the ctx\tmp folder to prevent unnecessary storage space usage.
Symptoms
Over time, temporary Oracle Text files accumulate in the ORACLE_HOME\ctx\tmp directory, which can consume a significant amount of storage space.
Cause
A known Oracle text (ctxhx) issue may leave temporary scratch files behind after document indexing. These files are not always removed automatically.
Resolution
To automatically clean up old temporary files, create a Windows Scheduled Task that runs daily or weekly. Then execute the following command:
ForFiles /p "C:\Oracle\WINDOWS.X64_193000_db_home\ctx\tmp" /s /d -3 /c "cmd /c if @isdir==FALSE del @file"
⚠️Important:
Replace C:\Oracle\WINDOWS.X64_193000_db_home\ with your own Oracle Home installation path.
Technical Notes for Administrators
- The command is designed to operate only within the ORACLE_HOME\ctx\tmp directory and does not affect Oracle binaries or database files
- Ensure the
@isdir==FALSEflag is used to prevent Windows from targeting old temporary folders, which can accidentally wipe out brand-new indexing files running inside them. It forces the script to safely delete old files only.