Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to trace a Long ruuning Job ?

Former Member
0 Kudos

Hi All,

Could you please let mw know , how to trace \ to take the ABAP runtime analysis for a long running job . For example a job in running for 5 hours in QA system.

then how can i trace the same. Which t-Code and how ? tracing eith ST05 and SE30 wouldn't be feasible as for as i know.

Regards,

SEN

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can first check for all select statments used in program .Whether it is picking up the correct Indexes . You can go to ST04 transaction . If you have recently executed program (4,5 days back ) you can see actual Indexes used in the program by select statments . Actually Oracle optimizer decides which Indexes to be picked up . If it is showing as scanning full table , then you need to modify where clause , so that it picks up the correct indexes .

Let me know if you want to know more in detail on how to use ST04.

Atul

7 REPLIES 7

Former Member
0 Kudos

Hi,

You can first check for all select statments used in program .Whether it is picking up the correct Indexes . You can go to ST04 transaction . If you have recently executed program (4,5 days back ) you can see actual Indexes used in the program by select statments . Actually Oracle optimizer decides which Indexes to be picked up . If it is showing as scanning full table , then you need to modify where clause , so that it picks up the correct indexes .

Let me know if you want to know more in detail on how to use ST04.

Atul

former_member194613
Active Contributor
0 Kudos

It is not really useful to trace such a long-runnning job,

Check STAD and SM50 to get some insight, where most of the time is spend.

Try to reduce the load, 5 hours is not spend for one database select, even with bad performance you will process a few thousand items, whatever you do. Prepare something with items and trace that.

Be aware, that the tracing creates overhead, i.e. your job including trace would run 10 hours.

And a good trace is better taken after oone of two rerun, 20 or 30 hours. If something goes wrong, you will spent 100 hours, one week to get data.

And at the end you will figure out that the main problems are caused by some selects. Usually it is possible to see long running parts of the job in the SM50, then you can switch on the ST05 in parallel, after 30min some selects should be finished, and will see results.

There is no result, if not at least one select is finished.

All ABAP trace can be switched on in parallel.

Siegfried

0 Kudos

Siegfried \ Atul - Do you aware of Snapshot trace ?

Regards,

SEN

former_member194613
Active Contributor
0 Kudos

no the name 'snapshot trace' tells me nothing, please explain, maybe I know it under a different name.

0 Kudos

you can use T code St01 to do SQL trace of your job in background .

I am not sure if your question is still open..

Let me know if you need more info on this ..

Rohan.aajgaonkar at yahoo.co.in

0 Kudos

You need to get help from your basis team and maybe put the job into debug from SM50. You could just as well spend an evil amount of time looping through internal tables. A good rewrite in this area can bring a job of 10 hours down to 5 mins if the size of the internal tables is big enough (300,000 + entries)

Have fun.

keiji_mishima
Active Contributor
0 Kudos

Hi Senthil Nattama.

Before taking a trace directly, I would recommend you to check which type of trace is effective.

Normally, if DB time is high (more than 60% of total response time), you should check DB access.

If CPU/Processing time is high (also more than 60% of total response time), you should check ABAP coding like read/loop at itab where operation.

If the job was executed recently, you may see time distirbution from T-CD STAD. If the job was executed several days ago, you may see the runtime in aggregated form in T-CD ST03N (transaction profile).

If DB time is high, I first recommend you to execute program one more time with stat/tabrec option that you can define from ST03N. Then you may see top N tables that take time to access in T-CD STAD. If you find specific long access time in STAD, I recommend you to check SQL path from ST04 DB cache.

normally you can easily find out expensive SQL (long running SQL) in ST04 cache if the SQL is really slow. Then if it is necessary, please take ST05 (SQL Trace) only for spefici bottleneck table.

(You may not be able to take ST05 SQL trace more than 10 min. If you take, there is a high possibility of overwrite or you may take very long time to open trace).

So in case of DB accessproblem, I recommend you to check which table access take time from parameter "stat/tabrec " then conduct detail more analysis from SQL cache/ST05 trace or DB session (oracle session) while the job is running.

If CPU, Processing time is high, you may need to take ABAP trace from ST12 or SE30. In thi case, please activate internal table option. Otherwise, you cannot take expensive ABAP code.

In case of ABAP trace, you can nomrally take around 40 min. So maybe you can try several ABAP trace by specifing BG process.

Best Regards

Keiji