Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

Free Oracle Tips

HTML Text

 Home
 E-mail Us
 Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB   


 

 

 


 

 

 

 
 

ORA-00001: unique constraint (string.string) violated tips

Oracle Error Tips by Burleson Consulting

 

Oracle docs note this action when you get a ORA-00001 error:

 

ORA-00001: unique constraint (string.string) violated

Cause: An UPDATE or INSERT statement attempted to insert a duplicate key. For Trusted Oracle configured in DBMS MAC mode, you may see this message if a duplicate entry exists at a different level.
Action: Either remove the unique restriction or do not insert the key.

New Tip!  The 11gr2 hint ignore_row_on_dupkey_index allows the statement to silently ignore ORA-00001 errors.   See my ignore_row_on_dupkey_index tips.


On this forum, a user has also been confronts by ORA-0001, receiving this message:

08/07/2004 05:15:42 PM: <ERR> MOD=400; LINE=103; ERRNO=LC:12325,1;

ERRMSG=Error: ORA-00001: unique constraint (PMS.SUBPROJACT_PK) violated, Connector 'oracle', Method -Update- (1);

DEVL_PLAN_CODE=8; VOT_HEAD_CODE=21; PROG_CODE=02601; PROJ_SERI_NUMB=512; SUB_PROJ_SERI_NUMB=1000; ACVT_CATG=Perkhidmatan; NOTES_UNID=AAD291216DF60FF348256D060012FB17;:;

It is noted here that ORA-00001 is common when: "a program tries to insert a "duplicate" row in a table,"  and that, "when a unique constraint is violated the row is NOT added to the table."


Also, ORA-0001 is addressed on this great blog

Here, it is explained that using a trigger method might help avoid ORA-00001  in that it does not allow duplicate primary keys.  This is because if you have a sequence with in an insert statement, an insert that lacks a sequence would cause ORA-00001 to be thrown.  Here is the scenario presented by Sam Stephens: 

Lets say you have one row in your table, with ID = 1. Someone decides they need to have a record with ID = 10, and so they insert using insert into table (id) values (10). You now have a ticking timebomb - the sequence will continue to increment 2, 3 etc, until it reaches 10 at which time the insert fails with
ERROR at line 1:

ORA-00001: unique constraint (SYS.SYS_C002948) violated

Conversely, a trigger method would overwrite a value from an explicit ID value using a value specified in the sequence instead. 


Many users experience ORA-00001.  MOSC offers information regarding trace files and ORA-00001 applying to version 11.5.9 on all platforms. 

Here, it is commonly found that ORA-0001 will be thrown when an item is being imported.  Though ORA-00001 does not appear in the log file, neither is ORA-0001 appearing in MTL_INTERFACES_ERRORS, when the import complete the table is shown as failing upon enable INCOIN.  ORA-0001 is shown in MTL_INTERFACES_ERRORS as err=1 ie unique constraint violated. 

This signifies ORA-00001 because of an orphan record in the MTL_REVISIONS_INTERFACE table, perhaps because of an import program that has been run in the past.  

ORA-0001 is an issue here because upon inserting a new record in MTL_SYSTEM_ITEMS_INTERFACE the import inserts the record in MTL_REVISIONS_INTERFACE before to attempts passing the record to MTL_ITEM_REVISIONS_B via the MTL_REVISIONS_INTERFACE.  Because SELECT via MTL_REVISIONS_INTERFACE fetch one or more records, due to orphan records, the INSERT fails, and ORA-0001 is thrown.

MOSC advises that upon truncating MTL_REVISIONS_INTERFACE will take care of ORA-00001by using the instructions below:

  1. Create table backup_<tarno> as select * from MTL_REVISIONS_INTERFACE
  2. Truncate table MTL_REVISIONS_INTERFACE
  3. Resubmit item for item import

 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2012 

All rights reserved.

Oracle © is the registered trademark of Oracle Corporation.


 

  
 

 
 
 
 
Oracle performance tuning software
 
 

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books