View previous topic :: View next topic |
Author |
Message |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Tue Jul 20, 2010 7:15 am Post subject: try to browse at least one record from all records in batch |
|
|
Hi All,
I have a requirement wherein I would like to just browse at least one record for all DB2 tables in say test region so that I make sure that all tables are fine for browsing so that the users do not have any problems accessing the table due to -904 issues and I would like to run it as a batch job so that i can get to know the table name which is having problem. |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Tue Jul 20, 2010 7:41 am Post subject: |
|
|
Futher more I would like to do for all the tables present in all tablespaces in all the databases for that region say test region. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Jul 20, 2010 8:36 am Post subject: |
|
|
yadav2005,
others may disagree, but IMUO:
-904's are often caused by traffic.
individual selects,
especially read only,
will not provide you with the results you need.
if you want to isolate those tables which are not in ready status - or whatever -
you would be better off querying sysibm tables which will provide you this info.
others can give you the necessary commands that will display table status for all
tables in your db2 system. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Jul 20, 2010 10:17 am Post subject: Re: try to browse at least one record from all records in ba |
|
|
yadav2005 wrote: | Hi All,
I have a requirement wherein I would like to just browse at least one record for all DB2 tables in say test region so that I make sure that all tables are fine for browsing so that the users do not have any problems accessing the table due to -904 issues and I would like to run it as a batch job so that i can get to know the table name which is having problem. |
Yadav2005,
The approach itself is wrong. Just because you are able to browse the data in the table does NOT guarantee that you can insert/update to the table. Run the DISPLAY command in batch mode and check if the status is RW for all the table within the tablespace.
secondly as DBZ mentioned you still cannot avoid -904 abends if 2 programs/jobs access the same table/tablespace.
Here is an example of running DISPLAY command in batch . You can do the same via DB2 primary option menu with option 7.
Code: |
//STEP0100 EXEC PGM=IKJEFT01
//SYSUDUMP DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(XXXX)
-DISPLAY DATABASE(Your DB name) SPACENAM(your tablespace name)
//* |
Kolusu |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Wed Jul 21, 2010 8:02 am Post subject: |
|
|
Kolusu and DBZ,
Thanks for your reply. Does it mean that if a Tablespace has only one table and that is my shop standard which we use, if I get RW state , does it mean that table is fine for browse , insert, update and delete operations and we should not be having any -904 problems. But I have seen situations that even though the TS is in RW mode, when I try to browse the table I have got -904's. Can you please clarify me and is there not any way where we could say yes the table is fine. |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Jul 21, 2010 9:00 am Post subject: |
|
|
yadav2005,
Part of the -904 error message is resource and reason-code.
there are many resources, and hundreds of reason-codes.
resources range from tablespace-table-index-bufferpool-..............
I have had situations where the index was incorrectly built, but everything looked fine,
except the -904 told me the index sucked.
because of bufferpool problems (poor parms set by dba)
and contention problems that end up being -904
(application problems - poorly designed - poorly coded)
instead of -911 or -913.
There is basically nothing you can do to insure that you will not have an sql receive a -904
(except of course over a period of time, remove the obvious problems)
the -display should be a part of normal discipline/procedures after any load/reorg etc..
other than -display, you can only resolve the -904 based on resource and reason code.
I realize that you are attempting to be pro-active,
but using a select to avoid -904's is like
trying to shoot the wolf-pack with one bullet.
you will get eaten alive. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Mon Jul 26, 2010 1:36 am Post subject: |
|
|
Thanks Kolusu and DBZ both of your replies make me clear.
I have a new problem where in I am trying to display the status of tablespaces but I end up in DSNT311I which says Message Limit exceeded and the job ends up in RC 8.How can I increase the limit so that I get the status of all the tablespaces within the database. |
|
Back to top |
|
 |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Jul 26, 2010 2:15 pm Post subject: |
|
|
Possibly break up the run into "pieces" rather than running the entire set at one time? _________________ All the best,
di |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Mon Jul 26, 2010 8:41 pm Post subject: |
|
|
What if I give Code: |
//SYSTSIN DD *
DSN SYSTEM(XXXX)
-DISPLAY DATABASE(Your DB name) SPACENAM(*)
//*
|
I do not know how many tablespaces will be present in the database. |
|
Back to top |
|
 |
yadav2005 Intermediate

Joined: 10 Jan 2005 Posts: 348 Topics: 144
|
Posted: Mon Jul 26, 2010 9:52 pm Post subject: |
|
|
I got it:
Code: |
//SYSTSIN DD *
DSN SYSTEM(XXXX)
-DISPLAY DATABASE(Your DB name) SPACENAM(*) LIMIT(*)
//*
|
|
|
Back to top |
|
 |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Mon Jul 26, 2010 11:01 pm Post subject: |
|
|
Good to hear it is working - thank you for posting your solution
di |
|
Back to top |
|
 |
|
|