Your issue involves multiple layers that need systematic troubleshooting. Let me address each focus area:
FBDI Template Validation:
First, verify your template structure matches the current version requirements for 23B. Oracle updates interface table structures between releases, and old templates can cause unexpected issues. Download a fresh template from the Import Orders task and compare column mappings. Pay special attention to these critical fields:
SELECT SOURCE_ORDER_SYSTEM, SOURCE_ORDER_NUMBER,
COUNT(*) FROM DOO_HEADERS_IFACE_ALL
GROUP BY SOURCE_ORDER_SYSTEM, SOURCE_ORDER_NUMBER
HAVING COUNT(*) > 1;
This query will show actual duplicates in staging. Validate that your Excel template populates SOURCE_ORDER_SYSTEM consistently - blank or null values can cause the constraint to behave unexpectedly. Also check for hidden characters or trailing spaces in your source data that might make seemingly identical values actually different.
Staging Table Cleanup:
The standard cleanup isn’t always sufficient. Implement a comprehensive cleanup procedure:
DELETE FROM DOO_HEADERS_IFACE_ALL
WHERE PROCESS_STATUS IN ('ERROR', 'REJECTED')
AND CREATION_DATE < SYSDATE - 1;
Run this before each import batch. However, the proper approach is using the ‘Delete Bulk Import Data’ ESS job with parameters: Process Status = ‘Error’, Age = ‘1’ day. This handles cascade deletes for child line and schedule records. Schedule this job to run nightly during maintenance windows.
For stuck records that won’t delete normally, check for locks:
SELECT s.sid, s.serial#, s.username
FROM v$locked_object lo, dba_objects ao, v$session s
WHERE ao.object_id = lo.object_id
AND lo.session_id = s.sid
AND ao.object_name = 'DOO_HEADERS_IFACE_ALL';
Unique Constraint Troubleshooting:
The DOO_HEADERS_U1 constraint enforces uniqueness on (SOURCE_ORDER_SYSTEM, SOURCE_ORDER_NUMBER, SOURCE_ORDER_ID). Your error indicates collision on this combination. Common causes:
-
Null SOURCE_ORDER_ID: If this column is null, multiple records with same SOURCE_ORDER_SYSTEM and SOURCE_ORDER_NUMBER will violate the constraint. Ensure your template explicitly populates this field.
-
Case sensitivity: Oracle treats ‘ORDER-001’ and ‘order-001’ as different, but your validation might not. Implement UPPER() standardization in your data preparation.
-
Concurrent imports: If you’re running multiple import jobs in parallel, they can collide. Implement serialization using a custom locking mechanism or schedule imports sequentially.
-
Uncommitted transactions: Previous failed imports might have uncommitted data. Query for records with null LAST_UPDATE_DATE or very old CREATION_DATE values.
Additional troubleshooting steps:
- Enable diagnostic logging for the Import Orders ESS job (set logging level to STATEMENT)
- Review the ESS job log file for the exact record causing the violation
- Check if you’re using the correct Business Unit context - wrong BU can cause unexpected duplicate detection
- Verify that your source system isn’t reusing order numbers across different order types
Implement pre-validation in your ETL process before loading to FBDI. Create a staging table in your integration layer and run duplicate checks there before pushing to Oracle interface tables. This prevents wasted processing and gives you better error visibility.