Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We have a print queue process that acquires a user lock via dbms_lock.allocate_unique. It performs the work and then releases the lock. The process works very well.

Today, we have a process that allocated a lock, as seen in this output from dbms_lock_allocated:

NAME            LOCKID      EXPIRATION
printer_lock    1073741825  11/30/2013 9:35:46 AM

Whatever session has this hasn't released the lock. Is there any way we can find the session that allocated this lock, so we can end their session and release the lock?

EDIT:

Querying DBA_LOCKS does not show any sessions with the lock type of 'PL/SQL User Lock'.

Thanks!

share|improve this question
add comment

1 Answer

You can get this info from DBA_LOCKS.

select *
from DBA_LOCKS
where LOCK_TYPE = 'PL/SQL User Lock';

DBA_LOCKS has the SESSION_ID and the lock id.

share|improve this answer
    
Thanks, Phil. I've seen that suggestion before, but it does not show any locks of that type. –  DCookie Nov 20 '13 at 17:55
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.