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 

Cancel multiple threads

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


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Wed Dec 23, 2015 12:41 pm    Post subject: Cancel multiple threads Reply with quote

Is there a way to cancel all threads attached to a single tablespace?
I know how to do it one by one(see below). I want to terminate ALL if possible.
Code:

-DISPLAY DATABASE(FDBHRS) SPACENAM(FTSFCWLT)
-CANCEL THREAD (43112)

_________________
Thanks,
NASCAR9
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Dec 23, 2015 1:08 pm    Post subject: Reply with quote

NASCAR9,

Did you try
Code:

CANCEL THREAD (*)



This will pretty much cancel out ALL threads out there. So if you want to narrow down to LUWID, first issue DISPLAY THREAD and then find out the LUWID and use that in CANCEL -DDF THREAD(-+-luwid-+-)

Here are the links for DISPLAY and CANCEL threads

DISPLAY Thread

CANCEL THREAD
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Wed Dec 23, 2015 4:48 pm    Post subject: Reply with quote

Thanks for your response kolusu. I'm trying to create a batch job to "clean up" any threads that still lay claim to a tablespace that I'm trying to load more data into. The load job wants exclusive access of the table space. This process runs during evening hours and it's my responsibility(after hours calls). We use mail merge to generate letters to the outside and the below does not always get cleaned up. My goal is to have a single DB2 command to purge any threads attached to a single tablespace. And if none are found, continue on to the next step.
_________________
Thanks,
NASCAR9
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Dec 23, 2015 5:16 pm    Post subject: Reply with quote

NASCAR9,

I guess you can LOCK up the table before you start loading.

Code:

LOCK TABLE your-table-name IN EXCLUSIVE MODE;


and if you get a return code of zero for this step , proceed to load.

And after you are done, RELEASE the lock.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Wed Dec 23, 2015 5:27 pm    Post subject: Reply with quote

Thanks Kolusu,
That will still get me a call for none zero. The programmer in charge of the mail merge process is working on a solution from his end. I don't like leaving any thing to chance. I'll continue to research.
I tried the below and it didn't work until the threads were canceled.

-STOP DATABASE(FDBHRS) SPACENAM(FTSFCWLT)
-START DATABASE(FDBHRS) SPACENAM(FTSFCWLT)
_________________
Thanks,
NASCAR9
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Dec 23, 2015 5:38 pm    Post subject: Reply with quote

NASCAR9 wrote:
Thanks Kolusu,
That will still get me a call for none zero. The programmer in charge of the mail merge process is working on a solution from his end. I don't like leaving any thing to chance. I'll continue to research.
I tried the below and it didn't work until the threads were canceled.

-STOP DATABASE(FDBHRS) SPACENAM(FTSFCWLT)
-START DATABASE(FDBHRS) SPACENAM(FTSFCWLT)


Nascar9,

For a NON-zero Return code, Cancel all Threads using the CANCEL and then re-issue the LOCK. You can let this job restarted 3 times for a non-zero return code and then on the 4th attempt they should give you a call.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Wed Dec 23, 2015 5:43 pm    Post subject: Reply with quote

Maybe I misunderstood.

Won't This "CANCEL THREAD (*)" kill all threads that are running in the database?
We have many DB2 jobs running together.
_________________
Thanks,
NASCAR9
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Dec 24, 2015 11:18 am    Post subject: Reply with quote

NASCAR9 wrote:
Maybe I misunderstood.

Won't This "CANCEL THREAD (*)" kill all threads that are running in the database?
We have many DB2 jobs running together.


Nascar9,

It will, I was thinking that you would use LUWID to narrow down the threads to cancel.

What does the DISPLAY THREAD output look like?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
NASCAR9
Intermediate


Joined: 08 Oct 2004
Posts: 274
Topics: 52
Location: California

PostPosted: Fri Feb 19, 2016 1:48 pm    Post subject: Reply with quote

Kolusu,
Sorry for the late response. The problem has been pretty much fixed on the mail merge side. Below is the output from the batch Display job.
Code:

READY                                                                     
  DSN SYSTEM(DB2P)                                                       
DSN                                                                       
  -DISPLAY DATABASE(FDBHRS) SPACENAM(FTSFCWLT) LOCKS                     
DSNT360I  -DB2P ***********************************                       
DSNT361I  -DB2P *  DISPLAY DATABASE SUMMARY                               
                *    GLOBAL LOCKS                                         
DSNT360I  -DB2P ***********************************                       
DSNT362I  -DB2P     DATABASE = FDBHRS  STATUS = RW                       
                   DBD LENGTH = 230156                                   
DSNT397I  -DB2P                                                           
NAME     TYPE PART  STATUS            CONNID   CORRID       LOCKINFO     
-------- ---- ----- ----------------- -------- ------------ ---------     
FTSFCWLT TS         RW,AREO*          SERVER   WINWORD.EXE- H-IS,S,C     
    -                  AGENT TOKEN 24199                                 
 AC100468.FA49.D02EDD3FBCA8=24199 ACCESSING DATA FOR ::172.16.4.104       
325      TB                           SERVER   WINWORD.EXE- H-IS,T,C     
    -                  AGENT TOKEN 24199                                 
 AC100468.FA49.D02EDD3FBCA8=24199 ACCESSING DATA FOR ::172.16.4.104       
******* DISPLAY OF DATABASE FDBHRS   ENDED      **********************   
DSN9022I  -DB2P DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION             
DSN                                                                       
  END                                                                     
READY                                                                     
END                                                                       

Code:

READY                                                                   
  DSN SYSTEM(DB2P)                                                     
DSN                                                                     
  -DISPLAY DATABASE(FDBHRS) SPACENAM(FTSFCWLT) USE                     
DSNT360I  -DB2P ***********************************                     
DSNT361I  -DB2P *  DISPLAY DATABASE SUMMARY                             
                *    GLOBAL USE                                         
DSNT360I  -DB2P ***********************************                     
DSNT362I  -DB2P     DATABASE = FDBHRS  STATUS = RW                     
                   DBD LENGTH = 230156                                 
DSNT397I  -DB2P                                                         
NAME     TYPE PART  STATUS            CONNID   CORRID       USERID     
-------- ---- ----- ----------------- -------- ------------ --------   
FTSFCWLT TS         RW,AREO*          SERVER   WINWORD.EXE- MARK       
 AC100468.FA49.D02EDD3FBCA8=24199 ACCESSING DATA FOR ::172.16.4.104     
******* DISPLAY OF DATABASE FDBHRS   ENDED      ********************** 
DSN9022I  -DB2P DSNTDDIS 'DISPLAY DATABASE' NORMAL COMPLETION           
DSN                                                                     
  END                                                                   
READY                                                                   
END                                                                     


AGENT TOKEN 24199 is what is used to Cancel the Thread

-CANCEL THREAD (24199)
_________________
Thanks,
NASCAR9
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