How to stop a background task that is waiting for user input?

Hi, I scheduled a task that runs a script, and when I imported the script I forgot to remove the "pause" command.  How do I stop the task?  I've tried db2stop, as well as force applications all, but it's still running...  Help!  Thanks.
pw05Asked:
Who is Participating?
 
ghp7000Connect With a Mentor Commented:
try db2_kill, this will kill the instance, then you can do db2start
0
 
pw05Author Commented:
db2_kill:
Abruptly stops all processes being run on multiple database partition servers and cleans up all resources on all database partition servers. This command renders your databases inconsistent. Do not issue this command except under direction from IBM service.

How would I make the databases consistent again after running db2_kill?
0
 
ghp7000Commented:
run db2start
0
 
ghp7000Commented:
For your future reference:
Checking and working with return code on DB2 Wshell scripts

One way to do return code checking on shell scripts is saving a checkpoint on each step done. You can also stop script execution when and error happens by including the option -s on db2 command call. Here is an example of creating and dropping a db2 table:

Example 9-1 Forwarding return code from sample.db2 script to runtask.bat

-- script SAMPLE.DB2 --

!ECHO 'CONNECTING' > SAMPLE.FLG@

CONNECT TO SAMPLE_B@

!ECHO 'CREATING' > SAMPLE.FLG@

CREATE TABLE SAMPLE (COL_1 VARCHAR(20))@

!ECHO 'DROPPING' > SAMPLE.FLG@

DROP TABLE SAMPLE@

!ECHO 'DISCONNECTING' > SAMPLE.FLG@

DISCONNECT SAMPLE_B@

!ECHO 'OK' > SAMPLE.FLG@

-- end script SAMPLE.DB2 --

-- script RUNTASK.BAT --

db2 -td@ -s -f SAMPLE.DB2 -z SAMPLE.LOG

FIND "OK" SAMPLE.FLG2 > NIL

IF %ERRORLEVEL% != 0 GOTO ERRHAND

ECHO SCRIPT OK

GOTO END

:ERRHAND

ECHO SCRIPT FAIL

:END

-- script RUNTASK.BAT --

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.