MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Entire table locked for Tablespace scan ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Fri Sep 05, 2014 1:40 am    Post subject: Entire table locked for Tablespace scan ? Reply with quote

Hi experts,

My application has a segmented table space and it has only one table in it.
LOCKSIZE is ANY. The program that is accessing this table is bound with isolation level CS and it executes a below query

Select max(col1) from xxx.yyy;

There is no index defined on column "col1".By looking into the PLAN_TABLE, i have confirmed that it is doing tablespace scan. My doubt is that, will DB2 acquire "S" lock on the table, (or), will it acquire "S" lock on page while inspecting the row in it and releases it when it examines the next page ?

I have searched the web before posting this query.

Thanks,
Ravikumar
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Sep 05, 2014 11:11 am    Post subject: Re: Entire table locked for Tablespace scan ? Reply with quote

ravikumar_sri2001 wrote:
My doubt is that, will DB2 acquire "S" lock on the table, (or), will it acquire "S" lock on page while inspecting the row in it and releases it when it examines the next page ?

I have searched the web before posting this query.

Thanks,
Ravikumar


In your case DB2 will acquire an "S" lock on the table. The pages and rows locks are not acquired.

I suggest you read the share presentation The Keys to Understanding Locking for DB2 for zOS
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ravikumar_sri2001
Beginner


Joined: 06 Dec 2002
Posts: 117
Topics: 44
Location: Chennai,India

PostPosted: Sat Sep 06, 2014 2:36 am    Post subject: Reply with quote

Kolusu,

Thank you so much for your help!

Once DB2 completes the above query, it will release "S" lock on the table immediately and it wont hold the lock until COMMIT right ???

Before initiating this thread I have gone thru link that you shared.

Thanks,
Ravikumar
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group