jump to navigation

My Oracle Script Collection Februari 15, 2008

Posted by Tyo in Oracle.
add a comment

1. Moving all tables in a schema

select ‘alter table ‘|| table_name || ‘ move tablespace users’ from user_tables;

2. Moving all indexes in a schema

select ‘ALTER INDEX ‘ ||Index_name || ‘ REBUILD TABLESPACE INDX’ from user_indexes;

3. Check Tablespaces size in a database

SELECT df.tablespace_name TABLESPACE, df.total_space TOTAL_SPACE,
fs.free_space FREE_SPACE, df.total_space_mb TOTAL_SPACE_MB,
(lagi…)