sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
RG's Avatar

Isolation Level on DB2 UDB 9.1.1


Question posted by: RG (Guest) on January 13th, 2008 05:15 PM
How can I lookup the current isolation level?

Thanks in advance
3 Answers Posted
Dave Hughes's Avatar
Guest - n/a Posts
#2: Re: Isolation Level on DB2 UDB 9.1.1

RG wrote:
Quote:
Originally Posted by
How can I lookup the current isolation level?
>
Thanks in advance


From SQL, you can query the CURRENT ISOLATION special register. For
example:

$ db2 VALUES CURRENT ISOLATION

1
--


1 record(s) selected.

However, if CURRENT ISOLATION hasn't been explicitly set, this will
simply return a blank string, as shown above (indicating that the
default isolation level for the package should be used). You can also
set the current isolation level in a similar fashion:

$ db2 SET CURRENT ISOLATION UR
DB20000I The SQL command completed successfully.

$ db2 VALUES CURRENT ISOLATION

1
--
UR

1 record(s) selected.

Or specify the isolation level for a query explicitly by appending
something like "WITH UR" to the SQL. See the following link for more on
the CURRENT ISOLATION register:

http://publib.boulder.ibm.com/infoc...com.ibm.db2.udb
..admin.doc/doc/r0010945.htm


Cheers,

Dave.
fraffin@gmail.com's Avatar
fraffin@gmail.com January 14th, 2008 12:05 PM
Guest - n/a Posts
#3: Re: Isolation Level on DB2 UDB 9.1.1

On Jan 13, 12:12 pm, "RG" <nob...@nowhere.comwrote:
Quote:
Originally Posted by
How can I lookup the current isolation level?
>
Thanks in advance


I have a hunch that there's more to this question. I'm just guessing,
but I bet you want to find the current isolation level for active SQL
statements.

The only way I've found to get this is using the db2pd command, and it
only works for dynamic SQL.

db2pd -db <dbname-dynamic will get you there. It's somewhat of a
pain as you have to correlate different sections of the output using
StmtUID. The column you may be after is the one labeled 'Iso'.
Knut Stolze's Avatar
Guest - n/a Posts
#4: Re: Isolation Level on DB2 UDB 9.1.1

Join Bytes! wrote:
Quote:
Originally Posted by
The only way I've found to get this is using the db2pd command, and it
only works for dynamic SQL.


Correct - because static SQL uses the isolation level that was specified
when the package was (re)bound.

--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
 
Not the answer you were looking for? Post your question . . .
197,050 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 197,050 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors