Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1078969
  • 博文数量: 1647
  • 博客积分: 80000
  • 博客等级: 元帅
  • 技术积分: 9980
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-13 15:15
文章分类

全部博文(1647)

文章存档

2011年(1)

2008年(1646)

我的朋友

分类:

2008-10-28 18:29:24


  做一个exp/imp lab:
  
  create a user apple1 default tablespace user1.
  create a user apple2 default tablespace user2.
  apple1 create a table ABC on user1 tablespace.
  
  我准备把ABC这个table汇出,然后汇入到apple2的schema名为QQQ的table,并且希望这个table要放在apple2的default tablespace (也就是user2)。
  
  1. exp full=y compress=n rows =y file=test.dmp
  
  2. imp system/jakfjks file=test.dmp fromuser=apple1 touser=apple2 tables=(ABC)
  
  importing APPLE1's objects into APPLE2
  IMP-00017: following statement failed with ORACLE error 1658:
  "CREATE TABLE "ABC" ("ID" NUMBER) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXT"
  "RANS 255 STORAGE(INITIAL 131072 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE ""
  "USER1" LOGGING NOCOMPRESS"
  IMP-00003: ORACLE error 1658 encountered
  ORA-01658: unable to create INITIAL extent for segment in tablespace USER1
  Import terminated successfully with warnings.
  
  奇怪,我明明是要import到user2这个tablespace上,为什么是user1 tablespace出现无法create extent的错误讯息?要新增extent应该也是在user2这个tablespace上呀?
  
  这是因为,当你import的时候,他就像在执行 建立table的script,并且带着这些参数 "TABLESPACE " "USER1" "LOGGING NOCOMPRESS" in the script,也就是说他会把table建立在原来的user1 tablespace但owner会为apple2 。
  
  如果我不希望原来的ABC和新增的QQQ这两个table放在同一个tablespace上怎么办呢?
  
  alter user apple2 quota unlimited on user2;
  alter user apple2 quota 0 on user1;
  
  So while importing this ABC get imported to user2 tablespace it won't use user1 tablespace~~
【责编:admin】

--------------------next---------------------

阅读(345) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~