如题,表tabel现在所在的表空间为tabelspaceA,现要将tabel的数据移动到tabelspaceB,tabel表有索引,有表分区。
解决方案 »
- oracle update 更新某一列有两个相同值,我想将这两个相同值,更新成不同的值应该怎么做?请指教!!!
- Oracle数据库创建一个表空间的异常
- 难度SQL,请帮忙解决!急!在线等 。。。。。。。。。。。。
- oracle9i中文教程
- 最近没什么事,想进一步学Oracle,正在弄pl/sql,不知方向对不对,大家可以告诉我就今后发展而言应该学些什么好呢
- 请问:写一个管理软件要用到使多种不同的数据库,怎么能实现可在不同的数据库中都可正常应用
- 关于grant的说明
- 难题,难题请教!~~
- 请教高手,怎样找出表中重复的记录,这句SQL语句怎么写?
- 游标的使用。急急急。电脑前死等。请大神帮助。
- oracle 没有dba权限,如何杀掉死锁的进程。
- 硬盘列盘,Oracle数据文件怎么冷恢复出来
alter table table_name move tablespace tablespace_name(非分区表)用move移动时候要注意:
1、索引需要重build
2、move操作会锁表,对于操作繁忙的表做move可能影响深远
ALTER INDEX INDEX_NAME REBUILD TABLESPACE TABLESPACE_NAME;
from user_tab_partitions
where table_name ='XXX'
;
alter table tablename move tablespace users;
2。分区表,单个移动
alter table partitioned_tab move partition part1 tablespace newtablespace1;
alter table partitioned_tab move partition part2 tablespace newtablespace2;
create table table1 as select * from user.tabel --user 就是创建此表的用户在user登陆
set long 1000
select dbms_metadata.get_ddl('TABLE','TABEL','USER') FROM DUAL 查看表的定义约束 在在目的表加同样的约束
--普通表
alter table tabel move tablespace tabelspaceB
--分区表
alter table tabel move partition PARTITION_NAME move tablespaceB--移动表索引会失效所以必须重建
alter index index_name rebuild tablespace tabelspaceB --重建索引
alter table tabel move tablespace tabelspaceB
--分区表
alter table tabel move partition PARTITION_NAME move tablespaceB--移动表索引会失效所以必须重建索引
alter index index_name rebuild tablespace tabelspaceB
select 'alter table '|| table_name || ' move partition ' || partition_name ||' tablespace XXXX;'
from user_tab_partitions
where table_name ='XXX'
;
学习…