Code: Detail

Plsql - (Portuguese)

Rebuild Index

Rotina aplica o rebuild nos index a partir do owner, A partir da quantidade de campos de um index é aplicado o rebuild compress.

Last update: 11/12/2013
Plsql  Oracle     
 
8,5
2
N/A
N/A
 

declare
cursor c1 is
select index_owner, 
       table_name, 
       index_name, 
       count(1) qde
  from dba_ind_columns
 where index_owner = SEUOWNER
 group by index_owner, table_name, index_name;

begin
  for vCont in c1 loop
    if vCont.qde = 1 then
      execute immediate('alter index ' || vCont.index_owner || '.' || vCont.index_name || ' rebuild  compute statistics nologging ');
    else
      execute immediate('alter index ' || vCont.index_owner || '.' || vCont.index_name || ' rebuild  compress compute statistics nologging ');
    end if;
    
    execute immediate('alter index ' || vCont.index_owner || '.' || vCont.index_name || ' logging');
    
  end loop;   
end;

Source:
 
Users who have marked this routine as a favorite
 
 
 
The site ti4fun is not responsible for the content on sites for which you have external links

Articles, routines, tips, forums, blogs or any other content posted on ti4fun site is not tested and not validated, so you should test and validate any information collected on the ti4fun site before applying it to final use environment, such as example, production. the TI4FUN site is not responsible for quality or for any damages, direct, indirect or consequential, from use of any content posted by the authors in the site.

All content published on the ti4fun site is the responsibility of the author and do not necessarily express the views of the site ti4fun and its employees.