2. |
Move all objects from old tablespace to new tablespace:
All remaining objects are move from the old tablesapce (with the obsolete
datafile(s)) to the new created tablespace using corresponding commands for tables,
partitions, or indexes.
ALTER TABLE table_name MOVE TABLESPACE
new_tablespace;
ALTER TABLE table_name MOVE PARTITION
partition_name TABLESPACE new_tablespace;
ALTER INDEX index_name REBUILD TABLESPACE
new_tablespace;
|
7. |
Check for invalid or unusable objects: Even if all objects are valid you might have
INVALID or UNUSABLE indexes. Rebuild them!
-- Select invalid objects
COLUMN object_name format a32
SELECT owner,
SUBSTR(object_name, 1,
32) "OBJECT_NAME",
status
FROM dba_objects
WHERE status != 'VALID'
AND owner NOT IN ('SYS','ORDSYS','ORDPLUGINS')
ORDER BY 1, 2;
--
-- Select invalid indexes
SELECT owner, table_name, index_name, status
FROM dba_indexes
WHERE status != 'VALID'
AND partitioned != 'YES'
AND owner NOT IN ('SYS','ORDSYS','ORDPLUGINS')
ORDER BY 1, 2, 3;
--
-- Select unusable partitioned indexes
SELECT index_owner, partition_name, index_name, status
FROM dba_ind_partitions
WHERE status != 'USABLE'
AND index_owner NOT IN
('SYS','ORDSYS','ORDPLUGINS')
ORDER BY 1, 2, 3;
|