本文主要是介绍收缩表和索引,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
收缩表和索引 释放空间
SELECT 'ALTER table '||OWNER|| '.'||table_NAME|| ' enable row movement ;'
FROM DBA_tables
WHERE OWNER= '&USER'
union all
SELECT 'ALTER table '||OWNER|| '.'||table_NAME|| ' shrink space ;'
FROM DBA_tables
WHERE OWNER= '&USER'
union all
SELECT 'ALTER table '||OWNER|| '.'||table_NAME|| ' disable row movement ;'
FROM DBA_tables
WHERE OWNER= '&USER'
UNION ALL
SELECT 'ALTER INDEX '||OWNER|| '.'||INDEX_NAME|| ' shrink space ;'
FROM DBA_INDEXES
WHERE TABLE_OWNER= '&USER'
FROM DBA_tables
WHERE OWNER= '&USER'
union all
SELECT 'ALTER table '||OWNER|| '.'||table_NAME|| ' shrink space ;'
FROM DBA_tables
WHERE OWNER= '&USER'
union all
SELECT 'ALTER table '||OWNER|| '.'||table_NAME|| ' disable row movement ;'
FROM DBA_tables
WHERE OWNER= '&USER'
UNION ALL
SELECT 'ALTER INDEX '||OWNER|| '.'||INDEX_NAME|| ' shrink space ;'
FROM DBA_INDEXES
WHERE TABLE_OWNER= '&USER'
这篇关于收缩表和索引的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!