.BAD

BAD File

Oracle SQL*Loader Bad File
Ask a question
QUICK ANSWER

A .bad file is most often an Oracle SQL*Loader Bad File - a plain-text file containing rows rejected during a bulk data import into an Oracle database. Open it with any text editor to inspect the failed rows, then correct them and reload with SQL*Loader. If you found .bad files in an Exchange mail queue folder, those are undeliverable e-mail messages, not Oracle files.

Developer: Oracle Corporation Category: Text Files MIME: text/plain
OPENS ON Windows macOS Linux
Related: .DOC · .ODT · .DOCX · .GDOC

On this page

19k+ extensions indexed
Last reviewed Jul 12, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the BAD file format?

A .bad file is an Oracle SQL*Loader Bad File - a plain-text output file that SQL*Loader writes when it rejects rows during a bulk data load into an Oracle database.

The file contains a verbatim copy of every row that could not be loaded, in the same format as the original input (CSV, fixed-width, or stream). Because the content mirrors the source exactly, corrected rows can be fed straight back into sqlldr using the same .ctl control file without reformatting - making the .bad file a repair-and-retry artifact rather than merely an error log.

Records end up in the .bad file for three reasons:

  • The row violates an Oracle constraint (duplicate unique key, NOT NULL violation, etc.).
  • SQL*Loader cannot parse field boundaries in a malformed delimited row.
  • A field value cannot be converted to the target column's data type.

The .bad file is distinct from the .dsc discard file. Discards are rows intentionally skipped by a WHEN clause in the control file - they were never attempted. Bad records were attempted and failed.

If every input row loads successfully, the .bad file is not created at all. The default name derives from the input data file (e.g., data.csv → data.bad) unless overridden with BADFILE= in the control file or BAD= on the command line.

SQL*Loader has been part of Oracle Database since version 6 (1988) and remains a core utility in current Oracle Database 23ai releases.

Security & safety

RISK: LOW

Plain text data file; cannot execute. May contain sensitive business data (PII, financial records) from a failed import - treat accordingly, restrict file system access to authorized DBAs and ETL operators.

Format details

in a nutshell
FULL NAMEOracle SQL*Loader Bad Fileaka SQL*Loader reject file, bad records file
DEVELOPEROracle Corporationsince Oracle 7 era, circa 1992 (SQL*Loader has existed since Oracle 6, 1988)
CATEGORYText Files
MIME TYPEtext/plain
TYPEText log/data file (rejected records mirror)
This extension is also used by…
  • Microsoft Exchange Server bad-message file - Exchange SMTP transport stores undeliverable or malformed messages in .BAD files in the Exchange queue directory.
  • General 'bad data' marker (various applications) - Some ETL tools and legacy programs use .bad as a generic extension for error/reject output files.

Programs that open BAD files

Windows3 apps
Microsoft Excel Paid If the bad file is CSV-delimited, open via Data → From Text/CSV to see the rows in a spreadsheet for correction.
NotePad++ text editor Open-source Open the .bad file to inspect rejected rows; set encoding to match the source data (UTF-8, ANSI, etc.).
Oracle Database (SQL*Loader) Paid After correcting rows, re-run sqlldr with the corrected .bad file as the DATA= parameter to reload the fixed records.
macOS1 app
Oracle Database (SQL*Loader) Paid Same as Linux: sqlldr command-line utility processes and re-generates the .bad file.
Linux2 apps
Oracle Database (SQL*Loader) Paid sqlldr userid=user/pass control=load.ctl bad=load.bad - the bad file collects rejected rows for re-processing.
vim / nano (text editors) Open-source Inspect and edit the rejected rows directly in the terminal before reloading.

Technical details

deep spec
Format typePlain-text rejected-row mirror (same structure as the SQL*Loader input datafile)
EncodingMatches the input datafile - ASCII, UTF-8, or Oracle NLS character set as configured in the control file
ContentVerbatim copy of every row rejected during the SQL*Loader run, in original input format
Rejection reasonsOracle constraint violation (PK/UK/NOT NULL); unparseable field delimiters; data-type conversion failure
LOB data handlingLOB content from LOBFILE or SDF sources is NOT written to the .bad file when its row is rejected
Default filename<input_datafile_basename>.bad (e.g., data.csv → data.bad)
Filename overrideBADFILE= in the .ctl control file, or BAD= on the sqlldr command line
File creationCreated only when at least one row is rejected; absent on completely successful loads
Distinction from .dsc.dsc (discard) holds rows skipped by a WHEN clause - intentional skips, not errors; .bad holds rows that failed insertion
Re-use workflowCorrected .bad file can be reloaded directly with the same .ctl control file without reformatting
Platform supportAny Oracle Database platform: Linux, Unix, Windows, Solaris, AIX
ReleasedOracle 7 era, circa 1992 (SQL*Loader has existed since Oracle 6, 1988)
Latest versionN/A - format is defined by the input data format; no versioning
Specificationdocs.oracle.com

BAD conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with BAD files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about BAD files.

Frequently asked questions

What is a .bad file from Oracle?
An Oracle SQL*Loader Bad File - a plain-text copy of rows rejected during a bulk data import. The rows are written in the same format as the input data so they can be corrected and reloaded. Check the companion .log file for the specific error message for each rejected row.
How do I find out WHY rows were rejected?
The .bad file contains only the raw data. The corresponding SQL*Loader .log file (same base name) records the reason for each rejection (e.g. 'ORA-12899: value too large for column', 'unique constraint violated').
How do I reload the bad file?
Correct the rows in the .bad file, then run SQL*Loader again using the .bad file as the DATA= input with the same control file: sqlldr userid=user/pass control=load.ctl data=load.bad
What is the difference between a .bad file and a .dsc (discard) file?
The .bad file contains rows rejected because of an actual error during insert. The .dsc (discard) file contains rows intentionally filtered out by a WHEN clause in the control file - they had no error, they just didn't match the load criteria.
I found .bad files in my Exchange mail queue folder - what are they?
Those are undeliverable e-mail message files, not Oracle files. Exchange SMTP transport stores malformed or permanently undeliverable messages as .bad files in the queue directory. Open them with a text editor to inspect the raw e-mail headers and body.

References

1Oracle SQL*Loader - Specifying the Bad Filedocs.oracle.com
2Oracle 12.2 SQL*Loader Command-Line Referencedocs.oracle.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.BINCD/DVD Disc Image (BIN/CUE)
5.RPMSGRestricted Permission Message
6.MDMarkdown Document
7.NOMEDIAAndroid No-Media Marker File
8.PRO6XProPresenter 6 Bundle File
9.EXEWindows Executable (Portable Executable)
10.PRDXSoftMaker Presentations Document

Related extensions

.DOCMicrosoft Word 97-2003 Document
.ODTOpenDocument Text
.DOCXMicrosoft Word Open XML Document
.GDOCGoogle Docs Shortcut (Link to a Google Docs document)
.LSTList File (generic plain-text list / listing)
.VNTvNote (mobile phone text note / memo)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z