How can we simulate a deadlock, rowlock, tablelock?
What are the tables it will involve?
How do we debug and take care of the issue??
table lock: lock table <table_name > exclusive;
row lock: select <column_name(s)> for update ....;
deadlock : Have to be very bad developer.
Open 2 SQLPLUS sessions.
Table Lock :
Lock one in one session, and try to update the same table in another session.
Lock Table_A in one session
Lock Table_B in 2nd session.
Update Table_B in first session
Update Table_A is 2nd session.
Now look into alert.log file for the dead lock deduction.
Click Here to Expand Forum to Full Width