Also, I think running a sql file something similar to the following will get you back in (this, of course, is Oracle):
declare
v_group_id acs_objects.object_id%TYPE;
v_object_id acs_objects.object_id%TYPE;
begin
select min(group_id) into v_group_id from groups where group_name='The Public';
select min(object_id) into v_object_id from acs_objects where object_type='apm_service';
acs_permission.grant_permission(object_id => v_object_id, grantee_id => v_group_id, privilege => 'read');
end;
/
show errors;