cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically start trace again after system restart

Former Member
0 Kudos

Dear gurus,

I am having sleepless nights because of the above problem..

At 01:00 here everyday, the SAP systems all shutdown for about 1 hour for an offline backup. I need to use the ST01 system trace and SMGW gateway trace for about 10 days to verify all communication partners and which access they require.

However... when the servers are started again, my trace settings are gone and several hours of important system processing duck under the radar of the tracing...

I can see 2 options:

1) Find a pub until 02:00 in the morning and then go back to the office.

2) Find a way to activate the trace again (ideally with parameters) when the systems come back up again. I have looked for an ABAP report as job for this but no luck.

I found several solutions to the first option and setting the smgw trace as static instance profiles for the second, but was wondering whether there is some magic basis trick to use the job approach to activate the ST01 traces again? Even from own code, the activation is a c-call so I want to avoid that as well if possible by any means.

I can offer at least one evening of beers on me in the pub if you spare me the other 9 evenings with some guru trick to turn the trace on again?

Cheers,

Julius

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey Julius

Seriously, disable that offline backup and run an online backup instead.

Cheers Michael

Edit: btw, is it legal to offer beers, when it is forbidden to offer forum points?

Former Member
0 Kudos

Unfortunately the backup topic is out of my control and unavoidable at the moment.

The forum rules did not say anything about beers and if SAP notes even recommend having a beer during upgrades then I thought it would be legal...

Cheers,

Julius

Former Member
0 Kudos

Ok, i see. Now you get what you deserve, i got some time to poke around as this is slow day at my place.

- Use the transaction recorder (transaction SHDB) and record the trace activation in ST01

- Create a batch input map (menu -> edit -> create session (transaction SM35 for batch input maps)

The batch input map can be scheduled in background. But i never used that before and my map failed with a strange kernel error. So i had to tweak things a bit. I am pretty sure there is a better way to do it from here.

- Run the map in background (this creates a job in SM37)

- Create a copy of that job (if i just restarted it it would not work, because the map was in processing already)

- Delete the original job and release the map in SM35 (sets the status back to new)

- Schedule the copied job with start on event "SAP_SYSTEM_START"

Now i restarted the system and the trace was on afterwards in ST01... in your case i would have to prepare the map and job again for the next night on the other day.

Have fun, my recommendation is still to use my first solution.

Cheers Michael

If no one else comes up with a better solution, i think i deserve at least a very helpful count of beers. Maybe we can get to that sometimes, i am located quite near to you. Some guys from that exciting AG of yours might even know who i am.

Former Member
0 Kudos

Very good idea! I will give it a try and update the thread tomorrow.

Unfortunately there are "call screens" with dialogs for the filters, but if I can suppress that somehow and still set the filter then it looks like a winner!

Yes, the idea on it's own deserves at least a beer or two, even if a minor technicality gets in the way with the screen calls.

Cheers,

Julius

Former Member
0 Kudos

Hi Michael,

I got the BI-map part working on my sandbox and can also execute it in foreground and background and it works. I also got a strange error but hiting "Enter" once in the filter dialog before OK got rid of that.

The problem is that a copy of the job does not process the map again because it is already processed. So I need two steps in the event dependent job:

1st step) Create a program to create the BI-session to turn the trace on with the recording.

2nd step) Run the BDC in the second step (report RSBDCSUB with a variant for the session(s) prior created).

This works perfectly but still seems like a bit messy solution compared to the bit missing expectation of a BAPI_TRACE_CHANGE...

I will mail you directly about the well deserved beers but leave the thread open still for a while incase a ninja shows up and wants to join.

Thanks for taking the time to think about it and this solution! Much appreciated!

Cheers,

Julius

Former Member
0 Kudos

Glad to hear it is working, it is very important that one of our key members gets his sleep

The good thing is as always i learned a few new things too. Initially i tried to setup an automated e-catt test, thats when i learned about the gui recorder. Another thing i tried (worked as well) was an offline backup without stopping SAP. If you have an oracle database and use brbackup, then you can use the offline_force option to do that.

Have a happy new year, Michael

Former Member
0 Kudos

I also thought of eCatts but they don't allow that here in production.

SHD0 (screen for variant transaction) did not work either because I could not pass parameters to the filter.

I eventually did not need to get any code into the system --> create a BI-session for each day --> RSBDCSUB as job step with variant for the session names and dynamic date calculation which is run on the event SAP_SYSTEM_START.

Works like a charm and looking forward to the beers,

Julius

Former Member
0 Kudos

Yesterday the last BDC session I created was processed by the event-job and all went well, so I am closing the thread.

I also met with Michael (and a few party-gate-crashers who heard about the SDN "basis" meeting in Zurich) and we all had a few beers together. It was good fun and laughs and SDN is a great way to meet people this way. Thanks SDN!

Cheers,

Julius

ps: The points system will be deactivated and replaced by beers and tea in the next release...

Former Member
0 Kudos

Again big thanks for the beers, it was a nice evening. My location suggestion turned out to be questionable though :-]

Thumbs up for beers for points.

Cheers Michael

questionable location =

- waiters first day

- menu with the size of a business card

- ran out of draft beer after first round

- at the end teenagers started making out all around us

- ...

Former Member
0 Kudos

Next time I will raise the stakes to beers or tea for the guru who solves the problem, myself and for Michael!

With some small luck, it might take us to Australia for beer or India for tea, in the stead of boring Zurich with offices about 200 meters from each other...

Cheers,

Julius

Answers (0)