Wednesday, March 28, 2012

Lock Type

Hello there,

Example

I pass this statement to the database:

SELECT FunctionName,FunctionDescription FROM Functions WHERE FunctionID = 21

Nothing special here.

Now i check in the Enterprise Manager in the Managment->Current Activity->Locks/Process ID Map and see this for my process

Object: LISPROD
Lock Type: DB
Mode: S
Status: Grant
Owner Sess
Index:
Resource:

My question now, is the LockType. Isn't this a bit too much. A full database lock while the query is only on one table.
All locks in the database seem to have this behaviour.

Cheers Erik.The lock type u see in
Enterprise Manager in the
Managment->Current Activity->Locks/Process ID

is DB...means database level locking.

Its not bacause u have fired a query, but Quey analyzer locks it as soon as u select a database form the drop down combo...

When we generally fire a query DB lavel locking is not used but Table level locking is used.

u can change it to page lavel or row level locking if required...but that approach has its own implications.

Naveen Mehta.

No comments:

Post a Comment