表空间的移动的问题。

rushfly 2003-09-05 12:18:29

由于编程的不慎,将所有的用户表建在system表空间(大约40个),现在我新建了一个data表空间,想将system下的用户表全部移到data表空间,大家有什么好的建议或好的经验,请你告诉我!谢谢大家!!

如我用create table xxx ... tablespace system //这里指定了表空间。
现在我想将这些表全部移动data表空间去,当然一个一个来也可以,但是很麻烦,不知大家有什么好的主意?
...全文
39 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
rushfly 2003-09-07
  • 打赏
  • 举报
回复
thanks all!
David1289 2003-09-05
  • 打赏
  • 举报
回复
学习,关注
hrb_qiuyb 2003-09-05
  • 打赏
  • 举报
回复
原理通怎么做都可以的

我的建议是用alter table ... move 方式,对于带long、lob字段的表可以用exp,imp做特殊处理。
jiezhi 2003-09-05
  • 打赏
  • 举报
回复
建議使用exp/imp
  • 打赏
  • 举报
回复
alter table ...move

exp imp
jiezhi 2003-09-05
  • 打赏
  • 举报
回复
ALTER TABLE ... MOVE

If the table includes LOB column(s), this statement can be used to move the table
along with LOB data and LOB index segments (associated with this table) which the
user explicitly specifies. If not specified, the default is to not move the LOB data and LOB index segments.
l2g32003 2003-09-05
  • 打赏
  • 举报
回复
用脚本加 alter table ...move

spool c:\a.sql
select 'alter table '||object_name||' move tablespace data' from dba_objects
where owner='用户名' and object_type='TABLE';
spool off

运行 a.sql 就可以了

当然 你也可以安用户进行 exp imp

17,380

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧