MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

try to browse at least one record from all records in batch

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Tue Jul 20, 2010 7:15 am    Post subject: try to browse at least one record from all records in batch Reply with quote

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
View user's profile Send private message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Tue Jul 20, 2010 7:41 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Jul 20, 2010 8:36 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Jul 20, 2010 10:17 am    Post subject: Re: try to browse at least one record from all records in ba Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Wed Jul 21, 2010 8:02 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Jul 21, 2010 9:00 am    Post subject: Reply with quote

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
View user's profile Send private message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Mon Jul 26, 2010 1:36 am    Post subject: Reply with quote

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
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Jul 26, 2010 2:15 pm    Post subject: Reply with quote

Possibly break up the run into "pieces" rather than running the entire set at one time?
_________________
All the best,

di
Back to top
View user's profile Send private message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Mon Jul 26, 2010 8:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
yadav2005
Intermediate


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Mon Jul 26, 2010 9:52 pm    Post subject: Reply with quote

I got it:
Code:

//SYSTSIN  DD *                     
  DSN SYSTEM(XXXX)                 
-DISPLAY DATABASE(Your DB name) SPACENAM(*) LIMIT(*)
//*
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Mon Jul 26, 2010 11:01 pm    Post subject: Reply with quote

Good to hear it is working - thank you for posting your solution Smile

di
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group