select count(*), substr(name,1,7) lkname, trunc(expiration) from dbms_lock_allocated where name like 'FNDCPLK%' and lockid NOT IN (SELECT id1 FROM V$LOCK) group by substr(name,1,7),trunc(expiration) order by 3 /