Types of locks in database ?

Answers were Sorted based on User's Feedback



Types of locks in database ?..

Answer / mohan

Exclusive locks, Share locks

Is This Answer Correct ?    125 Yes 20 No

Types of locks in database ?..

Answer / lakshminarayana reddy

2 types
1. Implicit locks: oracle automatically locks the rows
whenever user performs DML operations.
2. Explicit locks: provided by user.
2 tpyes a) Row level locks: used to lock selected rows
of table.It is imposed by "for update" clause in select.
b) Table level locks: used to lock compleate
table. 3 models 1) share mode
2) share update
3) exlcusive mode

Is This Answer Correct ?    92 Yes 26 No

Types of locks in database ?..

Answer / shaheed ul haq sadi

1) Shared
A shared lock reserves its object for reading only. It
prevents the object from changing while the lock remains.
More than one program can place a shared lock on the same
object. More than one object can read the record while it is
locked in shared mode.

2) Exclusive
An exclusive lock reserves its object for the use of a
single program. This lock is used when the program intends
to change the object.

You cannot place an exclusive lock where any other kind
of lock exists. After you place an exclusive lock, you
cannot place another lock on the same object.

3) Promotable/Update

A promotable (or update) lock establishes the intent to
update. You can only place it where no other promotable or
exclusive lock exists. You can place promotable locks on
records that already have shared locks. When the program is
about to change the locked object, you can promote the
promotable lock to an exclusive lock, but only if no other
locks, including shared locks, are on the record at the time
the lock would change from promotable to exclusive. If a
shared lock was on the record when the promotable lock was
set, you must drop the shared lock before the promotable
lock can be promoted to an exclusive lock.

Is This Answer Correct ?    47 Yes 9 No

Types of locks in database ?..

Answer / mahesh reddy g

lockmodes:
EXCLUSIVE
SHARE
ROW EXCLUSIVE
SHARE ROW EXCLUSIVE
ROW SHARE* | SHARE UPDATE*If NOWAIT is omitted Oracle
will wait until the table is available.

Several tables can be locked with a single command -
separate with commas

e.g. LOCK TABLE table1,table2,table3 IN ROW EXCLUSIVE MODE;

Default Locking Behaviour

A pure SELECT will not lock any rows.

INSERT, UPDATE or DELETE's - will place a ROW EXCLUSIVE
lock.

SELECT...FROM...FOR UPDATE NOWAIT - will place a ROW
EXCLUSIVE lock.

Multiple Locks on the same rows with LOCK TABLE

Even when a row is locked you can always perform a SELECT
(because SELECT does not lock any rows) in addition to
this, each type of lock will allow additional locks to be
granted as follows.

ROW SHARE = Allow ROW EXCLUSIVE or ROW SHARE or SHARE locks
to be granted to the locked rows.

ROW EXCLUSIVE = Allow ROW EXCLUSIVE or ROW SHARE locks to
be granted to the locked rows.

SHARE ROW EXCLUSIVE = Allow ROW SHARE locks to be granted
to the locked rows.

SHARE = Allow ROW SHARE or SHARE locks to be granted to the
locked rows.

EXCLUSIVE = Allow SELECT queries only

Although it is valid to place more than one lock on a row,
UPDATES and DELETE's may still cause a wait if a
conflicting row lock is held by another transaction.

* = Oracle 6 option included for compatibility

Is This Answer Correct ?    30 Yes 14 No

Types of locks in database ?..

Answer / narasimha rao

ddl locks
dml locks
oracle internal locks
oracle distributed locks
oracle parallell cache management locks

Is This Answer Correct ?    10 Yes 3 No

Types of locks in database ?..

Answer / naveen reddy mavuluri

shared locks, exclusive locks , intent locks like intent
shared, intent exclusive,
schema locks like schema modification,stability,
bulk update locks.

Is This Answer Correct ?    15 Yes 9 No

Types of locks in database ?..

Answer / jerry

Shared
Exclusive
Limited
Concurrent

Is This Answer Correct ?    4 Yes 3 No

Types of locks in database ?..

Answer / mani

5 types of locks in database
intent
shared
schema
update
bulk update

Is This Answer Correct ?    12 Yes 12 No

Post New Answer

More SQL PLSQL Interview Questions

Is sql difficult?

0 Answers  


Write a procedure to return the month and the number of developers joined in each month (cursor )

2 Answers   Tech Mahindra,


what are the types of join and explain each? : Sql dba

0 Answers  


Is natural join same as inner join?

0 Answers  


Explain dml and ddl?

0 Answers  






How do I order by ascending in sql?

0 Answers  


How do I trace sql profiler?

0 Answers  


wa procedure to return the month and the no'f developers joined in each month.

4 Answers   Fidelity,


What is partition in sql query?

0 Answers  


What is java sql package?

0 Answers  


what is the output of this query selet * from employee where 1=2 ??

11 Answers  


What does subquery mean in sql?

0 Answers  


Categories