Skip to content

Instantly share code, notes, and snippets.

@elcascarudo-dev
Created May 21, 2020 11:21
Show Gist options
  • Save elcascarudo-dev/c0cce9d32e0adbf387e7e59542693625 to your computer and use it in GitHub Desktop.
Save elcascarudo-dev/c0cce9d32e0adbf387e7e59542693625 to your computer and use it in GitHub Desktop.
ORA-01502 - PL SQL Para obtener todos los índices en estados UNUSABLE
declare
begin
for x in ( select owner, index_name from all_indexes where owner like '%{usuario o esquema}%' and status = 'UNUSABLE' )
loop
DBMS_OUTPUT.PUT_LINE('alter index ' || x.owner || '.' || x.index_name || ' rebuild;');
end loop;
end;
/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment