I want to reorganize or rebuild indexes. I know the sql to perform this action on all indexes in a table is
alter index all on table_name reorganize;
But I only want to rebuild or reorganize if fragmentation percentage on each index is between a certain range. Is this possible to do?
Here is a procedure what I wrote