首页 > 数据库 > Oracle > Oracle DBA 每天检查必备的sql(1)
SELECT tablespace_name, sum ( blocks ) as free_blk , trunc ( sum ( bytes ) /(1024*1024) ) as free_m,
max( bytes ) / (1024) as big_chunk_k, count (*) as num_chunks
FROM dba_free_space GROUP BY tablespace_nam
2、check free, pct_free, and allocated space within a tablespace
SELECT tablespace_name, max_blocks, count_blocks, sum_free_blocks,
to_char(100*sum_free_blocks/sum_alloc_blocks, '99.99') || '%'AS pct_free FROM
( SELECT tablespace_name, sum(blocks) AS sum_alloc_blocks FROM dba_data_files GROUP BY tablespace_name), ( SELECT tablespace_name AS fs_ts_name, max(blocks) AS max_blocks
, count(blocks) AS count_blocks, sum(blocks) AS sum_free_blocks FROM dba_free_space
GROUP BY tablespace_name )WHERE tablespace_name =fs_ts_name
3、To analyze tables and indexe
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/75375/viewspace-897680/ ,如需转载,请注明出处,否则将追究法律责任。