IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ISOLATION UR


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sairamjaya

New User


Joined: 21 Feb 2006
Posts: 4

PostPosted: Tue Feb 21, 2006 8:57 pm
Reply with quote

Hello!!

Can we use the isolation UR along with Select count(*) from table. ?
Here the table is a production table. We have to be very cautious while using Isolation UR right?. What would happen if we use in the above select. Is it necessary?

Please advice me a brief reply and please share your experience.

Thank you very much.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Feb 21, 2006 11:01 pm
Reply with quote

Sairamjaya

Yes, of course. This is probably a very good use of it. There is a small likelihood that you will get an incorrect count using the ?WITH UR?. See the post below on what the UR means and how it handles locks.

Previous Post WITH UR

If this does not answer you question, please come back,

Dave
Back to top
View user's profile Send private message
Sairamjaya

New User


Joined: 21 Feb 2006
Posts: 4

PostPosted: Wed Feb 22, 2006 1:25 am
Reply with quote

Do you mean we can use the isolation UR with Select Count(*) from table
is good?

Please explain me.
Thanks.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Feb 22, 2006 1:46 am
Reply with quote

Sairamjaya,

The WITH UR ignores the locks placed on any rows that have been updated, but not yet committed. This allows your SELECT to run even if another program is updating the table. If you do not specify the WITH UR, you program will stop when it encounters a row lock, until the lock has been released. Depending on how many locks are placed, the duration of the locks, you could be looking at a timeout for your program/SQL.

The drawback to using WITH UR is that you are counting rows that have been updated and not yet committed. There is a possibility that a row you counted could be rolled back and if the columns that were updated would affect your count, then your count will be off. It's a trade-off.

Using WITH UR isn't going to impact the production table other than the resource it's taking up doing the select.

I don't think twice about doing selects from production tables. I usually test the SQL on one of the TEST tables to make sure it's efficient and then run it on the production tables. Now, I do run in an initiator that gives production programs a higher priority.

Dave,
Back to top
View user's profile Send private message
Sairamjaya

New User


Joined: 21 Feb 2006
Posts: 4

PostPosted: Wed Feb 22, 2006 2:08 am
Reply with quote

Thank you very much for your explanation Davidatk. It is really helpful.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Current Isolation level DB2 2
No new posts Problem related to isolation level. DB2 1
No new posts Lock termination with RR isolation Level DB2 1
No new posts Confusion over Isolation level in a plan DB2 2
No new posts can Isolation UR allows the applicati... DB2 11
Search our Forums:

Back to Top