扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
select count(*) from dba_indexes where tablespace_name = 'SYSTEM' and owner not in ('SYS','SYSTEM') / |
select segment_name, count(*) from dba_extents where segment_type='INDEX' and owner=UPPER('&owner') group by segment_name / |
select substr(segment_name,1,20) "SEGMENT NAME", bytes, count(bytes) from dba_extents where segment_name in ( select index_name from dba_indexes where tablespace_name=UPPER('&表空间')) group by segment_name,bytes order by segment_name / |
select count(distinct 第一列||'%'||第二列)/count(*) from 表名 / |
analyze table 表名 compute statistics / |
select distinct_keys from user_indexes where table_name='表名' and index_name='索引名' / |
select num_rows from user_tables where table_name='表名' / |
select i.distinct_keys/t.num_rows from user_indexes i, user_tables t where i.table_name='表名' and i.index_name='索引名' and i.table_name=t.table_name / |
select column_name, num_distinct from user_tab_columns where table_name='表名' / |
validate index 用户名.索引名 / |
select name, del_lf_rows, lf_rows, round((del_lf_rows/(lf_rows+0.0000000001))*100) "Frag Percent" from index_stats / |
alter index 用户名.索引名 rebuild tablespace 表空间名 storage(initial 初始值 next 扩展值) nologging / |
alter index用户名.索引名 coalesce / |
analyze index 用户名.索引名 delete statistics / |
select index_name from dba_indexes where tablespace_name='SYSTEM' and owner not in ('SYS','SYSTEM') / |
set linesize 120 col "OWNER" format a20 col "INDEX" format a30 col "TABLE" format a30 col "TABLESPACE" format a30 select i.owner "OWNER", i.index_name "INDEX", t.table_name "TABLE", i.tablespace_name "TABLESPACE" from dba_indexes i, dba_tables t where i.owner=t.owner and i.table_name=t.table_name and i.tablespace_name=t.tablespace_name and i.owner not in ('SYS','SYSTEM') / |
col segment_name format a30 select owner, segment_name, sum(bytes) from dba_segments where tablespace_name='数据表空间名' and segment_type='INDEX' group by owner,segment_name / |
set linesize 100 col owner format a10 col segment_name format a30 col tablespace_name format a30 select count(*), owner, segment_name, tablespace_name from dba_extents where segment_type='INDEX' and owner not in ('SYS','SYSTEM') group by owner,segment_name,tablespace_name having count(*) >10 order by count(*) desc / |
set linesize 120 col "INDEX" format a30 col "TABLESPACE" format a20 select owner "OWNER", segment_name "INDEX", tablespace_name "TABLESPACE", bytes "BYTES/COUNT", sum(bytes) "TOTAL BYTES", round(sum(bytes)/(1024*1024),0) "TOTAL M", count(bytes) "TOTAL COUNT" from dba_extents where segment_type='INDEX' and segment_name in ( '索引名1', '索引名2', ...... ) group by owner,segment_name,segment_type,tablespace_name,bytes order by owner,segment_name / |
select round(bytes/(1024*1024),2) free(M) from sm$ts_free where tablespace_name='表空间名' / |
alter index 索引名 rebuild tablespace 索引表空间名 storage(initial 初始值 next 扩展值) nologging / |
select * from dba_extents where segment_name='索引名' / |
select * from dba_ind_columns where index_name like '表名%' / |
select * from '表名%' where ...... / |
select 'alter tablespace '||tablespace_name||' coalesce;' from dba_free_space_coalesced where percent_blocks_coalesced!=100 / |
alter tablespace 表空间名 coalesce / |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。