Mi lista de blogs

viernes, 11 de septiembre de 2015

Reconstruccion de Indices y Estadisticas



Recrear indices

alter index OWNER.NOMBREDELINDICE  compute rebuild;

Reconstruir estadísticas

alter index OWNER.NOMBREDELINDICE  compute statistics;



Reporte para ver todos los INDICES con : Owner, Index_name, Index_type, table_owner, table_name, uniqueness.


   select owner      "Owner",
                                         index_name "Index_Name",
                                         index_type "Index_Type",
                                         table_owner "Table_Owner",
                                         table_name "Table_Name",
                                         uniqueness "Uniqueness",
                                         owner       sdev_link_owner,
                                         index_name  sdev_link_name,
                                         'INDEX'     sdev_link_type
                                    from sys.dba_indexes
                                   where (:OWNER is null or instr(owner,upper(:OWNER)) > 0)
                                     and substr(table_name,1,4) != 'BIN$'
                                     and substr(table_name,1,3) != 'DR$'
                                     and (:TABLE_NAME is null or
                                         instr(upper(table_name),upper(:TABLE_NAME)) > 0)
                                   order by owner, index_name



No hay comentarios:

Publicar un comentario