I have a partitioned table that belongs to tablespace report. I want to move it to tablespace record instead.
One possibility is to drop the table and
The easiest way to move the data within tablespaces:
SELECT 'ALTER TABLE '||OWNER|| '.'||TABLE_NAME||' MOVE TABLESPACE ARCHIVE;'
FROM ALL_tables
where owner = 'owner_name'
and temporary != 'Y'
and partitioned != 'YES';
SELECT 'ALTER TABLE '|| TABLE_OWNER||'.'||TABLE_NAME||' MOVE PARTITION ' || PARTITION_NAME|| ' TABLESPACE ARCHIVE;' FROM ALL_tab_partitions
WHERE TABLE_OWNER = 'owner_name'
AND table_NAME NOT LIKE 'BIN$%';
SELECT 'ALTER INDEX '|| OWNER||'.'||OBJECT_NAME ||' REBUILD TABLESPACE ARCHIVE ;'
FROM ALL_OBJECTS
WHERE OBJECT_TYPE ='INDEX'
AND OWNER = 'owner_name';
SELECT 'ALTER INDEX '||I.INDEX_NAME||'REBUILD PARITION'|| S.PARTITION_NAME || ' TABLESPACE ARCHIVE '
FROM DBA_INDEXES I, DBA_SEGMENTS S
WHERE I.INDEX_NAME = S.SEGMENT_NAME
AND I.INDEX_TYPE IN ('NORMAL', 'BITMAP')
AND I.OWNER = 'owner_name';