begin for p in ( select object_name from user_objects where object_type='PACKAGE' and status ='INVALID' ) loop execute immediate 'alter package ' || p.object_name || ' compile'; end loop; end; /