How to find duplicate keys found when error ORA-01452: cannot CREATE a UNIQUE INDEX.

Hi gurus,

I fall for this stupid error

"cannot CREATE a UNIQUE INDEX; duplicate keys found.


It is that the Unique Index key is composed of multiple columns

CREATE A UNIQUE KEY001AUTORISATIONS_APPORT ON TFT_AUTORISATIONS_APPORT INDEX

(AUT_APPORTEUR, AUT_AGENCE, AUT_PRODUIT, AUT_OPTION, AUT_TARIF, AUT_DATE_AUTORISATION)

TABLESPACE KEYS_TFT NOPARALLEL NOLOGGING

Now,.

My question is, how to find duplicates keys blocking Index creation?

Thanks if you can help

Run this query to display the list of the duplicates already existing.

Select AUT_APPORTEUR, AUT_AGENCE, AUT_PRODUIT, AUT_OPTION, AUT_TARIF, AUT_DATE_AUTORISATION, count (1) as cnt

of TFT_AUTORISATIONS_APPORT

Group

AUT_APPORTEUR, AUT_AGENCE, AUT_PRODUIT, AUT_OPTION, AUT_TARIF, AUT_DATE_AUTORISATION

view count (1) > 1

Concerning

NJ

Tags: Database

Similar Questions

  • How can I fix: internet Explorer script error "automation server cannot create the object.

    Execution of search help Quicken 2011 this error always comes up.  The file or program associated with the error message is \awApi5.dll/awLocalize.js Answerworks 5.0.

    Hi kadialcamara,

    1. did you of recent changes on the computer?

    2. When you receive the message of internet script explorer?

    Check out the link below on the forums of intuit and check if it helps.

    Help with Script error-res: / / C:\Program Files\Common Files\AnswerWorks 5.0\awApi5.dll/awLocalize.js

    For additional support post your query in the forums of intuit.

    https://qlc.Intuit.com/

  • Impossible to post duplicate keys found

    I am trying to create a Unique column in the table oms_product_group product_group_name constraint.

    It is parent to child relationship as parent_id will be same for some the product_group_name

    Example:

    product_group_name parent_id

    -----------------------------------------------

    All                                           0

    Mobile                                     1

    Laptop                                    1

    Men                                        2

    Men 2 (<-if I have already created MEN then it must not allow me recreate)

    Android                                   3

    What I tried.

    ALTER table OMS_PRODUCT_GROUP add constraint OMS_PRODUCT_GROUP_NAME_UN unique (PRODUCT_GROUP_NAME) can be POSTPONED to the IMMEDIATE DEPARTURE;

    ERROR: ORA-02299: cannot validate (ECUBE. OMS_PRODUCT_GROUP_NAME_UN) - duplicate keys found

    ALTER table OMS_PRODUCT_GROUP add novalidate constraint OMS_PRODUCT_GROUP_NAME_UN

    using index (create indexes unique_index on OMS_PRODUCT_GROUP (PRODUCT_GROUP_NAME));

    ORA-02253: specification of constraints not allowed here

    So basically that if one introduces a value name it cannot reinsert eponymous value which is I have created unique key constraints.

    Thank you

    Pranav Shah.

    If I understand you correctly, you want the constraint to apply oneness in the future, yet allow existing duplicates.

    To do this, you will need to use a not unique to manage the constraint of the index, and you must specify ENABLE NOVALIDATE. See line 16 below.

    SQL> drop table t purge;
    
    Table T dropped.
    
    SQL> create table t ( n) as
    select 1 from dual
    union all
    select 1 from dual;
    
    Table T created.
    
    SQL> alter table t add constraint tu unique(n) using index(create index tu on t(n)) enable novalidate;
    
    Table T altered.
    
    SQL> insert into t values(1);
    
    Error starting at line : 8 in command -
    insert into t values(1)
    Error report -
    SQL Error: ORA-00001: unique constraint (STEW.TU) violated
    00001. 00000 -  "unique constraint (%s.%s) 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.
    
  • How to find my key for microsoft office that came with my laptop?

    How to find my key for microsoft office that came with my laptop?

    Thank you. I guess I'll have to buy a new copy.

  • How to find duplicates of a field value? For example - in a field, I have values like {123,345,346,123}, now I want to remove the duplicate value in the field so that my output looks like {123,345,346}

    How to find duplicates of a field value? For example - in a field, I have values like {123,345,346,123}, now I want to remove the duplicate value in the field so that my output looks like {123,345,346}

    If it's an array you want to deduplicate then here is a script [for use in the Script Processor] I prepared earlier:

    var result = new Array();

    var added = new Object();

    If (input1 [0]! = null)

    {

    for (var i = 0; i)< input1[0].length;="">

    {

    var point = input1 [0] [i];

    If (! added [item])

    {

    added [item] = 1;

    result [result. Length] = item;

    }

    }

    }

    Output 1 = result;

    Kind regards

    Nick

  • SQL error: ORA-01779: cannot modify a column that matches a key examine

    Hi all

    The requirement is that I have two tables s_party_d and S_CONTACT_d. the need to update the column name with FST_NAME | ',' | Last_name when column rowid in both tables are equal. I used the query previously below: -.

    Update
    (select
    E1. Name,
    e.FST_NAME,
    Select
    Of
    s_party_d e1,
    E S_CONTACT_d
    where
    E1. Game of ROW_ID = e.ROW_ID)
    name = FST_NAME | ',' | LAST_NAME;

    But I get the error message when executing the query

    Error in the command line: 31 column: 3
    Error report:
    SQL error: ORA-01779: cannot modify a column that is mapped to a table not preserved key
    01779 00000 - 'impossible to change a column that is mapped to a non-preserved table at key'
    * Cause: An attempt was made to insert or update columns in a join finds out who
    map to a table not kept the key.
    * Action: Change the directly underlying base tables.

    Can U please tell me why this error and how to solve?

    Thank you
    Mathon

    Mathon wrote:

    So, I have to look into some other method... I can't achieve this using a single update statement...

    Well, no matter what you do you need to decide what FST_NAME | ',' | Name to use. As I already pointed out for each line of the line of the s_party_d table there are several rows in table S_CONTACT_d. Again, you must yo decide what S_CONTACT_d table row you want to use. For example:

    update s_party_d e1
       set e1.name = (
                      select  max(e.FST_NAME) ||', '|| max(e.LAST_NAME)
                        from  S_CONTACT_d e
                        where e1.ROW_ID=e.ROW_ID
                     )
     where e1.ROW_ID in (
                         select  e.ROW_ID
                           from  S_CONTACT_d e
                        )
    /
    

    SY.

  • Error Lightroom: You cannot create the required folder

    Hello

    I have an error with the Lightroom program. I installed from application cloud creative and seems to be all right. When I open the program I get the error:

    There was an internal error. You cannot create the required folder: / users / lived / Library / Application Support / Adobe / Lightroom / metadata Presets.

    Captura de pantalla 2015-10-21 a las 10.23.48 a.m..png

    Report an error by CAT, but apparently there are problems and not receive messages from operators. They worked on my files internally and now have problems because the app says that some files cannot be synchronized.

    Can someone help me? Please

    Hi viviang,

    Greetings!

    There is a permission problem.

    Try to give permissions to both libraries (library system & user library) and the Applications folder.

    For the Applications folder

    ---------------------------------

    Open Finder

    On the left panel, you will find applications-> folder, right-click on this (CTRL + click) and then click on read the information.

    Inside you will find sharing and permissions - Click on this

    You will find an icon of padlock at the bottom right, click on the lock icon, and then he could ask your mac password, please put to.

    Now, click the little plus (+) and then add the users you want to, please make sure that you add the admin account.

    Give read and write at all.

    Click the gear icon at the bottom of the get info window and choose "Apply to the elements included" it appears a message that the changes cannot be undone - click OK to that.

    This measure will apply privileges and which can take some time depending on the size of the file.

    Once this is done, click the lock icon, and then close the get info window.

    Done with file applications here.

    For the user's library

    -----------------------

    Open Finder

    Click OK at the top of the page and select 'go to folder '.

    Type "~ / Library ' and press go

    Click (CTRL + click) on the library folder, if you are within this library, you can right click (ctrl + click) on an empty space between folders and then click on information

    Inside you will find sharing and permissions - Click on this

    You will find an icon of padlock at the bottom right, click on the lock icon, and then he could ask your mac password, please put to.

    Now, click the little plus (+) and then add the users you want to, please make sure that you add the admin account.

    Give read and write at all.

    Click the gear icon at the bottom of the get info window and choose "Apply to the elements included" it appears a message that the changes cannot be undone - click OK to that.

    This measure will apply privileges and which can take some time depending on the size of the file.

    Once this is done, click the lock icon, and then close the get info window.

    Made with the user here library folder.

    For the library system

    ----------------------------

    Open Finder

    Click OK at the top of the page and select 'go to folder '.

    Type "/ Library" and press go

    Click (CTRL + click) on the library folder, if you are within this library, you can right click (ctrl + click) on an empty space between folders and then click on information

    Inside you will find sharing and permissions - Click on this

    You will find an icon of padlock at the bottom right, click on the lock icon, and then he could ask your mac password, please put to.

    Now, click the little plus (+) and then add the users you want to, please make sure that you add the admin account.

    Give read and write at all.

    Click the gear icon at the bottom of the get info window and choose "Apply to the elements included" it appears a message that the changes cannot be undone - click OK to that.

    This measure will apply privileges and which can take some time depending on the size of the file.

    Once this is done, click the lock icon, and then close the get info window.

    Done with the record of the library system here.

    Please let me know if it works

    Please note: do not just right-click on MAC HD complete and provide all permissions that can bring the MAC in any startup mode.

    Concerning

    Jitendra Khatwani

  • ORA-19504: cannot create file when using rman

    Hello
    on 10g bR2 on windows machine my rman backup failed on a drive mapped with following error message:
    ORA-19504: cannot create file when using rman

    What do you suggest me?

    I heard that RMAN cannot write to the mapped file system. Is this true? Some people proposed:

    OracleService must be run by OS user with permissions

    But what oracle service? Target or RMAN catalog database database?

    Thank you.

    You must change your environment, on metalink:

    How to configure RMAN to write about readers shared on Windows NT/2000
    DOC - ID: Note: 145843.1

    Werner

  • Cannot open the file, I get the runtime error 429 ActiveV cannot create object

    I have sved a folder tax, but every time I try to open it, the runtime error 429 ActiveX cannot create... just until she made 3 times and tried all of the suggestions for correct... help!

    Finally, I contacted Vernisoft... signed up with them on top of a prior problem when I was hacked and they finally fixed it... after 3 hours.  In short, they have finally installed IE8 and the Run-time error notice disappeared and I was able to record and transmit my record.  No problem since so far.

  • Why we cannot create more than one primary key on a table. Why we create several unique key on a table. Please explain if anyone have details of this.

    Why we cannot create more than one primary key on a table. Why we create several unique key on a table. Please explain if anyone have details of this.

    «a primary key has semantic meaning, it is to be immutable (never change of value), unique and not null.»

    a unique constraint is simply "at any time, these values are unique - they can change and they can be null.

    You use a unique when constraint

    (a) you do not already have a primary key for a table can have only one
    (b) you allow NULL values in attributes
    "(c) to allow you to update the values in the attributes.

    https://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:5541352100346689891

  • call a function inside a function to insert into a table and receiver error - ORA-14551: cannot perform a DML operation within a query.

    Hi all

    your help is greatly appreciated...

    Calling B.fucntion inside an A.fonctions to insert data into a table.


    Here when you call the B.fucntion to insert data in the table... receiver AM a mistake

    Omitted in B - SQL Error: ORA-14551: cannot perform a DML operation inside a query...


    Can someone please help me to clarify this...


    The FUNCTION A(varUPD_TYPE IN VARCHAR2) RETURN VARCHAR2 IS
    varRETURN_VALUE VARCHAR2 (25): = NULL;

    numALLOWED_COUNT PROD. PROCESS_COUNTER. TYPE % ALLOWED_COUNT;
    numLAST_COUNT_ADDED PROD. PROCESS_COUNTER. TYPE % LAST_COUNT_ADDED;
    dtCHANGE_DATE DATE: = NULL;
    varSTMT VARCHAR2 (2000);
    bln_Allowed BOOLEAN;
    myVar VARCHAR2 (32767).


    BEGIN

    IF varUPD_TYPE = "A" THEN

    BEGIN
    SELECT CH_DATE, LAST_COUNT_ADDED, ALLOWED_COUNT
    IN dtCH_DATE, numLAST_COUNT_ADDED, numALLOWED_COUNT
    PROD. PROCESS_COUNTER
    WHERE NOM_PROCESSUS = "DAILY".
    AND COUNTER_IND = A '

    IF dtCH_DATE < = trunc (sysdate) THEN
    numLAST_COUNT_ADDED: = 0;
    END IF;

    EXCEPTION
    WHILE OTHERS THEN
    numLAST_COUNT_ADDED: = 0;
    numALLOWED_COUNT: = 1;
    END;
    IF numALLOWED_COUNT > = numLAST_COUNT_ADDED + 1 THEN

    bln_Allowed: = True;

    varSTMT: = "UPDATE PROD. TMS_PROCESS_COUNTER ';
    varSTMT: = varSTMT | ' SET last_count_added = ' | (numLAST_COUNT_ADDED + 1);
    varSTMT: = varSTMT | "WHERE nom_processus =" DAILY "';
    varSTMT: = varSTMT | "AND COUNTER_IND ="D"';


    IF varSTMT IS NOT NULL
    THEN
    MyVar: = B(96,varSTMT);
    PROC_LOG (' CALL B ': myVar);
    IF myvar > 0 THEN
    NULL;
    END IF;
    END IF;
    On the other

    End if;

    END IF;

    EXCEPTION WHEN OTHERS THEN
    PROC_LOG ("A failed '");
    PROC_LOG (' SQL error: ' |) SUBSTR (SQLERRM, 1, 1000));
    RETURNS A NULL VALUE.
    PUT AN END TO;

    The FUNCTION B(numTABLE_ID IN NUMBER, varSQL_STATEMENT IN VARCHAR2) RETURNS NUMBER IS
    varINSERT_BATCH_STMT VARCHAR2 (32767): = NULL;
    varADD_REC_TYPE BATCH_TABLES. TYPE % ADD_REC_TYPE;

    BEGIN

    INSERT INTO BATCH_STATEMENT (ID, TABLE_ID, STATEMENT, QUEUE_SEQUENCE_ID)
    VALUES (Numidian, numTABLE_ID, varSQL_STATEMENT, 1);

    EXCEPTION WHEN OTHERS THEN
    PROC_LOG ('B failed');
    PROC_LOG (' SQL error: ' |) SUBSTR (SQLERRM, 1, 1000));
    RETURNS - 1;
    END B;


    Structure of the Batch_statement table:


    ID Number (15) not null
    number (2) not null table_id
    Statement varchar2 (4000) not null
    Queue_sequence_id number (5) not null


    Why do you do such coding mess full of bad practices.

    Remove the exceptions WHEN OTHERS, you're a turing a mistake in this way, they are bugs and (never) use functions to perform DML.

    Functions are not intended for DML. Period.

  • creating a unique index of instaed of using the primary key index

    Hello

    I heard in a debate sometimes it is better to create a unique index on a column and use it instead of using the primary key index in oracle. I did not understand what that the reason propely.

    Can someone please help me in this topic if it is valid.

    Thanks in advance

    On the surface, which does not seem reasonable... Volume of the DML is irrelevent to determine which column is the primary key for a table.

    My wild speculation a bit at a reasonable time could someone do...

    If you use synthetic primary keys (i.e. the keys generated by sequence) and that your tables are subject to large volumes of inserts such as there is a danger that the block "to the right" will be the source of contention block and worry not about analysis of beach on the column, you can create a reverse on this column (unique or non-unique) key index before creating the primary key constraint and to indicate Oracle to use this existing index to respect the primary key constraint.

    Obviously, however, this involves a lot of assumptions to arrive at a reasonable point. There may well be another set of assumptions that could also lead to a valid argument. Or it could be a myth that someone has heard and just repeats.

    Justin

  • How to find product key Windows 8.1 on the laptop?

    I have a problem since to do the windows updates. My laptop of seams to have erased everything off my hard drive, I have a legitimate windows disk 8 to reinstall, no product key, but it is anyway to find it on the laptop?

    I have tried to do the regedit, but can't seam to find it anywhere

    When you buy new notebook and get with preinstalled OS, you will get a valid version that includes a valid product key.
    With other words original version you got with your machine is properly enabled. Product key belongs to this original version only and you cannot use it for activation if you want to install the version of the OS.

    Your version of Win8 to pick up the product key of Microsoft.

    Of course, you have the original version of the new OS but you must order by Toshiba - https://backupmedia.toshiba.eu/landing.aspx

  • How to find product key

    How can I find a key on a hp 20002b43dx export someone put Linux on the laptop and I want to put windows 8 on

    Yes, recovery disks will do this back just as it left the factory. Did you find your serial number on the label on the bottom of the laptop?

  • How to find duplicates in the table

    I have a table with 3 columns

    name of the table - used

    empcode firstname lastname
    XYZ 123 pk
    yzz 456 pk
    101 kkk jk


    ALTER TABLE employee
    ADD (CONSTRAINT PRIMARY KEY employee_PK
    (empcode, firstname, lastname))


    all the three columns are as key to porimary, we are migrating the data, there are problems with the data as the cobination of all three, resulting in duplicate, in the last column is supposed to be duplicates but first two columns will not have the duplicate and a complete line of the table (combination have no duplicates)

    a query need to find duplicates to validate the whole lines

    (B-)

    select empcode,firstname,lastname,count(*)
    from employee
    group by empcode,firstname,lastname
    having count(*)>1;
    

Maybe you are looking for