DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: Import into the table already has rows

  1. #1
    Join Date
    Nov 2000
    Posts
    62
    I want to perform full improt using full exported dump file.

    The target database already has objects that I want to import from the dump file, as well as rows.

    Even thought I import ignore=Y , commit=y option, It takes too long and I see too long error message about constraints.
    (since some of rows are already in the database)
    What is the best way to import in this case.
    If truncate is the best option, Do I need to truncate sys and system's object also.


  2. #2
    Join Date
    Apr 2000
    Posts
    126

    Wink

    Disable contraints.
    Truncate tables (not sys and system).
    Drop tables.
    Import
    Enable contraints.

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Or,
    1. disable constraints
    2. truncate tables (not sys or system)
    3. imp system/manager file=foo.bar ignore=y
    4. enable constriants
    Jeff Hunter

  4. #4
    Join Date
    Nov 2000
    Posts
    62
    I disabled constraints , truncated tables and drop objects and then I imported. It worked.

    I disabled constrains, truncated tables and imported with ignore=y option then I got the following errors.

    Why is that? What is different between dropping objects or not? when I use ignore=Y option.

    IMP-00017: following statement failed with ORACLE error 2261:
    "ALTER TABLE "FILES" ADD UNIQUE ("VIDEO_ID","FILE_FORMAT_ID") USING INDEX P"
    "CTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE (INITIAL 20480 NEXT 16384 MINEXTE"
    "NTS 1 MAXEXTENTS 121 PCTINCREASE 50 FREELISTS 1 FREELIST GROUPS 1 BUFFER_PO"
    "OL DEFAULT) TABLESPACE "DEVELOPMENT" ENABLE"
    IMP-00003: ORACLE error 2261 encountered
    ORA-02261: such unique or primary key already exists in the table


  5. #5
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    You dropped the tables and recreated 'em using import, you don't get any errors. But, you are trying to add constraint which already exists.

    No big deal. Just an error message...

  6. #6
    Join Date
    Nov 2000
    Posts
    62
    But, I specify import option ignore= Y. and there are lots of other constraints.
    why do I get an error message about that constraint?


  7. #7
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    does data got loaded or not ? This is the only error message you got or any other messages. If just indexes you can always drop 'em and recreate 'em with a script.

  8. #8
    Join Date
    Nov 2000
    Posts
    62
    One more same error message related to other table.

    I don't know the reason, but It is better to drop the objects and import into the database. (truncate is not enough.)

    Thanks.

  9. #9
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    I dunno why its giving problems, I did somany times. Try with no data first. and Just data nothing else in the second step.

    1)imp system/xxx full=y ignore=y rows=n consitent=y
    2)imp system/xxx full=y ignore=y rows=y commit=y indexes=n grants=n

  10. #10
    Join Date
    Jun 2000
    Posts
    417
    It's complaining that the constraint already exists, this is because you only disabled it, not dropped it. Your original still exists. The error is ok and can be ignored.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width