Hey everyone, Inspired by the job scheduler blogpost, Maximizing BTP Job Scheduling Service with SAP PAPM Cloud Universal Model, I’d like to share with you one topic which can help administrators in archiving and deleting Event Logs from your tenants in a periodic way.
Before we talk about the periodic archiving and deletion of event logs, let us try to answer few questions that you may already have
1) How much memory do Event Logs usually consume once they’re generated?
Based from personal experience within a test tenant, a logged event ranges between 150-350 bytes per record depending on trace information.
If you are interested in trying it on your tenant, below is an example sql syntax.
SELECT SCHEMA_NAME, TABLE_NAME, RECORD_COUNT,
MEMORY_SIZE_IN_MAIN AS MAIN_BYTES,
MEMORY_SIZE_IN_DELTA AS DELTA_BYTES,
MEMORY_SIZE_IN_TOTAL AS TOTAL_BYTES,
ROUND(MEMORY_SIZE_IN_MAIN / POWER(1024, 3), 5) AS MAIN_GB,
ROUND(MEMORY_SIZE_IN_DELTA / POWER(1024, 3), 5) AS DELTA_GB,
ROUND(MEMORY_SIZE_IN_TOTAL / POWER(1024, 3), 5) AS TOTAL_GB,
MEMORY_SIZE_IN_TOTAL / RECORD_COUNT AS BYTES_PER_RECORD,
ROUND(MEMORY_SIZE_IN_TOTAL/ RECORD_COUNT / POWER(1024, 3), 8) AS GB_PER_RECORD
FROM SYS.M_CS_TABLES
WHERE TABLE_NAME = 'SAP_ACE_EVENTLOGS';
2) When is the suggested time to do archiving?
Based on scaling by statistics, it’s generally recommended to maintain around 60% available memory. This helps the system handle processing peaks more effectively and ensures a consistently responsive modeling experience. For example, in a tenant with default 64GB memory, keeping approximately 38.4 GB available free memory provides optimal headroom for operations. See SAP PaPM Cloud Sizing Guide for more information.
From hands on project experience, a team of three (3) experienced modelers building a sophisticated content in a development tenant will produce 4million event log entries in 3 months which is equivalent with 1GB of hugged memory.
With such, in modeling activities we personally delete event logs every 3months or every 4million records, whichever comes first.
Now the question is, How should we do this automatically?
For every 4million records or every 1GB, you may check if SAP Cloud ALM has capabilities to notify you when your event logs reach this number.
For every 3 months (periodic), this is then the focus of this blogpost. Let’s go ahead and see how we can utilize UM released API, Archive of Event Logs in combination with SAP Job Scheduler Service (JSS) to perform the event log cleanup.
Prerequisite
You have gone through Phase I - SAP BTP: Application and Instance Subscriptions and Phase II - SAP BTP: Creation of Customized Application of blogpost, Maximizing BTP Job Scheduling Service with SAP PAPM Cloud Universal Model
Procedure
1. Following Phase III - SAP PAPM Cloud UM: Collect API Action URL, Collect Archive Event Log (Action URL) which may come from the system itself by following the dev tools
or use Universal Model - Administration Service > /archive API.
URL will then look like:
<BTP Proxy Application Routes>/ace/<$batch's request url>/<$batch's payload>
https://jobscheduler-papm-proxy.cfapps.eu10-004.hana.ondemand.com /ace/sap/ace/AdministrationService...
2. Following Phase IV - SAP JSS: Job Creation, use the generated URL above in order to create the job.
3. Following Phase V - SAP JSS: Job Scheduling, users can a job or several jobs which can be executed in future time. For example, I wanted to delete the logs and create an archive every 5 minutes until end of the year. You can do it by creating a schedule like below:
Note: If in case you want to have this job available until future time e.g. 2028. You may change the olderthan json body value like 2028-12-31T16:43:37.
this will be executed and run logs for the job will have this execution information.
Usage of 5 minutes interval is used only for test purposes but in a real world you may opt to schedule this periodically every three months. You just need to check the proper scheduling value for it. See cron format for more info.
In the end, you will see in the system entry of archived event logs.
In addition, you will also have a cleaner event log list.
That’s all for now. Hope it helped you make use of another useful API which can be used in a scheduled manner in SAP PaPM Cloud Universal Model. Until next time!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |