Pages

Monday 13 June 2011

How to troubleshoot a background job running for long duration in sap?


This article answers how to troubleshoot a background job running for a long duration

--------------------------------------------------------------------------------------------

1) First of all identify the job that is long running and identify details like job class, workprocess that is executing the job


2) Click on the job to view the display job screen. In the screen, click on job log to understand what is being performed by the job currently. This may give details like job is currently extracting some data packages or processing data packages etc

3) Identify the executing server and process id of the job from the step 1 and goto transaction SM50 of the respective executing server to view more details about the background job running.

Figure out the status of the job like On Hold or running from the process overview. If the job is On Hold, find out the reason for On Hold by examing the "Reason" column of SM50 transaction. Reason for On Hold could be due to CPIC/RFC/DEBUG/ENQ/PRIV/UPD etc.

Double click on the reason column for detailed information on the same and troubleshoot accordingly. If reason is RFC, check out which RFC it is referring to and cross check whether destination system is up or not and any other problems with that system.
  • If it is ENQ, check out any lock issues like lock overflow etc
  • If it is PRIV, check out for memory bottlenecks
  • If it is UPD, check out whether any update issues
  • If it is CPIC, check out for any network , gateway, message server and other communication problems

4) After performing step3, if you figure out job is not on Hold and it is in running state, then examine report column to identify what report/program is being executed by the job. Once you got the report/program details, figure whether it sap program or custom program and take actions accordingly.

5) Also examine Action and table columns in SM50 transaction of respective executing server to identify what is the action( roll in/roll out /Sequential read/Physical read/insert/update/delete etc)  being carried out by the job currently and what is the table on which action is being carried out.

If it is sequential read, figure out the cost of that sequential etc and consider for indexing etc. If it is physical read, check out whether there are too many swaps and consider resizing buffers accordingly. If you observed delay is due to high roll in/roll out, identify reasons for the same and tune buffer/memory parameters accordingly.

6) Once you get the table details on which action is being carried out, figure out        

  •     How many records are existing in the table ?
  •     Is this taking long time due to volume of records ?
  •     Are there proper indexes on the table ?(If no proper index, consider index creation  by taking help of DBA )
  •     Is the table having upto date statistics ? (If statistics are out of date,
              consider updating statistics of that table)


7) Consider debugging the process in SM50 ( Program/Session -> Program ->   Debugging ) to figureout the issue

8) Using ST05 or ST12, a trace can be taken for background job to figure out where exactly time is being consumed and to identify various cpu/memory bottlenecks or any buffer issues.

9) STAT/STAD transcation can be used to figure out what is the reason for high response time and actions can be taken accordingly

10) By taking help of ABAP er, even ABAP run time analysis can be done using SE30 transaction

By following the above steps, you can pin point the issue and take actions accordingly to minimize runtime of long running background jobs.






29 comments:

  1. Hi Prasad, your way of explanation is very nice. Please provide Spool related troubleshooting also.

    ReplyDelete
    Replies
    1. Hi Mastan,

      Please refer below link related to spool

      http://sapbasisdurgaprasad.blogspot.com/2011/06/what-is-spool-overflow-how-to.html



      Delete
  2. Thanks a lot ...... it really helps a lot

    ReplyDelete
    Replies
    1. hi yogesh ,i have some doubts can u give a good solution
      1)if user response time is very high,wt could be the reasons?and how to troubuleshoot?
      2)if 200 user already login in to system,but their activities very slow and and new user unable to login to system
      3)tcode is excuting same report today which had hapen yesterday it gave output within 2,3 sec but today it takes somuch time what may be the reasons?and how to troubleshoot? my mail id sasidharbasis@gmail.com

      Delete
    2. i even i have the same doubts... could you please forward me the solution after you receiving Mr.sasi.. my mail id is- avinash.vennampally@gmail.com

      Delete
  3. Hi sasi..thanks for excellent queries. As this needs an elaborated explanation, i would like to cover these in a separate article soon.

    Please note my name is durgaprasad :-)

    ReplyDelete
    Replies
    1. Hi DurgaPrasad,

      As you said above did you get a chance to write a blog on above mentioned quires.. if so please paste the URL here...

      Thanks
      Rahul

      Delete
    2. Hi Durga Prasad garu
      I need above queries answer pls forword
      uharibabu208@gmail.com

      Delete
  4. hi durgaprasad garu
    i want to know background jobs related issues with expalnations please can u provide it

    ReplyDelete
    Replies
    1. Yes dude. As it demands more explanation, I will cover these in a separate article

      Delete
  5. hi Durga Prasad Garu. your blog is really helpful. Thanks for the information....

    ReplyDelete
  6. Superb!! Luv u Sir ji... :)

    ReplyDelete
  7. thanks a lot.......really helpful information

    ReplyDelete
  8. Hello Durga Prasad,

    Information provided is very useful.
    Thanks a lot

    ReplyDelete
  9. thank u sir for the good work ,hope u'll conitnue the same

    ReplyDelete
  10. Thank you for sharing your knowledge and helping SAP Basis community. You are an unconditional giver. Really appreciate your time and efforts.

    ReplyDelete
  11. your explanation in this post is very very good really thanks

    ReplyDelete
  12. i facing problem while accessing table vbak its take more time on test system previous it took less time? what could the reason?

    ReplyDelete
  13. Hi Durga,

    Can you please elaborate point no. 5. As i am confused as to where to look for swaps? Is it ST02 you arereferring to. How to come to a conclusion that the swap happened is because of a particular job ?

    Regards,
    Shivanshu Srivastava
    shivanshu,2202@gmail.com
    +91-8554998700

    ReplyDelete
  14. Thanks for the nice topic

    ReplyDelete
  15. Hi,

    Could you help me in OpenText administration.

    ReplyDelete
  16. Hi Sir,

    this blog is really help me a lot. Keep writing sir

    ReplyDelete
  17. Hi Durga sir,
    I have not seen your latest articles.Please keep writing sir,we are all your EKALAVYA s.

    ReplyDelete
    Replies
    1. Thank you very much Sudher for your nice words... Definitely will post some articles. please give me sometime...

      Delete
  18. Explained nicely

    ReplyDelete
  19. Good idea! you shared us nice points.

    ReplyDelete

Please provide your valuable feedback: