Primary key, unique key impdp problem

Hi, during my impdp I came across problems with constraints being violated. So I disabled all constraints in a proper order. It didn't help. There are still the same errors. I checked some individual constraints that were problematic and it turned out that they were all disabled as I expected. I don't understand why datapump still shows these errors despite constraints are DISABLED.

But if the unique index exists on the target table it does not matter if the PK is disabled or not. You would need to drop the index; however, this shows you have a data problem.
Why do you have duplicate keys? If you import duplicates then rebuilding the unique index would result in an error.
Do you need to truncate or drop some of the target tables before importing?
These are points I raised in my first response and which you have not addressed in your answer.
HTH -- Mark D Powell --

Similar Messages

  • Primary key,Froign key , Unique key

    I want the answer of following questions.
    1) Primary key create cluster index or simple index?
    2) What is cluster index : I know only( cluster index stored record at physical level in sorted order) if there is another difference then tell me
    3) Can I set relation ship with unique key if it is specified with NOT NULL constraints in a table.
    4) Foreign key creates a index or not?

    Hello
    I want to be at least 6 inches taller, better looking and really good at playing the drums, but that's neither here nor there.
    A simple please never hurts.
    For answers to the first 2 I'd concentrate on the clusters section of the concepts guide as your understanding of what clusters are for and when they should be used appears to be lacking:
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96524/c11schem.htm#25479
    and also have a look at this asktom thread:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:6996872588440689863::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1308402202736
    The last two questions, again you can find the info you need in the concepts guide but
    3) Can I set relation ship with unique key if it is specified with NOT NULL constraints in a table.To set up a foreign key from one table to another, it needs to reference a primary key or a unique key in the target table, the NOT NULL constraint has very little to do with it. A very simple test will show this:
    SQL> create table dt_test(id number);
    Table created.
    SQL> create table dt_test_fk(id number);
    Table created.
    SQL> create table dt_test_fk(id number, pk_id number);
    Table created.
    SQL> alter table dt_test_fk add constraint fk_dt_test_fk FOREIGN KEY(pk_id) references dt_test(id);
    alter table dt_test_fk add constraint fk_dt_test_fk FOREIGN KEY(pk_id) references dt_test(id)
    ERROR at line 1:
    ORA-02270: no matching unique or primary key for this column-list
    SQL> alter table dt_test add constraint uk_dt_test UNIQUE (id);
    Table altered.
    SQL> alter table dt_test_fk add constraint fk_dt_test_fk FOREIGN KEY(pk_id) references dt_test(id);
    Table altered.
    SQL> alter table dt_test modify(id number not null);
    Table altered.
    4) Foreign key creates a index or not? Creating a foreign key on a column does NOT automatically create an index on that column.
    A primary key may create a new index. If an index is already available on the table and it can be used i.e the leading edge of the index holds the columns in the primary key, it will be used rather than creating a new one.
    HTH

  • Normal Indexes created for Primary/Unique Keys in Oracle8/8i

    I remeber prior to Oracle8, when we create a Primary/Unique Key constraints, an unique index will be created by default. But I am noticing now in 8/8i when we create either Primary or Unique key, only normal/simple index is created. We are not able to override this normal index either by dropping and recreating the index alone. I believe it would be pretty much better in case of performance if we have a unique index for this columns. Can anybody help why is it changed so in 8/8i??
    Thanks,
    R. M.

    Dear Rob,
    since your answer was helpful and since it was the only one I will grant you full points on that.
    Thanks again for your input. In case other developers should look this thread up being confronted
    with the same kind of problem, here is how we solved it:
    We added an artificial primary key (a number of type NUMC 8) to the table which is supposed to
    include the structure. This key alone takes care of the uniqueness of eacht entry.
    All the others fields that we want to have available for a fast direct access, including the ones
    from the included structure, are put together in a secondary index.
    best regards
    Andreas

  • Diff b/w primary key and unique key?

    what is the diff b/w primary key and unique key?

    Hi,
    With respect to functionality both are same.
    But in ABAP we only have Primary key for the Database tables declared in the Data Dictionary.
    Unique is generally is the term used with declaring key's for internal tables.
    Both primary and Unique keys can identify one record of a table.
    Regards,
    Sesh

  • Ms sql - {"The referenced table must have a primary or candidate key. [ FK Name = ForeignKeyB_Details ]"}

    I have a txt file which has all the sqltext in it separated by semi colon .Then I try to run a query one by one like this-
                var conn = new SqlCeConnection(ConnectionString);
                conn.Open();
                var cmdArray = Regex.Split(sqlText, ";");
                var cmd = new SqlCeCommand(null, conn);
                foreach (var text in cmdArray)
                    cmd.CommandText = text;
                    if (!text.Equals(string.Empty))
                        cmd.ExecuteNonQuery();
                    else
                        break;
                conn.Close();
    I get the error {"The referenced table must have a primary or candidate key. [ FK Name = ForeignKeyB_Details  ]"}
    here is part of my txt file-
    CREATE TABLE A
           PrimaryId nvarchar(10) NOT NULL REFERENCES C(PrimaryId),
           UserId nvarchar(20) NOT NULL,
           FirstName nvarchar(30) NOT NULL,
           MiddleInitial nvarchar(1) NULL,
           LastName nvarchar(30) NOT NULL,
           MobileNumber nvarchar(20) NULL,
           PhoneNumber nvarchar(10) NOT NULL,
           PhoneExtension nvarchar(6) NULL,
           FaxNumber nvarchar(20) NULL,
           EmailAddress nvarchar(50) NOT NULL,
      CONSTRAINT PrimaryKeyA PRIMARY KEY(PrimaryId, UserId)
    CREATE TABLE B(
       MarketId int NOT NULL references E(MarketId),
       UserId nvarchar(20) NOT NULL,
       UserFirstName nvarchar(30) NOT NULL,
       UserMiddleInitial nvarchar(1) NOT NULL,
       UserLastName nvarchar(30) NOT NULL,
       PhoneNbr nvarchar(10) NOT NULL,
       Extension nvarchar(6) NOT NULL,
       FaxNbr nvarchar(20) NOT NULL,
       Email nvarchar(50) NOT NULL,
       ShortName nvarchar(10) NOT NULL,
    PublicIdFlag nvarchar(6) NOT NULL references D(publicId),
            CONSTRAINT PrimaryKeyB PRIMARY KEY( MarketId, UserId)
    ALTER TABLE B ADD CONSTRAINT ForeignKeyB_Details FOREIGN KEY(UserId, UserFirstName, UserMiddleInitial, UserLastName, PhoneNbr, Extension, FaxNbr, Email) REFERENCES A(UserId, FirstName, MiddleInitial, LastName, PhoneNumber, PhoneExtension, FaxNumber, EmailAddress);

    Hi,
    Foreign key columns are frequently used in join criteria when the data from related tables is combined in queries by matching the column or columns in the FOREIGN KEY constraint of one table with the primary or unique key column or columns in the other table.
    For more information about the foreign key constraint, please refer to this link:
    http://msdn.microsoft.com/en-us/library/ms175464.aspx
    Here is a similar thread for your reference:
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/5a71948b-dfb1-46a5-8688-ccab9317e959/error-message-the-referenced-table-must-have-a-primary-or-candidate-key-fk-name-fktblatblb-?forum=sqlce
    Thanks.
    Tracy Cai
    TechNet Community Support

  • Strange Unique Key Error When Copying Cube

    I have an empty cube (cube2) I checked it many times. I am copying data from cube1 using an info package. In Info Package I set delete option, i.e., delete existing data in cube2 before loading.
    As soon as loading starts, I get a short dump with error message:
    An entry was to be entered into the table                                                     |
    "\FUNCTION=RSAR_ODS_GET\DATA=L_TH_ISOSMAP" (which should have
    had a unique table key (UNIQUE KEY)).
    However, there already existed a line with an identical key.
    The insert-operation could have occurred as a result of an INSERT- or
    MOVE command, or in conjunction with a SELECT ... INTO.
    The statement "INSERT INITIAL LINE ..." cannot be used to insert several
    |     initial lines into a table with a unique key.     
    I tried other cubes, same error occurs. I checked on SN, people have encountered this error but solution is not posted. Any idea, how can I get rid of the error.
    Thanks a lot.

    Hi
    Try to load from Cube1 to cube2 without using that option and see if it loads. If that works then add an extra step on the
    process chain ' Delete overlapping requests from the target ' after the infopackage load .
    Thanks
    Jay.

  • Problems Engineering Surrogate Primary Key with Unique Key

    SDDM 3.3.0.747 with 2 problems (at least so far).  I am hoping that the problem is with this SDDM rookie and I have overlooked some setting. PROBLEM 1 I don’t want to start a religious debate about surrogate vs. natural keys but I am having a problem engineering both correctly from the logical model.  I am a rookie when it comes to SDDM but have many years of experience with Designer. By default I like to have both a natural UID  (UK) and a surrogate key based primary UID (PK) which is used for foreign keys.  The problem I am having with engineering is I can successfully engineer the surrogate PK’s, engineer the FK’s using the PK’s but cannot get the unique key to contain the surrogate keys in the child table.  If I check the identifying property in the relations, the PK columns and the UK columns are included in the child PK and the UK contains no columns. The Setup I have defined two reference entities, PROBABILITY and SEVERITY with natural unique keys defined.  I also have a child entity RISK_ASSESMENT with relationships back to the PROBABILITY and SEVERITY entities and both have the “Use surrogate keys:”: check box checked.  The unique key for the RISK_ASSESMENT entity includes the relationships back to PROBILITY and SEVERITY.  None of the entities have a PK or surrogate key defined and they all have the “Create Surrogate Key” check box checked.  In addition the following preferences are set: Data Modeler/Model/Logical   NOT Checked - Use And Set First Unique Key As Primary Key   NOT Checked – Name – Keep as the name of the Originating attribute   Checked – Entity Create Surrogate Key   Checked – Relationship Use Surrogate Key PROBLEM 2 When the foreign key columns are engineered I want the names to have a prefix “FK_” but they don’t.  Templates are set as follows: Data Modeler/Naming Standard/Templates   Foreign Key:  FK_{child}{parent}   Column Foreign Key:  FK_{ref column} Engineer to Relational Model/General Options   Checked - Apply name translation Marcus Bacon

    I have been switching between SD 4 EA1 and SDDM 3.3 trying to get things to work and trying out the template table for adding audit columns (really nice!).
    Concerning Problem1.  No matter what settings I use and whether I use SDDM 3.3 or SDI cannot get the FK columns to be included in the UK even though the relations are included in the UID in the entitty.  When I open the properties of the child table and click on the naming standards button and click ok it complains that the UK is not complete.  I add the FK columns to the UK and all is well including the naming standards.
    Concerning Problem 2.  Sometimes it engineers the names for FK's from the template and sometimes it doesn't.  Didn't see a pattern.  Gave up trying and used Naming Standards button.  I still had to change a few.
    The good new is, that after make changes needed in UK's and Column names of 18 tables, I know have everything deployed to Test except FK Indexes.  I think I have to do those by hand.
    Marcus Bacon

  • Unique key violation i.e. primary key violation in JSF page

    Hi, I am using Jdeveloper 11.1.1.5.0 and working with adf fusion web application. I have created entity object and view object. In view object I have primary key and I have set it's type to DB sequence. THe problem is though the attribute is DB sequence. IN JSF page it show unique key violation i.e. primary key violation. Please help me

    So, do you have a trigger in the database that updates the value of the primary key? Or do you assign the value in some other way?
    You can check [url http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/toc.htm]the docs for information about the ways it can be done.

  • Is their a difference between primary key and unique key with not null valu

    What is the difference in having a column as primary key and having unique key with not null for the column.
    vinodh

    SBH wrote:
    For quick review, below is the link
    http://www.dba-oracle.com/data_warehouse/clustered_index.htm
    You appear to have stumbled on a site that is a mine of disinformation about Oracle.
    >
    It would be helpful, if you explain it too..thnx !!
    The site is wrong and makes up its own terminology as it goes along.
    If the value for clustering factor approaches the number of blocks in the base table, then the index is said to be clustered. http://www.oracle.com/pls/db112/search?remark=quick_search&word=clustered+index
    There is no create clustered index in Oracle.
    - Clustering factor affects the efficiency of an index.
    - There can be clustered tables that you can create indexes on.
    - An Index Organized table is a similar concept to the Microsoft SQL Server clustered index, but it isn't the same thing at all.

  • Difference between Primary Key and Unique Key with NOT NULL constraint

    As both can be referred to another table.
    Apart from the difference that Primary Key can be only 1 and Unique keys can be multiple,
    is there any difference?
    Like in terms of type of Index?

    PARAG_C wrote:
    As both can be referred to another table.
    Apart from the difference that Primary Key can be only 1 and Unique keys can be multiple,
    is there any difference?
    Like in terms of type of Index?Technically there is almost no difference. Logically the two are often used for slightly different concepts.
    The PK (and with it the index) is often an ID column filled by a seqeunce. This key can then be refenced by foreign key constraints on other tables. it is very useful to have this as a meaningless technical construct. Because then the chance that such a ID needs to be changed is extremly slim.
    The UK (and with it the index) is often one or several columns that represent the logical key for the entity. Foreign key constriants should not point to this. THe chance that this attribute will be changed at some point in time is way higher then for a meaningless number (ID).

  • Difference between PRIMARY KEY and UNIQUE KEY with NOT NULL

    What is the difference between PRIMARY KEY and UNIQUE KEY with NOT NULL constraint?
    Message was edited by:
    Nilesh Hole

    Answer for the master!!!
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8743855576462
    Thanks,
    Karthick

  • Difference between Unique key and Primary key(other than normal difference)

    Hello,
    1).Can any one tell me any other difference between Unique key and Primary key other than it having NULLs.
    2). What is the difference the words 'DISTINCT' and 'UNIQUE' in a sql query.
    Thanks in advance.

    Hi
    If you don't believe me than see the documentation in
    OTN.
    Ott Karesz
    http://www.trendo-kft.hu
    SQL> create table scott.tbl_clob
      2  (sss CLOB)
      3  /
    Tabelle wurde angelegt.
    SQL> insert into scott.tbl_clob values('wrwrwrw')
      2  /
    1 Zeile wurde erstellt.
    SQL> insert into scott.tbl_clob values('wrwrwrw')
      2  /
    1 Zeile wurde erstellt.
    SQL> select distinct sss from scott.tbl_clob
      2  /
    select distinct sss from scott.tbl_clob
    FEHLER in Zeile 1:
    ORA-00932: nicht übereinstimmende Datentypen
    SQL> select unique sss from scott.tbl_clob
      2  /
    select unique sss from scott.tbl_clob
    FEHLER in Zeile 1:
    ORA-00932: nicht übereinstimmende Datentypen
    SQL> select distinct to_char(sss) from scott.tbl_clob
      2  /
    TO_CHAR(SSS)
    wrwrwrw
    SQL> select unique to_char(sss) from scott.tbl_clob
      2  /
    TO_CHAR(SSS)
    wrwrwrw
    SQL>

  • How shall we do validation for Unique Key and Multiple Primary Key?

    Hi,
    I have table created From EO in which one column is checked as Unique.
    How to do validation for column checked as Unique.
    I know how to do validation for column checked as primary key.
    Below is sample code for primary key validation
    if (getRvSize() != null)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // EO name
    getPrimaryKey(), // EO PK
    "RvSize", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_NO_UPDATE"); // Message name
    if (value != null)
    OADBTransaction transaction = getOADBTransaction();
    Object[] rvKey = {value};
    EntityDefImpl rvDefinition = xxczVAGCSRVSizingEOImpl.getDefinitionObject();
    xxczVAGCSRVSizingEOImpl rv =
    (xxczVAGCSRVSizingEOImpl)rvDefinition.findByPrimaryKey(transaction, new Key(rvKey));
    if (rv != null)
    throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
    getEntityDef().getFullName(), // EO name
    getPrimaryKey(), // EO PK
    "RvSize", // Attribute Name
    value, // Attribute value
    "AK", // Message product short name
    "FWK_TBX_T_EMP_ID_UNIQUE"); // Message name
    What changes need to be done for above code in order to do the validation for Unique Key.
    I have one more Question
    How shall we do the Validation for Multiple Primary Key in a table?
    - Mithun

    1. If you just validate on one attribute like your unique key, then put your logic in the set<Your AttributeName) method
    2. If you want to do the cross validation ( like validating multiple attributes) then put your logic in the validateEntrity Method
    How to do that?
    1. Create a Validation View object.
    2. Associate your VVO to the VAM
    3. Create entity expert.
    4. Have method in entity expert for your validation (you would be calling AM and then VO execute the query and do the validation.
    5. You would be calling the Entity experty method from your EO either setMethods or validateEntity.
    I have given just the high level points.
    Hope this helps.
    Thanks,
    RK

  • Primary/Unique key for GL_IMPORT_REFERENCES

    Hi all,
    We are on EBS11.5.10. I have the following requirement. I need to put a snapshot log on GL_IMPORT_REFERENCES which we will use to interface data to out reporting environment. Therefore i need to set a primary key on GL_IMPORT_REFERENCES, this is required for creating the snapshot log.
    Can anyone suggest what combination of fields would be unique for this table, as no unique key is set.
    TIA

    mma,
    but do you tie them in with ETL? or they're simply uniqe auto-number-like?
    Thanks
    I just found this:
    http://datawarehouse.ittoolbox.com/groups/technical-functional/informatica-l/re-about-oracle-bi-and-fact-tables-and-image-tables-1515935
    Looks like there's a new methodology for extending the DWH. I'm still looking into this, but I still think auto-numbering ROW_WID is a good idea.
    Mma, perhaps - could you provide me with an example or two to present this change. Thanks

  • Problem with unique key for Fiscal_T_Time dimension lookup

    Hi,
    In my mapping, I use Lookup on Fiscal_T_Time dimension provided by oracle. The validation gives me a warning,saying "VLD-1603:Lookup condition for key lookup Fiscal_T_Time does not contain a complete unique key". I'm using <source_group>.date as input and L_Day_day as lookup column, which is shown as I select the unique key from the drop down list. Both have type matches. The configuration on the dimension also shows the constraint of the unique Key. What can be wrong?

    Continue my issue in another thread by Daming Wang on "More constraints need to add to Dimension". Thanks.

Maybe you are looking for