Oracle-TableSpace Move To

SELECT owner, segment_name, partition_name, tablespace_name , 'ALTER TABLE '||a.segment_name||' move PARTITION  '||a.partition_name||' tablespace TESTDB;'  
FROM dba_segments a 
WHERE 1=1
--AND owner = 'TEST'   
--AND tablespace_name  = 'USERS'
--AND segment_name like 'T_%'
AND partition_name LIKE 'DATE%'
ORDER BY segment_name ASC;

select TABLE_OWNER,table_name,partition_name,tablespace_name ,'ALTER TABLE '||table_name||' move PARTITION  '||partition_name||' tablespace TESTDB;'   
from dba_tab_partitions 
where tablespace_name = 'USERS'
AND table_name  LIKE'T_%'

表分区空间转移,乾坤大魔移。

posted @ 2023-09-04 15:03  *ち黑サカ  阅读(6)  评论(0编辑  收藏  举报