--查看总的表空间大小
select t.tablespace_name,
round(t.bytes / 1024 / 1024 / 1024, 2) || 'G' "总大小",
round((t.bytes - f.bytes) / 1024 / 1024 / 1024, 2) || 'G' "已使用",
round(100 * (t.bytes - f.bytes) / t.bytes, 2) || '%' "使用率"
from (select tablespace_name, sum(bytes) bytes
from dba_data_files
group by tablespace_name) t,
(select tablespace_name, sum(bytes) bytes
from dba_free_space
group by tablespace_name) f
where f.tablespace_name(+) = t.tablespace_name
--查看分区表个数
select * from dba_part_tables where table_name = 'BROWSE_TWO'
--查看大小
select segment_name as tablename, bytes b,bytes/1024 kb,bytes/1024/1024 mb from user_segments order by bytes desc
--查看分区表大小
select * from dba_segments c where c.segment_name = 'BROWSE_TWO'
--分区表
select * from user_tab_partitions b where b.table_name = 'VOD_TWO'
--删除分区表表
alter table BROWSE_TWO drop partition BROWSETWO201808 update global indexes
select * from all_tables where tablespace_name = 'TEEMO'
where table_name = 'test'
select * from all_part_key_columns a where a.owner = 'teemo'
--失效对象(是否正常执行)
select owner,object_name,object_type,status from dba_objects where status = 'INVALID'