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 

isolation levels

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


Joined: 03 Feb 2005
Posts: 10
Topics: 2
Location: MUMBAI

PostPosted: Thu Feb 10, 2005 11:59 pm    Post subject: isolation levels Reply with quote

Hi Can anyone help to know what is isolation level which is commonly used in DB2 BLIND PROCESS Repeatable read or Cusorstability.Plz explain why so?

Thanks and Regards
sathish
Back to top
View user's profile Send private message AIM Address
hari_uss
Beginner


Joined: 19 Dec 2002
Posts: 78
Topics: 6
Location: Trivandrum, India

PostPosted: Fri Feb 11, 2005 6:03 am    Post subject: Reply with quote

I would say that depends on what your application needs (even though most of the times we have it as CS in our installation). We use RR or UR very rarely.

Btw, your user id looks very odd....Smile
Back to top
View user's profile Send private message Send e-mail
hari_uss
Beginner


Joined: 19 Dec 2002
Posts: 78
Topics: 6
Location: Trivandrum, India

PostPosted: Fri Feb 11, 2005 6:08 am    Post subject: Reply with quote

Oh..I didn't notice this portion

"Plz explain why so?"

Have a look...

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DSNAPH11/4.2.5.1.4?SHELF=&DT=20010710165542&CASE=
Back to top
View user's profile Send private message Send e-mail
sathishgay
Beginner


Joined: 03 Feb 2005
Posts: 10
Topics: 2
Location: MUMBAI

PostPosted: Fri Feb 11, 2005 6:46 am    Post subject: Reply with quote

THANKS FOR INFORMATION.

THANKS AND REGARDS
SATHISH
_________________
OK
Back to top
View user's profile Send private message AIM Address
Catherine
Beginner


Joined: 30 Aug 2006
Posts: 32
Topics: 15
Location: Chennai

PostPosted: Mon Mar 19, 2007 1:02 am    Post subject: Isolation levels Reply with quote

Hi all,

Can you help me demarcate between Isolation level and a lock?
Are Isolation levels Row locks?


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


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

PostPosted: Mon Mar 19, 2007 5:15 am    Post subject: Reply with quote

Catherine,

Did you look up the manual which hari_uss listed in this topic? 3rd post from the top?

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Catherine
Beginner


Joined: 30 Aug 2006
Posts: 32
Topics: 15
Location: Chennai

PostPosted: Mon Mar 19, 2007 7:00 am    Post subject: Isolation levels Reply with quote

Kolusu,

If i aquire a Page lock or a row lock, My table as well as the table space gets locked. I doubt is like Why should i lock the entire table space when i access only a row or a page. Is that necessary?

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


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

PostPosted: Mon Mar 19, 2007 8:04 am    Post subject: Reply with quote

Quote:

If i aquire a Page lock or a row lock, My table as well as the table space gets locked.

Catherine,

Not Really. It depends on the LOCKSIZE parameter when creating the tablespace. It Specifies the size of locks used within the table space and, in some cases, also the threshold at which lock escalation occurs.

Code:

Locksize - ANY                                                                     
    Specifies that DB2 can use any lock size. Currently, DB2 never       
    chooses row locks, but reserves the right to do so.                 
                                                                     
    In most cases, DB2 uses LOCKSIZE PAGE LOCKMAX SYSTEM for non-LOB    
    table spaces and LOCKSIZE LOB LOCKMAX SYSTEM for LOB table spaces.
    However, when the number of locks acquired for the table space       
    exceeds the maximum number of locks allowed for a table space (an
    installation parameter), the page or LOB locks are released and     
    locking is set at the next higher level. If the table space is       
    segmented, the next higher level is the table. If the table space
    is nonsegmented, the next higher level is the table space.           
                                                                     
TABLESPACE                                                               
    Specifies table space locks.                                         
                                                                     
TABLE                                                                   
    Specifies table locks. Use TABLE only for a segmented table space.
                                                                     
PAGE                                                                     
    Specifies page locks. Do not use PAGE for a LOB table space.         
                                                                     
ROW                                                                     
    Specifies row locks. Do not use ROW for a LOB table space.           
                                                                     
LOB                                                                     
    Specifies LOB locks. Use LOB only for a LOB table space.             


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Catherine
Beginner


Joined: 30 Aug 2006
Posts: 32
Topics: 15
Location: Chennai

PostPosted: Wed Mar 21, 2007 4:50 am    Post subject: Reply with quote

Kolusu,


Can you plz refer this link and explain me?

http://www.dbazine.com/db2/db2-mfarticles/mullins4

In the above article under table locks and tablespace locks i find that
even if i give LOCKSIZE = PAGE/ROW my table or table space gets locked

Thanks,
Catherine[/url][/list][/list]
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Mar 21, 2007 7:11 am    Post subject: Reply with quote

Catherine,

I cannot get to the site as it is under construction

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Thu Mar 22, 2007 8:05 am    Post subject: Reply with quote

Yes, you get tablespace locks, even if you specify LOCKSIZE=PAGE, but the flavour of the lock is different:
In this case the Page gets an S-Lock, but the Tablespace an IS-Lock (i.e. Intend Share). This construction shall simplify the search of another user of a tablespace by the system. IS tablespace locks are compatibel to X locks on pages of this tablespace by another user, but they are NOT compatibel to X locks on the tablespace level by other users.

To get this picture with all aspects, you should read an old DB2 redbook where locking is explained in detail. It is a pain to read all this detail stuff, but questions like yours are answered.

redards
Christian
Back to top
View user's profile Send private message
Catherine
Beginner


Joined: 30 Aug 2006
Posts: 32
Topics: 15
Location: Chennai

PostPosted: Fri Mar 23, 2007 3:17 am    Post subject: Isolation levels Reply with quote

Christian,

Suppose i have defined LOCKSIZE=PAGE, I query the table with a SELECT statement.

When I try to retrieve a row
1) The page containing the Row is put in "Share" Lock mode
2) The table space is put in "Intent share" mode. This means all the pages excluding the page mentioned in point 1 is put in "Intent Share" mode
Im i right?
Back to top
View user's profile Send private message
CZerfas
Intermediate


Joined: 31 Jan 2003
Posts: 211
Topics: 8

PostPosted: Fri Mar 23, 2007 5:11 am    Post subject: Reply with quote

Hello Catherine,

no, the tablespace locks are associated with the tablespace itself. I see it as an hirarchy:
First the system looks, whether it can access the tablespace, and then, if it can access the page.

Since every lock consumes core memory of one the DB2 address spaces, the number of locks shure shouldn't be that large.

regards
Christian
Back to top
View user's profile Send private message
vini_srcna
Beginner


Joined: 17 Jul 2005
Posts: 9
Topics: 0

PostPosted: Fri Mar 23, 2007 6:04 am    Post subject: Reply with quote

and if no of locks exceeds the limit specified in the Tablespace definition, then an escalation happens and this is called as LOCK escalation.

say you have defined a tablespace with LOCKSIZE ROW & LOCMAX 7000.
when the no of locks exceed 7000 on the table space and escalation happens to a table level lock from row level lock. As Christian told, each and every lock requires a specifiec amount of memory irrespective of the LOCKSIZE.

This would be time where you get the timeouts.

Isolation level says how long to hold the lock.
Type of lock says what to hold..(ROW,TABLE,TABLESPACE...)

Dbazine has a very good info on this.
Say you have a Partitioned table and all the programs access it. Also say you have some peculiar program running in a window during which no one is supposed to access the data meanwhile. But the Tablesize is defined with LOCKSIZE ANY (ROW).
In that case you can use the LOCK statement to get the lock explicitly.
In the program at the begining you can say
LOCK TABLE tablename IN x MODE; (X= SHARE or EXCLUSIVE)
SHARE allows others to just read(UR) while you do something.
EXCLUSIVE drains the table from other users.
Locking is a huge concept again.
_________________
Thanks,
Vinay Kumar,
IBM Certified DB2 UDB Database Administrator for Z/OS.
IBM Certified Application Developer for DB2 V8 Family.
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