ITPub博客

首页 > 数据库 > Oracle > imp到不同的tablespace中

imp到不同的tablespace中

原创 Oracle 作者:dotaddjj 时间:2011-08-01 18:08:38 0 删除 编辑
关于把dmp导入到不同的表空间中
conn ashuang/ashuang
select * from user_tables where table_name='DAVE'
此时ashuang.dave的tablespace是ycup
exp shuang/ashuang tables=dave file=d:test.dmp
创建user abc用来测试
create user abc identified by ashuang
default tablespace users
temporary tablespace temp
grant dba to abc --注意dba的role中包含了unlimited tablespace的权限
imp ashuang/ashuang fromuser=ashuang touser=abc file=d:test.dmp
select * from dba_tables where table_name='DAVE' and owner='ABC'
此时的abc.dave的tablespace并不是默认users表空间,而是原来ycup表空间。
看来在有了unlimted tablespace权限后oracle会默认把table的导入到原来的tablespace。
revoke unlimited tablespace from abc
alter user abc quota 0 on ycup
上面我们revoke unlimited tablespace和停止使用ycup 表空间
drop table abc.dave
imp ashuang/ashuang fromuser=ashuang touser=abc file=d:test.dmp
再次查看abc.dave的tablespace是默认的users了,所以当我们从一个库或者user导入dmp到另一个库或user下,可能存在default tablespace没有怎么使用,但是别的tablespace确使用的却很高,这跟dmp中table等对象相关。
可以把dmp导入到指定表空间中,但是对于强制指定的非缺省tablespace没有办法,可以参考我的blog种关于imp indexfile参数的使用来解决。[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25362835/viewspace-1053296/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    220
  • 访问量
    1662987