oracle

Перенос таблиц из old_tablespace на my_new_tablespace

SELECT ‘ALTER TABLE ‘ || table_name || ‘ MOVE TABLESPACE my_new_tablespace;’ AS cmd
FROM user_tables WHERE table_name IN
(SELECT table_name FROM user_tables WHERE 1 = 1 AND tablespace_name = ‘old_tablespace’)
UNION ALL

SELECT ‘ALTER INDEX ‘ || index_name || ‘ REBUILD TABLESPACE my_new_tablespace;’
FROM user_indexes WHERE table_name IN
(SELECT table_name FROM user_tables WHERE 1 = 1 AND tablespace_name = ‘old_tablespace’)

Думаю можно еще сбросить статистику

You can delete the statistics associated with a table by issuing:

ANALYZE TABLE <table_name> DELETE STATISTICS;

You can delete statistics on one index by issuing the following statement:

ANALYZE INDEX <index_name> DELETE STATISTICS;

для ВСЕХ объектов БД вывести табличное пространство, в котором они находятся?

select * from dba_segments where tablespace_name = ‘SYSAUX’

Пролистать наверх