时间:2021-07-01 10:21:17 帮助过:18人阅读
column SQLTEXT format a80
select count(*) from dba_segments where tablespace_name = ‘USERS‘ and segment_type=‘TABLE‘;
select ‘alter table ‘ || owner || ‘.‘ || segment_name || ‘ move tablespace dbs_temp;‘ sqltext from dba_segments where tablespace_name = ‘USERS‘ and segment_type=‘TABLE‘;
select count(*) from dba_segments where tablespace_name = ‘USERS‘ and segment_type=‘INDEX‘;
select ‘alter index ‘ || owner || ‘.‘ || segment_name || ‘ rebuild tablespace dbs_temp;‘ sqltext from dba_segments where tablespace_name = ‘USERS‘ and segment_type=‘INDEX‘;
select count(*) from from dba_lobs where tablespace_name = ‘USERS‘;
select ‘alter table ‘ || owner || ‘.‘ || table_name || ‘ move lob(‘ || column_name || ‘) store as(tablespace dbs_temp);‘ sqltext from dba_lobs where tablespace_name = ‘USERS‘;
Oracle收缩表空间
标签:count type temp ora build tab rebuild uil format