select index_name,
table_name,
tablespace_name,
index_type,
uniqueness,
status
from dba_indexes
where owner = '<用户名>';
select index_name,
table_name,
column_name,
index_owner,
table_owner
from dba_ind_columns
where table_owner = '<用户名>';
select index_name,
table_name,
tablespace_name,
pct_free,
pct_increase,
initial_extent,
next_extent,
status
from dba_indexes
where owner = '<用户名>';
alter index scott.emp_ename_idx rebuild
pctfree 40
storage (next 300k);
select segment_name, segment_type, tablespace_name, extents
from dba_segments
where owner = '<用户名>'
and segment_type = 'INDEX';
alter index scott.emp_ename_idx allocate extent;
alter index scott.emp_ename_idx deallocate unused;
alter index scott.emp_ename_idx coalesce;
alter index scott.emp_ename_idx rebuild online;
alter index emp_ename_idx monitoring usage;
生成启用索引监控语句:
select 'alter index ' || owner || '.' || index_name || ' monitoring usage;'
from dba_indexes
where owner = '<用户名>';
select ename, job, sal
from scott.emp
where ename like 'C%';
select * from v$object_usage;
alter index emp_ename_idx nomonitoring usage;
生成禁用索引监控语句:
select 'alter index ' || owner || '.' || index_name || ' nomonitoring usage;'
from dba_indexes
where owner = '<用户名>';