If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > MS SQL command for DB2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-31-09, 09:33
Geelwortel Geelwortel is offline
Registered User
 
Join Date: Aug 2009
Posts: 3
MS SQL command for DB2

Hi All

This command is used in MS SQL/MySQL
ALTER DATABASE <Database Name> SET READ_COMMITTED_SNAPSHOT ON WITH ROLLBACK IMMEDIATE GO

What is the equivelant for DB2?
Reply With Quote
  #2 (permalink)  
Old 08-31-09, 09:58
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Maybe you should enlighten us as to what it is doing. Also supply your DB2 version and OS.

Andy
Reply With Quote
  #3 (permalink)  
Old 08-31-09, 13:05
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Also explain what exactly a "database" is in terms of MS SQL Server or MySQL (whichever you are really referring to). That term is by no means clearly defined and different database systems denote different things with it.
__________________
Knut Stolze
IBM DB2 Analytics Accelerator
IBM Germany Research & Development
Reply With Quote
  #4 (permalink)  
Old 09-01-09, 01:17
Geelwortel Geelwortel is offline
Registered User
 
Join Date: Aug 2009
Posts: 3
I'm refering to Ms SQL and MySQL because the same command is used in both.
The command is the same as what you would run "NOLOCK" on each table but in this case it runs on the whole database.
I'm running DB2 V9.1 FP4 on AIX 5.3
Reply With Quote
  #5 (permalink)  
Old 09-01-09, 03:18
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
Apparently this is like accessing the database via Uncommitted Read isolation level, where no locks are taken. There is no way that I know of to do this at the database or table level in DB2. One can set the default isolation level to UR for the client, or for statically bound packages, or in an individual SQL by specifying "WITH UR" at the end of the statement (this last method is usually the most popular).

There are also some environment variables to improve concurrency that can be turned on with the db2set command at the instance level (not at database level):

db2set DB2_SKIPINSERTED=ON
db2set DB2_SKIPDELETED=ON
db2set DB2_EVALUNCOMMITTED=ON

In version 9.7 there is a new parameter that is the default for newly created databases call cur_commit which will allow DB2 to select the previous state of a any locked data from the transaction log instead of waiting for a lock to be released.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
  #6 (permalink)  
Old 09-01-09, 03:24
Geelwortel Geelwortel is offline
Registered User
 
Join Date: Aug 2009
Posts: 3
issolation level

Thank you MarcusA, this is what I'm looking for. I want to set the default issolation level to UR where every connection that is made will automatically use this level. What command do I use for this?
Reply With Quote
  #7 (permalink)  
Old 09-01-09, 10:14
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
I told you in my response that there is no command like that at the database level. You can set that at the client level. The command for changing the client depends on what client you have.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On