How to check if a package is locked in oracle?

Hi Guys,

I have jobs that executes same set of procedures of a package.The jobs normally scheduled to run at the same time,so when the jobs are running the same procedures,the jobs are throwing deadlock errors.can you tell me how can I find if there is a lock on the procedure in oracle database using a query.Please help me ! This is urgent…!

Thanks…


niranjan479 :india: (BOB member since 2014-01-08)

V$LOCKED_OBJECT gives all the locked objects.See if you can use it.


magesh (BOB member since 2010-01-05)

Thanks for replying.

I already tried that but it didn’t work since the V$locked_object view just locking the table only but not the procedure/package.I need to check the lock on the package/proc.


niranjan479 :india: (BOB member since 2014-01-08)

I don’t think there are locks on stored procedures in Oracle. Any session can invoke a stored procedure. It is the responsibility of the developer to code within the stored procedure any special requirements to avoid locks or deadlocks.


eganjp :us: (BOB member since 2007-09-12)