healthy checking tools/script for DB2 V8.1

Dear all,

any tools/script to quickly find out/confirm if the DB2 is healthy good, is not the bottleneck of the whole operation when someone report that the application has problem(show error message) or slow down by unknown reason?
LVL 1
marrowyungSenior Technical architecture (Data)Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cy_hungCommented:
Some recommendation from IBM.  
http://www.ibm.com/developerworks/data/library/techarticle/dm-0404snow/index.html

Although it's not a packaged tool or script ...
0
marrowyungSenior Technical architecture (Data)Author Commented:
I can only use Toad, what  I can do ?

When i tried some of the script from this link:

select
   db_name,
   SNAPSHOT_TIMESTAMP,
   rows_read,
   rows_selected,
   lock_waits, 
   lock_wait_time,
   lock_wait_time/nullif(lock_waits,0) as avg_wt_time,
   deadlocks,
   lock_escals,
   total_sorts,
   total_sort_time,
   total_sort_time/nullif(total_sorts,0) as avg_sort_time,
   sort_overflows,
   sort_overflows/nullif(total_sorts,0) as pct_ovflow_sorts
   from table (snapshot_database (' ', -1) ) as snapshot_database;

Open in new window


the return result is:

DB2 Database Error: ERROR [38553] [IBM][DB2/SUN] SQL0443N Routine "SYSPROC.SNAPSHOT_DATABASE" (specific name "SNAPSHOT_DATABASE") has returned an error SQLSTATE with diagnostic text "SNAPSHOT_DATABASE".

Open in new window


any if I do this one:

select 
      substr(table_schema,1,8) as Schema,
      substr(table_name,1,30) as Table_Name,
      rows_read,
      rows_written, 
      overflow_accesses
from table (snapshot_table ('sample', -1) ) as snapshot_table;

Open in new window


it gives:

DB2 Database Error: ERROR [38553] [IBM][DB2/SUN] SQL0443N Routine "*OT_TABLE" (specific name "*OT_TABLE") has returned an error SQLSTATE with diagnostic text "SQL1092 Reason code or token: <username> ".

Open in new window


I don't see any OT_Table in the script, can you ?
0
Kent OlsenDBACommented:
Which of the TOAD tools are you using?  Freeware, licensed, DBA suite, etc.
0
Powerful Yet Easy-to-Use Network Monitoring

Identify excessive bandwidth utilization or unexpected application traffic with SolarWinds Bandwidth Analyzer Pack.

marrowyungSenior Technical architecture (Data)Author Commented:
freeware..
0
marrowyungSenior Technical architecture (Data)Author Commented:
the link mention the Health Monitor in V8, how to check if it is on and how to enable it ?
0
Kent OlsenDBACommented:
The SQL0443N error indicates that some system object can't be found or accessed.  A lot of things can cause it.  I've never seen the error that you're getting.

Try this query:

  SELECT * FROM TABLE(SNAPSHOT_APPL('SAMPLE', -1))l

You may have to run the *GET SNAPSHOT* command first.  You might try running a *GET SNAPSHOT* and rerunning your original snapshot query, too.
0
marrowyungSenior Technical architecture (Data)Author Commented:
what is the GET SNAPSHOT you talking about?

yeah , I run in to error when I run this:

SELECT * FROM TABLE(SNAPSHOT_APPL('SAMPLE', -1))

Lookup Error - DB2 Database Error: ERROR [38553] [IBM][DB2/SUN] SQL0443N  Routine "SYSPROC.SNAPSHOT_APPL" (specific name "SNAPSHOT_APPL") has returned an error SQLSTATE with diagnostic text "SQL1611".

Open in new window

0
Kent OlsenDBACommented:
That looks like a known problem to DB2 where the tools fixpack level is different than the database level

  http://www-01.ibm.com/support/docview.wss?uid=swg21239424

Try rebinding as shown in the "Solution" section of the document.
0
marrowyungSenior Technical architecture (Data)Author Commented:
"db2 terminate
db2 connect to <database-name>
db2 bind <path>/db2schema.bnd blocking all grant public sqlerror
continue
db2 terminate "

MUST be unix command again instead of from Toad UI or any UI ?
0
marrowyungSenior Technical architecture (Data)Author Commented:
basically what is it for:

SELECT * FROM TABLE(SNAPSHOT_APPL('SAMPLE', -1))

when I run it again I see:

Lookup Error - DB2 Database Error: ERROR [42601] [IBM][DB2/SUN] SQL0104N  An unexpected token "END-OF-STATEMENT" was found following "_APPL('SAMPLE', -1))".  Expected tokens may include:  "<correlation_name>".
0
Kent OlsenDBACommented:
Hi Marrowyung,

My apologies...  I didn't see the email response notification and never got back to this thread.

You should rebind from within the DB2 command line processor.  If the db2 profile has been executed, all you should have to do is type *db2*, then run the connect and bind statements.


Kent
0
marrowyungSenior Technical architecture (Data)Author Commented:
you are welcome.

"You should rebind from within the DB2 command line processor"

how to rebind ? it seems told me before that rebind is not necessary.
0
Kent OlsenDBACommented:
Let's see what the system settings are.  Run the db2 command line processor from a shell command prompt.

db2 get dbm cfg > dbmcfg.txt
db2 connect to {database}
db2 get db cfg > dbcfg.txt

And post the two files.


Kent
0
marrowyungSenior Technical architecture (Data)Author Commented:
yeah, you are right that there are 2 x files.
dbcfg.txt
dbmcfg.txt
0
Kent OlsenDBACommented:
Hi Marrowyung,

Sorry for the delay.  I don't have a version 8 database at my disposal so I have to work from memory and research....  Let's "go to ground" and start at the beginning.



IBM's DB2 Version 8 online documentation is still available.

  http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp

Several pages have things that could help here.  The home page, if you will, for the health monitoring items is here.  It's barely a page and gives a brief overview.

  http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/admin/c0011709.htm

There's a link to the page below.  Using SQL to read the health tables.

  http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/admin/t0011711.htm

Try the two examples on that page.  They should return "something", even if it's an empty set.

On the bottom of that page is a link to the functions that are available to you.

  http://publib.boulder.ibm.com/infocenter/db2luw/v8/topic/com.ibm.db2.udb.doc/admin/r0011712.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
marrowyungSenior Technical architecture (Data)Author Commented:
thanks,

it really return something:


 SELECT * FROM TABLE( HEALTH_DB_INFO( cast (NULL as VARCHAR(1)), -1))
as HEALTH_DB_INFO
 
return
snapshot_timestamp, DB_NAME (which is correct)
DB_Path is:

/space/home/db2inst6/db2inst6/NODE0000/SQL00001/

DB_location : 1
Server_Platform : 7
Rolled_up_Alert_state: 4
Rolled_up_alert_state_detail: Alarm

what is this mean?

this:

 SELECT db_path, server_platform 
 FROM TABLE( HEALTH_DB_INFO( cast (NULL as VARCHAR(1)), -1 ) ) 
 as HEALTH_DB_INFO 

Open in new window


return
DB_Path:

/space/home/db2inst6/db2inst6/NODE0000/SQL00001/

Server_platform: 7


what is this mean?
0
Kent OlsenDBACommented:
The first query returns some rather boring generic data.  The database appears idle (no queries active) so there's nothing more to report.  The items returned look like this:

                                Data type                     Column
Column name                     schema    Data type name      Length     Scale Nulls
------------------------------- --------- ------------------- ---------- ----- ------
SNAPSHOT_TIMESTAMP              SYSIBM    TIMESTAMP                   10     6 Yes
DB_NAME                         SYSIBM    VARCHAR                    128     0 Yes
INPUT_DB_ALIAS                  SYSIBM    VARCHAR                    128     0 Yes
DB_PATH                         SYSIBM    VARCHAR                   1024     0 Yes
DB_LOCATION                     SYSIBM    INTEGER                      4     0 Yes
SERVER_PLATFORM                 SYSIBM    INTEGER                      4     0 Yes
ROLLED_UP_ALERT_STATE           SYSIBM    BIGINT                       8     0 Yes
ROLLED_UP_ALERT_STATE_DETAIL    SYSIBM    VARCHAR                     20     0 Yes

Open in new window


The first 3 items are obvious.
DB_PATH is the folder/directory containing the DB2 database files.
DB_LOCATION is a local/remote flag.  1 means that it's a local database.
SERVER_PLATFORM is the source server type.  7 is a Sun unix environment.

I can't find a meaningful version 8 description of the ROLLED_UP_ALERT_STATE items,  In version 10, the description is:

ROLLED_UP_ALERT_STATE: the most sever alert state captured in this snapshot.
ROLLED_UP_ALERT_STATE_DETAIL: the text description of the ROLLED_UP_ALERT_STATE.

If those columns are blank or null, no alert was found by the snapshot.



The second query just returns two of the columns from the first query.


I found an IBM page a lot more examples that could be helpful.  Since I don't have a version 8 system to test these, I'll let you decide if they're helpful.

  http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/samples/clp/s-healthmon-out.htm

Note that when you bring up the IBM infocenter, there is a 'Monitoring" item in the contents window.  Everything that I've found so far is also in there.


Kent
0
marrowyungSenior Technical architecture (Data)Author Commented:
Sorry busy on something else.

"The first query returns some rather boring generic data.  The database appears idle (no queries active) so there's nothing more to report.

how can you tell ? what it suppose to return (Extra ?).

"DB_PATH is the folder/directory containing the DB2 database files."

so this path is the one which store all DB2 system binary files, but not DB database and instance files ?

"If those columns are blank or null, no alert was found by the snapshot."

What kind of error ? snapshot creation error or DB2 system error ?

and we have this result : Rolled_up_alert_state_detail: Alarm.  This mean we have problem on ..... ?

"The second query just returns two of the columns from the first query."

So the second one don't need actually ?

it seems right now the only userful information I can get from the query is this:

/space/home/db2inst6/db2inst6/NODE0000/SQL00001/

Open in new window

and then we check the space utilization figure based on this path ?

"http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/samples/clp/s-healthmon-out.htm

It seems that the IBM infocenter, I don't see monitoring thing, where is it?

you are talking about this link?

Changed or additional information 
Navigating the DB2 Information Center 
Searching the DB2 Information Center 
Navigating by keyboard 

Open in new window

?
0
marrowyungSenior Technical architecture (Data)Author Commented:
but one thing, it is not healthy information, isn't it ?
0
marrowyungSenior Technical architecture (Data)Author Commented:
good answer anyway even the finally one hasn't been confired yet.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB2

From novice to tech pro — start learning today.