Get IP Address for Db2 clients

26. April 2007 09:14 by Mrojas in General  //  Tags: ,   //   Comments (0)




Source IP for connected applications in DB2

Usually when there are performance problems you need to track who is connected to the database. Especially in development environments because production environments are more restricted with who has access to the DB.

You can easily list the applications connected to your DB2 database using the control center application or from the command line.

From the control center:

  1. First check that the Objects Detail Pane is active

  1. In the Objects Details Pane, click the application list link

  1. This will open a window like this:

From the command window just do something like:

DB2 LIST APPLICATIONS

Now to get the real juicy and useful information execute from the command line:

DB2 GET SNAPSHOT FOR APPLICATION AGENTID ###

And use the number that is under the Appl. Handle column, this will show the ip address and other info.

57016 or the Unavailable table

17. January 2007 06:57 by Mrojas in General  //  Tags: ,   //   Comments (0)
The idea was to create a harry potter like title jeje.
Today I had a new issue with DB2 (everyday you learn something new).
I got to work and we had some tables that you could not query or do anything. The system reported something like:
SQL0668N  Operation not allowed for reason code "1" on table "MYSCHEMA.MYTABLE".
SQLSTATE=57016
So I started looking what is an 57016 code????

After some googling I found that the table was in an "unavailable state". OK!!
But how did it got there? Well that I still I'm not certain. And the most important. How do I get it out of that state?????
Well I found that the magic spell is somehting like
>db2 set integrity for myschema.mytable immediate checked

After that statement everything works like a charm.
DB2 Docs state that:
"Consider the statement:

SET INTEGRITY FOR T IMMEDIATE CHECKED
Situations in which the system will require a full refresh, or will check the whole table
for integrity (the INCREMENTAL option cannot be specified) are:
  • When new constraints have been added to T itself
  • When a LOAD REPLACE operation against T, it parents, or its underlying tables has taken place
  • When the NOT LOGGED INITIALLY WITH EMPTY TABLE option has been activated after the last integrity check on T, its parents, or its underlying tables
  • The cascading effect of full processing, when any parent of T (or underlying table, if T is a materialized query table or a staging table) has been checked for integrity non-incrementally
  • If the table was in check pending state before migration, full processing is required the first time the table is checked for integrity after migration
  • If the table space containing the table or its parent (or underlying table of a materialized query table or a staging table) has been rolled forward to a point in time, and the table and its parent (or underlying table if the table is a materialized query table or a staging table) reside in different table spaces
  • When T is a materialized query table, and a LOAD REPLACE or LOAD INSERT operation directly into T has taken place after the last refresh"
But I really dont know what happened with my table.
Hope this help you out.

Categories