﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>FranklinFaces.com - Oracle &amp; SQL Server Database Forums for all IT Professionals / Oracle Forum / ORA - Oracle Database Error Codes - Search via specific error codes. / ORA-00000 Through ORA-09989   / ORA-00001: Unique constraint violated  ora error / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>FranklinFaces.com - Oracle &amp; SQL Server Database Forums for all IT Professionals</description><link>http://www.franklinfaces.com/</link><webMaster>no-reply@FranklinFaces.com</webMaster><lastBuildDate>Sat, 19 May 2012 18:45:57 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: ORA-00001: Unique constraint violated  ora error</title><link>http://www.franklinfaces.com/Topic220-54-1.aspx</link><description>"ORA-00001: unique constraint (OOTB_EN.INDEX$TPS_LIC_AUDIT_ITEM$T) violated" ora error when changing group etc&lt;/P&gt;&lt;P&gt;&lt;SPAN style="TEXT-DECORATION: underline"&gt;&lt;STRONG&gt;Problem&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;On a Oracle Environment, when changing the group in console or amending a users Group in administration you see the follow error upon save:&lt;/P&gt;&lt;P style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; MIN-HEIGHT: 8pt; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; HEIGHT: 8pt"&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ORA-00001: unique constraint (OOTB_EN.INDEX$TPS_LIC_AUDIT_ITEM$T) violated&lt;/STRONG&gt;&lt;/P&gt;&lt;H5&gt;&lt;SPAN style="TEXT-DECORATION: underline"&gt;Answer&lt;/SPAN&gt;&lt;/H5&gt;&lt;P style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; MIN-HEIGHT: 8pt; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; HEIGHT: 8pt"&gt; &lt;/P&gt;&lt;P&gt;Please have the below script run by your Oracle DB administrator against your DB, ensuring a full backup has been done and everyone is logged out of the system.  Where possible test on a test system before applying to live.&lt;/P&gt;&lt;P style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; MIN-HEIGHT: 8pt; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; HEIGHT: 8pt"&gt; &lt;/P&gt;&lt;P style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; MIN-HEIGHT: 8pt; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; HEIGHT: 8pt"&gt; &lt;/P&gt;&lt;P&gt;DROP INDEX index$tps_lic_audit_item$t ON tps_licence_audit_item;&lt;/P&gt;&lt;P&gt;CREATE INDEX index$tps_lic_audit_item$t ON tps_licence_audit_item(tps_title);&lt;/P&gt;&lt;P style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; MIN-HEIGHT: 8pt; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; HEIGHT: 8pt"&gt; &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Note: If the above script errors with the message &lt;EM&gt;"ORA-00955: name is already used by an existing object"&lt;/EM&gt;, then use this script:&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; MIN-HEIGHT: 8pt; PADDING-BOTTOM: 0px; PADDING-TOP: 0px; HEIGHT: 8pt"&gt; &lt;/P&gt;&lt;P&gt;DROP INDEX index$tps_lic_audit_item$t;&lt;/P&gt;&lt;P&gt;CREATE INDEX index$tps_lic_audit_item$t ON tps_licence_audit_item(tps_title);</description><pubDate>Tue, 15 Jun 2010 16:55:33 GMT</pubDate><dc:creator>Admin</dc:creator></item><item><title>RE: ORA-00001: Unique constraint violated  ora error</title><link>http://www.franklinfaces.com/Topic220-54-1.aspx</link><description>ORA-00001: Unique constraint (OWNER.CONSTRAINT_NAME) violated &lt;/P&gt;&lt;P&gt;Typically an application error message. &lt;BR&gt;&lt;BR&gt;The constraint indicated in the error message is a unique or primary key on a table.&lt;BR&gt;&lt;BR&gt;An attempt was made to insert a record with a key that already exists in that table. This is not allowed and thus violates the constraint. &lt;BR&gt;&lt;BR&gt;you can use following statement to identify the columns of the table this constraint is based upon:&lt;BR&gt;&lt;BR&gt;&lt;B&gt;select table_name, column_name&lt;BR&gt;from all_cons_columns&lt;BR&gt;where owner='&amp;lt;Here OWNER&amp;gt;'&lt;BR&gt;and constraint_name='&amp;lt;Here CONSTRAINT_NAME&amp;gt;'&lt;BR&gt;order by position;&lt;/B&gt;</description><pubDate>Tue, 15 Jun 2010 16:53:01 GMT</pubDate><dc:creator>Admin</dc:creator></item><item><title>RE: ORA-00001: Unique constraint violated  ora error</title><link>http://www.franklinfaces.com/Topic220-54-1.aspx</link><description>Give a some causes of ora error ORA-00001 Unique constraint violated. (Invalid data has been rejected)&lt;/P&gt;&lt;P&gt;Cause&lt;BR&gt;&lt;BR&gt;This error means that an attempt has been made to insert a record with a duplicate (unique) key. This error will also be generated if an existing record is updated to generate a duplicate (unique) key. Typically this is a duplicate primary key, but it need not be the primary key.&lt;BR&gt;&lt;BR&gt;Remedy&lt;BR&gt;&lt;BR&gt;1) Remove the unique restriction.&lt;BR&gt;2) Change the restriction to allow duplicate keys. An index could be changed to be a non-unique index, but remember that the primary key must always be unique&lt;BR&gt;3) Do not insert the duplicate key&lt;BR&gt;</description><pubDate>Tue, 15 Jun 2010 16:52:32 GMT</pubDate><dc:creator>Admin</dc:creator></item><item><title>RE: ORA-00001: Unique constraint violated  ora error</title><link>http://www.franklinfaces.com/Topic220-54-1.aspx</link><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt" align=left&gt;&lt;SPAN class=msg&gt;&lt;FONT class=style3 face="Courier New"&gt;ORA-00001: unique constraint (&lt;SPAN class=italic&gt;string&lt;/SPAN&gt;.&lt;SPAN class=italic&gt;string&lt;/SPAN&gt;) violated&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="Courier New" size=1&gt; &lt;SPAN class=style3&gt;&lt;!-- class="msg" --&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;DL class=M&gt;&lt;DIV class=IND&gt;&lt;DIV class=IND&gt;&lt;DIV class=IND&gt;&lt;DL class=M&gt;&lt;DIV class=IND&gt;&lt;DIV class=msgset&gt;&lt;DIV class=msgentry&gt;&lt;DIV class=IND&gt;&lt;DIV class=msgset&gt;&lt;DIV class=msgentry&gt;&lt;DIV class=IND&gt;&lt;DIV class=msgset&gt;&lt;DIV class=msgentry&gt;&lt;DL&gt;&lt;DD&gt;&lt;DIV class=msgexplan&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN class=style3&gt;Cause:&lt;/SPAN&gt;&lt;FONT class=style3&gt; 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.&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;FONT face="Courier New"&gt;&lt;!-- class="msgexplan" --&gt;&lt;/FONT&gt;&lt;DD&gt;&lt;DIV class=msgaction&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN class=style3&gt;Action: Either remove the unique restriction or do not insert the key.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;!-- class="msgaction" --&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;!-- class="msgentry" --&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;!-- class="msgaction" --&gt;&lt;FONT color=#dd1111&gt; The 11gr2 hint &lt;EM&gt;ignore_row_on_dupkey_index&lt;/EM&gt; allows the statement to silently ignore ORA-00001 errors.&lt;/FONT&gt; &lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DL&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DL&gt;</description><pubDate>Tue, 15 Jun 2010 16:51:22 GMT</pubDate><dc:creator>Admin</dc:creator></item><item><title>RE: ORA-00001: Unique constraint violated  ora error</title><link>http://www.franklinfaces.com/Topic220-54-1.aspx</link><description>&lt;H2&gt;Symptom:&lt;/H2&gt;&lt;P&gt;When inserting or updating data, the following error is returned:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;ORA-00001: unique constraint violated (&amp;lt;schema&amp;gt;.&amp;lt;constraint&amp;gt;)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;H2&gt;Cause:&lt;/H2&gt;&lt;P&gt;This error means that an attempt has been made to insert a record with a duplicate (unique) key. This error will also be generated if an existing record is updated to generate a duplicate (unique) key. Typically this is a duplicate primary key, but it need not be the primary key.&lt;/P&gt;&lt;H2&gt;Remedy:&lt;/H2&gt;&lt;P&gt;Only one of the following will be appropriate:&lt;/P&gt;&lt;UL class=spaced&gt;&lt;LI&gt;Remove the unique restriction. &lt;LI&gt;Change the restriction to allow duplicate keys. An index could be changed to be a non-unique index, but remember that the primary key must always be unique. &lt;LI&gt;Do not insert the duplicate key. &lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Usually this error indicates an application error or error on the part of the user.&lt;/P&gt;&lt;P&gt;The error gives the name of the constraint that has been violated, but not the name of the table. To identify the table and find out all the relevant information about the index it is normally easiest to use Oracle Schema Manager - the name of the constraint given in the error will match with the name of the corresponding index. Alternately, to identify the name of the table use:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;select table_name from all_indexes where index_name='&amp;lt;index-name&amp;gt;';&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;this view ('&lt;CODE&gt;all_indexes&lt;/CODE&gt;') also contains some other information about the index, such as its uniqueness. &lt;/P&gt;&lt;P&gt;and to identify the files that together constitute the index:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;select * from all_ind_columns where index_name='&amp;lt;index-name&amp;gt;';&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;</description><pubDate>Tue, 15 Jun 2010 16:50:40 GMT</pubDate><dc:creator>Admin</dc:creator></item><item><title>ORA-00001: Unique constraint violated  ora error</title><link>http://www.franklinfaces.com/Topic220-54-1.aspx</link><description>&lt;H1 class=title&gt;ORA-00001: Unique constraint violated &lt;/H1&gt;&lt;P class=title&gt;&lt;TABLE cellPadding=5 width="100%" align=center border=0&gt;&lt;TBODY&gt;&lt;TR vAlign=top&gt;&lt;TD noWrap&gt;&lt;H2 style="FONT-SIZE: 18px; MARGIN-BOTTOM: 0px"&gt;ORA-00001:&lt;/H2&gt;&lt;/TD&gt;&lt;TD style="FONT-SIZE: 16px"&gt;unique constraint (&lt;I&gt;string&lt;/I&gt;.&lt;I&gt;string&lt;/I&gt;) violated&lt;/TD&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD style="FONT-SIZE: 18px"&gt;&lt;B&gt;Cause:&lt;/B&gt;&lt;/TD&gt;&lt;TD style="FONT-SIZE: 16px; LINE-HEIGHT: 1.5"&gt;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.&lt;BR&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR vAlign=top&gt;&lt;TD style="FONT-SIZE: 18px"&gt;&lt;B&gt;Action:&lt;/B&gt;&lt;/TD&gt;&lt;TD style="FONT-SIZE: 16px; LINE-HEIGHT: 1.5"&gt;Either remove the unique restriction or do not insert the key.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt;&lt;P class=title&gt; &lt;/P&gt;&lt;P class=title&gt;&lt;TABLE class=parm_values cellSpacing=0 cellPadding=9 width="100%" border=0&gt;&lt;TBODY&gt;&lt;TR class=tr_left_top&gt;&lt;TD width=50&gt;&lt;P class=oracle_error&gt;Error:&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;ORA-00001: unique constraint (&lt;I&gt;constraint_name&lt;/I&gt;) violated&lt;/TD&gt;&lt;/TR&gt;&lt;TR class=tr_left_top&gt;&lt;TD&gt;&lt;P class=oracle_error&gt;Cause:&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;You tried to execute an INSERT or UPDATE statement that has created a duplicate value in a field restricted by a unique index.&lt;/TD&gt;&lt;/TR&gt;&lt;TR class=tr_left_top&gt;&lt;TD&gt;&lt;P class=oracle_error&gt;Action:&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;The options to resolve this Oracle error are: &lt;OL&gt;&lt;LI&gt;Drop the unique constraint &lt;LI&gt;Change the constraint to allow duplicate values &lt;LI&gt;Modify your SQL so that a duplicate value is not created &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;If you are not sure which unique constraint was violated, you can run the following SQL:&lt;/P&gt;&lt;BLOCKQUOTE class=sql_command&gt;&lt;P&gt;&lt;FONT color=#113333&gt;select distinct table_name&lt;BR&gt;from all_indexes&lt;BR&gt;where index_name = 'CONSTRAINT_NAME';&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description><pubDate>Fri, 11 Jun 2010 11:15:38 GMT</pubDate><dc:creator>Admin</dc:creator></item></channel></rss>
