Post the trigger code.
Are you using a "pragma autonomous_transaction" ?
Main Topics
Browse All Topicswhen i try to create a trigger on voucher_header i am receiving the following error.
timeout occurred while waiting to lock object voucher_header
how i come to know which session has locked the above table and what is its remidy.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
GURU -->
I am using the following trigger
create or replace trigger vch_det before update or delete or insert on voucher_detail for each row
declare
---
begin
if inserting then
----
end if
end;
When i restart my database i am able to run above script, but there is one constraint that i am working online therefore i cannot restart database every times. i want to know which user has locked the table other than me. also when i kill all the users belong to finance user using entreprise console, i am able to recompile OR create the trigger.
adrian_ang:,,,,sujith80:,,
after running the following query i have killed all the sesions dispalyed by this query.
SELECT * FROM v$session WHERE sid IN (SELECT sid FROM v$access WHERE TYPE='TABLE' AND OBJECT='VOUCHER_DETAIL')
but still i m facing the same problem of timeout occur while trying to lock the object
Yes that will continue to happen.
Because, ideally you are not supposed to have active transactions on the table on which you are creating the trigger. That is the reason why it tries to acquire a lock. You cannot get rid of that.
Now, you have active sessions on the object. Only thing you can do is, perform the trigger creations during a downtime. On weekends or something.
Ok, But when i came next day i again run create trigger, which works fine. One thing more, before closing the department i had killed all the active session which was using that tables.. I am not sure whether i am right or not, i thing oracle had not unlocked the resources after kill the session till i again fire create trigger.
On that day i was repeadly killing some of the uses session and re-creating the trigger, i didn't find any problem.
Today i am facing new problem, I want to alter system_parameter table, same error message is reflected back. By using the query from v$session and v$access, no record found. Also I am using SQL PLUS on Application Server. Pls help what is the cauise
Business Accounts
Answer for Membership
by: igor_alphaPosted on 2007-02-08 at 23:41:01ID: 18499759
Hi virdi_ds,
requested,
Probably, you locked table by yourself when testing trigger.
Try following to find locking session:
select * from dba_dml_locks where ...;
select * from dba_ddl_locks where ...;
ddl locked sessions:
Select distinct
b.username, b.osuser, b.machine,
b.terminal,mode_held,mode_
b.logon_time,
-- SESSION WAIT
sw.*
From dba_ddl_locks a,
v$session b,
v$session_wait sw
Where
a.session_id=b.sid and status='ACTIVE'
and sw.sid=b.sid