1.首先我用exp cgwp/cgwp@orcl file=xxxx.dmp 将数据导出(cgwp用户使用的表空间是cgwp)。
2.然后我新建了个cgwp_test用户,新建的表空间为cgwp_test.
3.接着执行imp cgwp_test/cgwp@orcl fromuser=cgwp touser=cgwp_test file=xxxx.dmp.当导到一半的时候报错,错误信息如下:
IMP-00003: ORACLE error 1658 encountered
ORA-01658: unable to create INITIAL extent for segment in tablespace CGWP
IMP-00017: following statement failed with ORACLE error 1658:
 "CREATE TABLE "WORDEDIT" ("ID" NUMBER(10, 0) NOT NULL ENABLE, "DURL" VARCHAR"
 "2(150) NOT NULL ENABLE, "SURL" VARCHAR2(150) NOT NULL ENABLE, "USER_ID" VAR"
 "CHAR2(32) NOT NULL ENABLE, "WE_TIME" NUMBER(11, 0) NOT NULL ENABLE, "STAT" "
 "NUMBER(11, 0) NOT NULL ENABLE, "WE_LOG" CLOB NOT NULL ENABLE, "XIUDING" NUM"
 "BER(11, 0) NOT NULL ENABLE)  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 "
 "STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TA"
 "BLESPACE "CGWP" LOGGING NOCOMPRESS LOB ("WE_LOG") STORE AS  (TABLESPACE "CG"
 "WP" ENABLE STORAGE IN ROW CHUNK 8192 PCTVERSION 10 NOCACHE  STORAGE(INITIAL"
 " 65536 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT))"
IMP-00003: ORACLE error 1658 encountered
ORA-01658: unable to create INITIAL extent for segment in tablespace CGWP
IMP-00017: following statement failed with ORACLE error 1658:
发现导入的表空间依然是cgwp而不是cgwp_test!!!!!!!
请各位走过路过的大侠们指点一下。

解决方案 »

  1.   

    ORA-01658 unable to create INITIAL extent for segment in tablespace stringCause: Failed to find sufficient contiguous space to allocate INITIAL extent for segment being created.Action: Use ALTER TABLESPACE ADD DATAFILE to add additional space to the tablespace or retry with a smaller value for INITIAL.
      

  2.   

    你导出数据库的表空间是cgwp,如果你要更改表空间,不能通过这个方法。
    你把表空间建成和原数据库表空间一样,看能否导入?
      

  3.   

    这是因为,当你import的时候,他就像在执行 建立table的script,并且带着这些参数 "TABLESPACE " "USER1" "LOGGING NOCOMPRESS" in the script,也就是说他会把table建立在原来的user1 tablespace但owner会为cgwp_test 。
      
      如果我不希望原来的ABC和新增的QQQ这两个table放在同一个tablespace上怎么办呢?
      
      alter user cgwp_test quota unlimited on cgwp_test;
      alter user cgwp_test quota 0 on cgwp;