Loading ...
Sorry, an error occurred while loading the content.
 

RE: [Control-X] Re: "running" job won't go away

Expand Messages
  • Shancey, Jay
    Oh come on! Live on the wild side! :) You have a good point about forgetting the where clause. That could be a problem and require some explaining. LOL I m
    Message 1 of 19 , Oct 1 6:38 AM

      Oh come on! Live on the wild side! J

       

      You have a good point about forgetting the “where” clause. That could be a problem and require some explaining. LOL

       

      I’m not as concerned about the Conditions, DO actions & Shouts of a job that’s a week old, but the Resources not freeing is a different story.

       

      Thanks for the comments. I’ll take a closer look at the solution.

       


      From: Control-X@yahoogroups.com [mailto:Control-X@yahoogroups.com] On Behalf Of Graeme
      Sent: Thursday, September 30, 2010 11:18 PM
      To: Control-X@yahoogroups.com
      Subject: [Control-X] Re: "running" job won't go away

       

       

      Hi Jay,

      In answer to your question, yes this is dangerous.

      Not only could you accidentally forget the where clause of your SQL delete and therefore delete EVERY Job. (You should always use "rollback" syntax in your SQL deletes, and maybe even take Backups before you do it!)

      But if you do this then no Post Processing is done on the Job – which means Conditions are not posted, (Control and Quantitative) Resources are not Freed, etc.

      You are MUCH better to refer to Solution ID: 88111 - which as of a couple of months ago has a new Perl utility to allow you to do the deletion without the dangerous SQL delete command.

      Happy deleting…
      Cheers, Graeme.

      --- In Control-X@yahoogroups.com, "Shancey, Jay" <shanceyj@...> wrote:

      >
      > Wow! That's a lot of stuff.
      >
      > I usually hold the job, rename it to 'REMOVE', enter the db and run:
      delete from CMR_AJF where JOBNAME='REMOVE' and finish it with a bouncing of the gateway to clear it from the GUI (or wait until newday processing).
      >
      > Question tho... is this or could this cause issues I'm not aware of?
      >
      > ________________________________
      > From: Control-X@yahoogroups.com
      [mailto:Control-X@yahoogroups.com] On Behalf Of david.watson@...
      > Sent: Thursday, September 30, 2010 10:41 AM
      > To: Control-X@yahoogroups.com
      > Subject: Re: [Control-X] "running" job won't go away
      >
      >
      >
      > Step 1: Place Jobs in Question on Hold
      > Right-click on the Job in the CONTROL-M/Enterprise Manager GUI and choose
      the Hold option or perform this Hold step from the CONTROL-M/Server 'ctmpsm' menu.
      > Note: This is a very important step and should not be skipped. Skipping
      this step could cause a failure in a mirrored CONTROL-M/Server environment.
      >
      >
      > Step 2: Determine Order IDs of affected jobs
      > 2A. Right-click the job in question and select the Properties option
      > 2B. Then click on the Active tab and look for the field called ORDERID
      > 2C. Make a note of the order id. This OrderID Number is a base 36 number.
      > 2D. Continue this process until you have all the jobs experiencing the
      problem noted.
      >
      >
      > Step 3: Login to the CONTROL-M/Server
      > For UNIX based Control-M Servers
      > 3A. Telnet to the server and login as the Control-M user
      >
      > Step 4: Convert the Base 36 Order ID to Base 10
      > 4A. At the command prompt, type "p_36 <orderid_number>" where
      the order id_number is the orderid number you wrote down in step 2 above.
      > 4B. Make a note of this order id. This output of this utility is in base
      10.
      > 4C. Continue this process until you have converted all the order ids you
      noted in Step 2 above.
      >
      >
      > Step 5: Login to SQL
      >
      > For Oracle Databases:
      > 5D. At the command prompt, type the command "SQL" and press
      enter.
      > 5E. You should see a "SQL>" prompt after this command. If
      not, try typing: "sqlplus userid/password".
      > 5F. If you are still unable to see the "SQL>" prompt, contact
      your system administrator to determine the state of the Control-M database and/or the user password.
      >
      >
      > Step 6: Verify that the Job you are changing is the correct one.
      > For Sybase and Microsoft SQL Server Databases:
      >
      > For Oracle Databases:
      > 6D. At the SQL> prompt, execute the following, paying attention to
      spacing. Press enter at the end of the lines.
      > 6E. select JOBNAME, MEMNAME from CMR_AJF where ORDERNO = <orderid from
      step 4B above>;
      >
      > For All Databases:
      > 6F. Review the information returned and make sure that the jobname/memname
      correspond to the correct job.
      > 6G. Note that it is not a failure if one of the fields is empty. It simply
      means there is no memname or jobname in the database.
      >
      > NOTE: If your CONTROL-M/Server environment is mirrored, perform steps 7
      and 8. If your CONTROL-M/Server environment is not mirrored, perform step 7 only.
      >
      >
      > Step 7: Update Problematic Jobs' Status
      >
      > NOTE: ENSURE ALL JOBS IDENTIFIED BY STEP 2 ABOVE ARE ON HOLD PRIOR TO
      EXECUTING THE STEPS BELOW. FAILURE TO DO SO COULD CAUSE FAILURE OF CONTROL-M/SERVER MIRRORING.
      >
      > 7A. Please Note: This will set the job completion as ENDED NOT OK. Please
      be aware that Shouts and Conditions could be impacted by this modification.
      >
      > For Oracle Databases:
      > 7H. At the SQL> prompt, execute the following, paying attention to
      spacing. Press enter at the end of the lines.
      > 7I. update CMR_AJF set STATE = '5', OSCOMPSTAT=1, STATUS='N' where ORDERNO
      = <orderid from step 3 above>;
      > 7J. A message stating 1 row updated will be presented indicating the
      command was successful. If more than 1 row is identified, stop and contact BMC immediately without exiting SQL.
      > 7K. Continue this process until all order id's collected from step 4 above
      have been handled.
      > 7L. When all orders id's have been handled, commit the changes to the
      database by typing: 'commit;' and press enter.
      > 7M. When done, exit SQL by typing 'exit' and pressing enter.
      >
      > For All databases:
      > 7N. Log out of the command prompt by typing exit.
      >
      >
      > Step 8: Update Problematic Jobs' Status on the Mirrored Database
      >
      > For Oracle Databases:
      > 8M. At the SQL> prompt, execute the following, paying attention to
      spacing. Press enter at the end of the lines.
      > 8N. update CMR_AJF set STATE = '5', OSCOMPSTAT=1, STATUS='N' where ORDERNO
      = <orderid from step 3 above>;
      > 8O. A message stating 1 row updated will be presented indicating the
      command was successful. If more than 1 row is identified, stop and contact BMC immediately without exiting SQL.
      > 8P. Continue this process until all order id's collected from step 4 above
      have been handled.
      > 8Q. When all orders id's have been handled, commit the changes to the
      database by typing: 'commit;' and press enter.
      > 8R. When done, exit SQL by typing 'exit' and pressing enter.
      >
      > For All databases:
      > 8S. Log out of the command prompt by typing exit.
      >
      >
      > Step 9: Dealing with Cyclic Jobs
      > 9A. If any of the jobs in question are cyclic, extra steps to clean up may
      be required.
      > 9B. A held cyclic job whose next run time has already passed will execute
      immediately Once it is freed, potentially causing the problem to reoccur all over again.
      > 9C. To circumvent this issue, Free the job and then immediately place the
      job on hold.
      > 9D. Then Force the Job OK by right clicking the job and choosing Force OK.
      > 9E. Then Delete the job by following step 10D below.
      >
      >
      > Step 10: Hold and Delete the Problematic Jobs
      >
      > 10A. Free the Job by Right-clicking on the Job and choose Free. This action
      will cause the Job Status to update.
      > 10B. The job(s) in question should turn Red shortly.
      > 10C. To Delete the job immediately, right-click on the job(s), choose Hold
      > 10D. Then right click the job(s) and choose Delete.
      > 10E. Any jobs not marked for deletion will be removed during the next New
      Day.
      >
      >
      > "scott_kelm" <scott@...>
      > Sent by: Control-X@yahoogroups.com
      >
      > 09/30/2010 09:59 AM
      > Please respond to
      > Control-X@yahoogroups.com
      >
      >
      > To
      >
      > Control-X@yahoogroups.com
      >
      > cc
      >
      >
      >
      > Subject
      >
      > [Control-X] "running" job won't go away
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      >
      > I have a job that completed on 9/15.
      > For some reason it still shows as running in Enterprise Manager.
      > The job's session is absolutely gone on the agent server.
      > I have stopped and restarted the agent and did a ctm_menu "Stop
      all", "Start all" on the Control-M server.
      > All servers involved are Windows OS.
      >
      > Kill in EM doesn't work since it can't find the session.
      > Can't put the job on hold and delete it since it's in a run state.
      >
      > Any advice as to how to clear this job?
      >
      > Thanks,
      > Scott
      >

    • Daniel Companeetz
      Hi!   Well! Being over conservative is always good... but too cautious? We crave the the adrenaline rush of pressing the enter key and thinking that we
      Message 2 of 19 , Oct 1 8:08 AM
        Hi!
         
        Well! Being over conservative is always good... but too cautious? We crave the the adrenaline rush of pressing the enter key and thinking that we forgot something that will make things worse, only to find out that we did it right and feel soo good about ourselves!
         
        Jokes aside, the sql statement could contain two different entries. If you use STATE='5', the job will likely go into postproc, releasing all resources and setting up conditions. If you use STATE='8', the flag means postprocessed, and you are not likely to get any postproc activity.
         
        You also need to make sure you manipulate properly the OSCOMPSTAT (for example, if the job is a ctmfw, you may want to set it to 7).
         
        Sometimes the sequencec described below can simply be resolved with a Force OK. If that works, you are allowing for a lot of less trouble!
         
        Lastly, if the hold/free or forceok step does not change the job status in the EM, you can either recycle the GUI or through the troubleshooting option on the ctm_menu do a force download. In either case you lose the status of all jobs during the download. Handle with care!
         
        Lastly, more importantly... did you discover why is that happenning?
         
        There are many ways to skin a cat. The question is which one makes you more comfortable, and how proficient are you at handling ctm (and stress) without calling support! The guys there are great, so do not hesitate if you really need it! (Frilan, Chris, Vu, Lisa, Javier, Martin, Dominique, Jim, James, and many others.... Thank you!!)
         
        Good luck!!
         
        Daniel
         

        --- On Fri, 10/1/10, Shancey, Jay <shanceyj@...> wrote:

        From: Shancey, Jay <shanceyj@...>
        Subject: RE: [Control-X] Re: "running" job won't go away
        To: "'Control-X@yahoogroups.com'" <Control-X@yahoogroups.com>
        Date: Friday, October 1, 2010, 6:38 AM

         

        Oh come on! Live on the wild side! J

         

        You have a good point about forgetting the “where” clause. That could be a problem and require some explaining. LOL

         

        I’m not as concerned about the Conditions, DO actions & Shouts of a job that’s a week old, but the Resources not freeing is a different story.

         

        Thanks for the comments. I’ll take a closer look at the solution.

         


        From: Control-X@yahoogroups.com [mailto:Control-X@yahoogroups.com] On Behalf Of Graeme
        Sent: Thursday, September 30, 2010 11:18 PM
        To: Control-X@yahoogroups.com
        Subject: [Control-X] Re: "running" job won't go away

         

         

        Hi Jay,

        In answer to your question, yes this is dangerous.

        Not only could you accidentally forget the where clause of your SQL delete and therefore delete EVERY Job. (You should always use "rollback" syntax in your SQL deletes, and maybe even take Backups before you do it!)

        But if you do this then no Post Processing is done on the Job – which means Conditions are not posted, (Control and Quantitative) Resources are not Freed, etc.

        You are MUCH better to refer to Solution ID: 88111 - which as of a couple of months ago has a new Perl utility to allow you to do the deletion without the dangerous SQL delete command.

        Happy deleting…
        Cheers, Graeme.

        --- In Control-X@yahoogroups.com, "Shancey, Jay" <shanceyj@...> wrote:
        >
        > Wow! That's a lot of stuff.
        >
        > I usually hold the job, rename it to 'REMOVE', enter the db and run: delete from CMR_AJF where JOBNAME='REMOVE' and finish it with a bouncing of the gateway to clear it from the GUI (or wait until newday processing).
        >
        > Question tho... is this or could this cause issues I'm not aware of?
        >
        > ________________________________
        > From: Control-X@yahoogroups.com [mailto:Control-X@yahoogroups.com] On Behalf Of david.watson@...
        > Sent: Thursday, September 30, 2010 10:41 AM
        > To: Control-X@yahoogroups.com
        > Subject: Re: [Control-X] "running" job won't go away
        >
        >
        >
        > Step 1: Place Jobs in Question on Hold
        > Right-click on the Job in the CONTROL-M/Enterprise Manager GUI and choose the Hold option or perform this Hold step from the CONTROL-M/Server 'ctmpsm' menu.
        > Note: This is a very important step and should not be skipped. Skipping this step could cause a failure in a mirrored CONTROL-M/Server environment.
        >
        >
        > Step 2: Determine Order IDs of affected jobs
        > 2A. Right-click the job in question and select the Properties option
        > 2B. Then click on the Active tab and look for the field called ORDERID
        > 2C. Make a note of the order id. This OrderID Number is a base 36 number.
        > 2D. Continue this process until you have all the jobs experiencing the problem noted.
        >
        >
        > Step 3: Login to the CONTROL-M/Server
        > For UNIX based Control-M Servers
        > 3A. Telnet to the server and login as the Control-M user
        >
        > Step 4: Convert the Base 36 Order ID to Base 10
        > 4A. At the command prompt, type "p_36 <orderid_number>" where the order id_number is the orderid number you wrote down in step 2 above.
        > 4B. Make a note of this order id. This output of this utility is in base 10.
        > 4C. Continue this process until you have converted all the order ids you noted in Step 2 above.
        >
        >
        > Step 5: Login to SQL
        >
        > For Oracle Databases:
        > 5D. At the command prompt, type the command "SQL" and press enter.
        > 5E. You should see a "SQL>" prompt after this command. If not, try typing: "sqlplus userid/password".
        > 5F. If you are still unable to see the "SQL>" prompt, contact your system administrator to determine the state of the Control-M database and/or the user password.
        >
        >
        > Step 6: Verify that the Job you are changing is the correct one.
        > For Sybase and Microsoft SQL Server Databases:
        >
        > For Oracle Databases:
        > 6D. At the SQL> prompt, execute the following, paying attention to spacing. Press enter at the end of the lines.
        > 6E. select JOBNAME, MEMNAME from CMR_AJF where ORDERNO = <orderid from step 4B above>;
        >
        > For All Databases:
        > 6F. Review the information returned and make sure that the jobname/memname correspond to the correct job.
        > 6G. Note that it is not a failure if one of the fields is empty. It simply means there is no memname or jobname in the database.
        >
        > NOTE: If your CONTROL-M/Server environment is mirrored, perform steps 7 and 8. If your CONTROL-M/Server environment is not mirrored, perform step 7 only.
        >
        >
        > Step 7: Update Problematic Jobs' Status
        >
        > NOTE: ENSURE ALL JOBS IDENTIFIED BY STEP 2 ABOVE ARE ON HOLD PRIOR TO EXECUTING THE STEPS BELOW. FAILURE TO DO SO COULD CAUSE FAILURE OF CONTROL-M/SERVER MIRRORING.
        >
        > 7A. Please Note: This will set the job completion as ENDED NOT OK. Please be aware that Shouts and Conditions could be impacted by this modification.
        >
        > For Oracle Databases:
        > 7H. At the SQL> prompt, execute the following, paying attention to spacing. Press enter at the end of the lines.
        > 7I. update CMR_AJF set STATE = '5', OSCOMPSTAT=1, STATUS='N' where ORDERNO = <orderid from step 3 above>;
        > 7J. A message stating 1 row updated will be presented indicating the command was successful. If more than 1 row is identified, stop and contact BMC immediately without exiting SQL.
        > 7K. Continue this process until all order id's collected from step 4 above have been handled.
        > 7L. When all orders id's have been handled, commit the changes to the database by typing: 'commit;' and press enter.
        > 7M. When done, exit SQL by typing 'exit' and pressing enter.
        >
        > For All databases:
        > 7N. Log out of the command prompt by typing exit.
        >
        >
        > Step 8: Update Problematic Jobs' Status on the Mirrored Database
        >
        > For Oracle Databases:
        > 8M. At the SQL> prompt, execute the following, paying attention to spacing. Press enter at the end of the lines.
        > 8N. update CMR_AJF set STATE = '5', OSCOMPSTAT=1, STATUS='N' where ORDERNO = <orderid from step 3 above>;
        > 8O. A message stating 1 row updated will be presented indicating the command was successful. If more than 1 row is identified, stop and contact BMC immediately without exiting SQL.
        > 8P. Continue this process until all order id's collected from step 4 above have been handled.
        > 8Q. When all orders id's have been handled, commit the changes to the database by typing: 'commit;' and press enter.
        > 8R. When done, exit SQL by typing 'exit' and pressing enter.
        >
        > For All databases:
        > 8S. Log out of the command prompt by typing exit.
        >
        >
        > Step 9: Dealing with Cyclic Jobs
        > 9A. If any of the jobs in question are cyclic, extra steps to clean up may be required.
        > 9B. A held cyclic job whose next run time has already passed will execute immediately Once it is freed, potentially causing the problem to reoccur all over again.
        > 9C. To circumvent this issue, Free the job and then immediately place the job on hold.
        > 9D. Then Force the Job OK by right clicking the job and choosing Force OK.
        > 9E. Then Delete the job by following step 10D below.
        >
        >
        > Step 10: Hold and Delete the Problematic Jobs
        >
        > 10A. Free the Job by Right-clicking on the Job and choose Free. This action will cause the Job Status to update.
        > 10B. The job(s) in question should turn Red shortly.
        > 10C. To Delete the job immediately, right-click on the job(s), choose Hold
        > 10D. Then right click the job(s) and choose Delete.
        > 10E. Any jobs not marked for deletion will be removed during the next New Day.
        >
        >
        > "scott_kelm" <scott@...>
        > Sent by: Control-X@yahoogroups.com
        >
        > 09/30/2010 09:59 AM
        > Please respond to
        > Control-X@yahoogroups.com
        >
        >
        > To
        >
        > Control-X@yahoogroups.com
        >
        > cc
        >
        >
        >
        > Subject
        >
        > [Control-X] "running" job won't go away
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        >
        > I have a job that completed on 9/15.
        > For some reason it still shows as running in Enterprise Manager.
        > The job's session is absolutely gone on the agent server.
        > I have stopped and restarted the agent and did a ctm_menu "Stop all", "Start all" on the Control-M server.
        > All servers involved are Windows OS.
        >
        > Kill in EM doesn't work since it can't find the session.
        > Can't put the job on hold and delete it since it's in a run state.
        >
        > Any advice as to how to clear this job?
        >
        > Thanks,
        > Scott
        >

      Your message has been successfully submitted and would be delivered to recipients shortly.