View previous topic :: View next topic |
Author |
Message |
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Wed Dec 23, 2015 12:41 pm Post subject: Cancel multiple threads |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Dec 23, 2015 1:08 pm Post subject: |
|
|
NASCAR9,
Did you try
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 |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Wed Dec 23, 2015 4:48 pm Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Dec 23, 2015 5:16 pm Post subject: |
|
|
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 |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Wed Dec 23, 2015 5:27 pm Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Dec 23, 2015 5:38 pm Post subject: |
|
|
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 |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Wed Dec 23, 2015 5:43 pm Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Thu Dec 24, 2015 11:18 am Post subject: |
|
|
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 |
|
|
NASCAR9 Intermediate
Joined: 08 Oct 2004 Posts: 274 Topics: 52 Location: California
|
Posted: Fri Feb 19, 2016 1:48 pm Post subject: |
|
|
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 |
|
|
|
|