Is there a difference between pg and table lock in Oracle
Does
select * from emp for update;
results in Table lock?
And
select * from emp where deptno=10 for update;
result in page lock?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There is no such thing as a page lock in Oracle. Oracle has row-level locks and table-level locks.
Both of these statements create row-level locks on all the rows that the query returns. The first creates a row-level lock on every row that was in the
EMPtable as of the SCN where the query was executed. The second creates a row-level lock on every row that was in theEMPtable with aDEPTNOof 10 as of the SCN where the query was executed. Both queries will also create a shared lock on the table that prevents other sessions from doing DDL on the table but that is rarely what people are talking about when they are talking about table locks.