declare cursor c is select table_name from user_tables where compression <> 'ENABLED'; r c%ROWTYPE; begin for r in c loop; execute immediate 'ALTER TABLE ' || r.table_name || ' MOVE COMPRESS'; end loop; end;