spool TABLE_INDEX_REORG_REBUILD_PREVALIDATIONS.log
set echo on
set linesize 300
col index_name for a30
col degree for a10
col status for a10
col table_name for a30
col owner for a30
col object_type for a20
col constraint_type for a20
col constraint_name for a30
col validated for a20
col degree for a10
set pagesize 100
select owner,object_type,status,count(*) from dba_objects where status <> 'VALID' and owner='SCOTT' group by owner,object_type,status order by owner;
select owner,index_name,status from dba_indexes where TABLE_OWNER='SCOTT' and status<>'VALID';
select index_name,status from dba_ind_partitions where status <> 'USABLE';
select CONSTRAINT_TYPE,STATUS,count(1) from dba_constraints where owner='SCOTT' group by CONSTRAINT_TYPE,STATUS;
set linesize 300
col index_name for a30
col degree for a10
col status for a10
select TABLE_NAME,INDEX_NAME,DEGREE,status from dba_indexes where OWNER='SCOTT' and degree not in (0,1);
select object_type , count(*),status from dba_objects where owner=upper('SCOTT') group by object_type,status order by object_type;
select table_name,index_name,logging from dba_indexes where OWNER='SCOTT' and logging = 'NO';
select distinct STATUS from v$datafile;
select constraint_name,constraint_type,table_name,status,validated from dba_constraints where owner='SCOTT' and status <> 'ENABLED';
select distinct owner from dba_segments where tablespace_name='&tablespace_name';
select distinct owner from dba_tables where tablespace_name='&tablespace_name';
select distinct owner from dba_indexes where tablespace_name='&tablespace_name';
select distinct table_owner from dba_tab_partitions where tablespace_name='&tablespace_name';
select distinct table_owner from dba_tab_subpartitions where tablespace_name='&tablespace_name';
select distinct index_owner from dba_ind_partitions where tablespace_name='&tablespace_name';
select distinct index_owner from dba_ind_subpartitions where tablespace_name='&tablespace_name';
select distinct STATUS from v$datafile;
select * from v$recover_file;
select distinct segment_type from dba_segments where tablespace_name='&tablespace_name';
select distinct status from dba_indexes;
select distinct status from dba_ind_partitions;
select distinct status from dba_ind_subpartitions;
spool off