cancel
Showing results for 
Search instead for 
Did you mean: 

Background Jobs during restart

mohitsahu
Participant
0 Kudos

Hello All,

we have planned maintenance window ffor OS patching for  which SAP and database will remain stopped for more than 7 hours.

I will execute btctrsn1 and what would happen to the jobs that are duplicate (runs after 15 mins) and non duplicate non SAP standard jobs.

Will they run with delay when i run btctrns2 after starting or will they be cancelled?

Regards,

Mohit

Accepted Solutions (1)

Accepted Solutions (1)

mohitsahu
Participant
0 Kudos

Hello All,

Here is my experience with the suspending the jobs.

I executed btctrns1 before stopping the SAP system and started system after 8 hours and then executed btctrsn2.

After that all jobs that were suspended were executed and finished successfully and no jobs were cancelled.

And would also like to add point on

"This is not a "catch up" race, if a job's start date was in the past, then its past.

Gone, over, finito, bye bye"

The past queued jobs do get executed and finished and none of them get cancelled.

How we can simply ignore past jobs as other jobs may have dependency on these jobs and it is really not a "catup race".

I request to all that SCN community is really important to all of us and it is really important that we keep it clean and try to share experience and not simply post the comments of others for getting greedy of points.

Thanks to all anyways, I am closing the post now.

Regards,

Mohit

Former Member
0 Kudos

Hi Mohit,

Thanks for input.

Regards

Abinash

Answers (2)

Answers (2)

Former Member
0 Kudos

Hii Mohit,

         All the  jobs which are active at the time of system shut down gets canceled and We Can Suspend the jobs which Are in Released status By Running Report BTCTRNS1 and again release all the jobs after starting SAP using BTCTRNS2 These Released Jobs will run Based on availability of work processes.



Regards,

Raj.

mohitsahu
Participant
0 Kudos

Hello Raj,

In this case time dependency does not matter? or you mean to say all jobs that are supposed to start at a particular time will re run after running btctrns2??

and what will happen to the jobs that are dependent on cancelled job?

I will check for the job that are active and will run btctrns1 only after the job gets finished.

Regards,

Mohit

former_member1012268
Participant
0 Kudos

Sorry, but batch jobs that are already active (running) are in danger of being restarted, if no "don't run after <Point in Time>" was specified for them.

That is why the SAP guidelines for btctrsn1 & btctrsn2 stipulate to *manually* ensure no customer batch jobs are already/still actively running.

btctrsn1 temporarily "disables" customer jobs that are not yet active, but it does not terminate/cancel jobs already actively running.

And just trusting that nothing will break by simply shutting down the system with customer jobs actively running (likewise trusting nothing bad is gonna happen if these jobs restart uncontrolled with large delays) is just bad style.

btctrsn1 "unplans" scheduled jobs and btctrsn2 puts them back into the (original) scheduled time line.

Thus, the job(s) run(s) at the next point in time at which it/they was/were supposed to start anyway.

Jobs whose time had come and gone are not started, as their planned start date is now in the past.

mohitsahu
Participant
0 Kudos

Hello Donaldo,

I will wait for the active job running during that period. And will run btctrns1 when no active job is there.. And after that will stop the system.

And now what will happen to customer specific jobs that are scheduled to run during that period?

Regards,

Mohit

Former Member
0 Kudos

Dear

if you shutdown the system then all jobs scheduled during that time will be cancelled and if you run report btctrsn1 and suspend all jobs until and unless you run btctrsn2 no job will run

Regards

former_member1012268
Participant
0 Kudos

scheduled jobs != active jobs

Possible Status of Background Jobs - Background Processing - SAP Library

"Active:

The job is currently running. Active jobs can no longer be modified or deleted. "

Procedure Before Stopping an SAP System - Basis Corner - SCN Wiki

"Check if there are no critical background jobs running before shutdown.If there are such jobs , identify the job owner and inform them about the shutdown reasons"

"During the course of shutdown , the active and just released jobs might fail , and cause inconsistencies in transaction processing."

Canceling active jobs by simply shutting down the system may lead to all kinds of problems.

From leftover lock objects, to incomplete transactions to failed table updates.

Worst comes to worst, the next job running doesn't recognize the objects were already "in the making" beforehand and then tries to run the same procedure again - leading to unrepairable inconsistencies.

We just had that happen on our project, were an intern didn't verify that all active jobs were finished before system shutdown, and then when the jobs ran the next time they went over the same tables again, even so those tables were not supposed to be altered again for another 30 days.

The result was a major screw up in the upgrade.

There is an official procedure for that, why do you recommend ignoring SAP's own directives on System Shutdown procedure?

former_member1012268
Participant
0 Kudos

Once you ran btctrns1, nothing happens with customer jobs that were scheduled to start.

Once again, already active jobs can not be altered, but scheduled (planed & released) ones simple won't run.

And when you execute btctrns2, *only* those jobs whose planned start date is in the future will become active again, when their scheduled start date & time has arrived.

mohitsahu
Participant
0 Kudos

Hello Donaldo,

okay you mean only jobs that has scheduled time after start will run and what about the jobs that were in scheduled state before start and were not sent to suspended state using btctrns1 and after that system remain shut for 4-5 hours.. then these jobs will not run anymore?

Regards,

Mohit

former_member1012268
Participant
0 Kudos

I am not sure how to spell it out more clearly than what I wrote already.

Why do you think the SAP system should have nothing better to do then to run jobs whose start dates are in the past?

This is not a "catch up" race, if a job's start date was in the past, then its past.

Gone, over, finito, bye bye.

The job calender only works from here on out into the future.

Nobody cares for yesterday's news or jobs that were supposed to have started 4-5 hours ago.

But if you did *not* suspend your customer jobs, then they will run at the planned point in time - not matter how long you did shut down the system - as long as that point-in-time is still in the future,  its that simple.

mohitsahu
Participant
0 Kudos

Hello Donaldo,

Thank you so much for your in depth clarification but i think you should understand the requirement better then simply write someone else answers.

I have been trying asking about the jobs that we are suspending if it has not to run again after btctrns2 then why it is suspending and why not it simply cancel it then.

As far i know so far from experts the jobs

some cancelled jobs if they have been setup with a 'Do not run After' value, but the next scheduled time the job will run.


and for jobs which are  scheduled during the maintenance window will be queued and gets started as soon as the SAP system starts according to availability of b/g work processes.



former_member1012268
Participant
0 Kudos

>you should understand the requirement better then simply write someone else answers.

???

Listen, if you don't like my answers, then don't ask me any questions.

And if I quote from SAP's own instructions on the matter, well shoot me for that.

You keep asking the same question again and again (in English verbiage that isn't very decipherable on top of all else) and then get upset if you don't like or understand the answer.

How about this one:

SAP Reports : BTCTRNS1 and BTCTRNS2 | Inthebasis.com

Yes, I know - I did it again. I am "quoting (rather linking) someone else's answers"

That webpage explains perfectly clear the function of jobs btctrns1 and btctrns2.

And if you have your own "experts" to explain it to you, why don't you ask them instead?

What is suspended stays suspended until its being released again.

Jobs released but not active are set to "Canceled for Upgrade", periodic jobs or jobs with start dates still in the future will get released again via btctrns2.

All others are ignored.

I'll leave this thread now, because we two clearly seem to be having communication issues.

Former Member
0 Kudos

Hi Mohit,

None of the jobs will run. It will again run as usual after you run BTCTRNS2.

Thanks

Abinash

mohitsahu
Participant
0 Kudos

Hello Abinash,

Thanks for the message.

But my question is what about the jobs that needs to be run during that time or which has dependency on other jobs output (event dependent).


Regards,

Mohit

Former Member
0 Kudos

Mohit,

All the background jobs will be cancelled scheduled prior to execute the BTCTRNS1. If anyone execute or schedule any job after that it will run. If you still have any confusion feel free to revert back.

Thanks

Abinash

mohitsahu
Participant
0 Kudos

Hell Abhinav,


what do you mean by this?


All the background jobs will be cancelled scheduled prior to execute the BTCTRNS1?



I run btctrns1 and job will get release/suspended state..


But I am asking about the jobs that are supposed to run during that time and was not able to run because the system was down.. ANd now what will happen to these jobs after stating it again?


Regards,

Mohit