Small is Beautiful ???


This is something is my favourite dialogue when it is the case of the performance issue of a business application whether it is SAP or it is some other ERP or tailor made one. Every business application is supported by a database storing business transactions as records and a management system/engine to run (retrieve, add, modify or delete information) and manage the database whether relationally or else type.

I still remember those days, when we use to challenge each other with writing smaller better executables which gives less memory dumps. Those days 4 MB RAM in one of my friend’s computer was something we all do envy. We used 360KB floppies to copy programs and games written from one machine to another to try out. Gone those days, everything is now bigger.

But the big the size of head, the intensified is the headache, need bigger doses to come round and carry the risk of the more side effects. Big data is something equivalent to a overloaded truck on the road, unsafe for people (driver as well as those others travelling in the road) and harmful for road as well as the truck itself.

I had recently came across a situation where a server that is running a SAP BW system is temporarily facing storage crunch and ping pong of communication happening between storage admin, DBAs, Basis and BW consultants….This happens, whatever strong is the planning.

Now for any application, there are majorly three parts e.g. binaries, data container and the interface engine.  And the application database is the part, which always have growth. As obviously in most my discussion SAP and Oracle comes into the picture, I will be referring them also here in this discussion.

So what are causing an SAP OLTP system to grow bigger? And what are the different approaches to gain control over them…….?

Ideally following things makes an SAP database grow bigger

  • Logs
    • System Logs
    • Audit trails and logs
  • Business Processes configuration
    • Data accumulated but not used.
    • Too much detail information is collected.
  • Trying to provide intelligence in the scope of transactional reporting (this is nothing but fooling your customer as well as yourself) resulting in
    • Rampart Creation of indexes to reduce the execution time of so called intelligence reports.
    • Creation of duplicate record containers.
  • Storing of duplicate data in database because of some customized need (i.e. trying to provide intelligence in the scope of transactional reporting- this is nothing but fooling your customer as well as yourself).
  • Database growing older and became porous.
  • No policy on information life cycle.

 

And the ideal will methodology should be a combination of the following.

 

  • Review configuration thus helping data avoidance
  • Define data life – Create a policy for data archival, deletion.. The frequencies….
  • Database De-Fragmentation
  • Stop building business intelligence in an OLTP system – especially when the more open type of parameter screen is used e.g. ABAP reports… This gradually forces you to create a more index to satisfy the execution speed on the actual OLTP tables which is suicidal….i.e. remember the more you create index, the more you increase the transaction time.
  • Plan for a separate hardware, and segregate data and history data and build up intelligence.
  • Don’t forget to clean up the mess (created by the approach of building business intelligence in OLTP) you made ….My experience is people forget it …But this is one of the most important. And that is why I kept it in separate bullet point.

Remember; don’t let your application logic just to satisfy business logic, but to satisfy it better and proper. Otherwise it is actually hampering business by increase of operation time, there by reducing organisation wide operational efficiency.

What I had in my mind is to create a small document on this topic in a scenario of SAP and Oracle, which can be a ready reckoner at least to start the analysis….

Select Single….Select /*First Rows actually selecting second row.


This something happened yesterday and seems quite interesting. One of our customiZed ABAP program has a ‘Select single inside it’ which is getting converted as ‘Select /* First row…’ in the backend Oracle, but fetching the not the First but the second row…..

This came to my notice, as ABAP group lead requested me to rebuild all the 5 index in the underlying table, got surprised and after a discussion the above fact is revealed.

I have prescribed statistics generation using DBMS_STATS and also use ‘ Select UP TO 1 ROWS’. With a hope that the problem will be sorted out. Let see whether they implement the same get a solution or not…..

Yet to search and find any SAP relevant notes inside it……..

Some good relevant link I already explored is
1. Difference between select single and up to 1 row

2. Understanding optimizer hints.

Index creation in a huge table in SAP landscape – II.


As I earlier promised, I had to come back on the index creation and transportation in SAP landscape…especially for big SAP tables.

As I already wrote, this is something a must know and practice knowledge for both the ABAP and the BASIS. When an index required to create and then transported to the Production system within a landscape.

Let as discuss this scenario in more detail, keeping in mind when the database behind the SAP landscape is Oracle. When an index is created in Oracle using plain Create Index command, it locks the underlying table (do not allow DML operation unless creation is complete) and when SE11 is used for creating index, it uses simple create index command. The time taken is directly proportional to the no of records in the table for which the index is created. So the more the size is the more is the locking period. One needs to judge the time of importing of the transport having an index as one of its object. Although it seems quite simple statement – in actual scenario it does not happen so.

Transport request landing up in the desk of Basis Support was never examined for its content. As basis normally do not understand it. ABAP and Functional do not think it essential to provide summarized information about the transport contents for Basis to understand. So Basis right away start to import the transport to production and it locks the underlying table let say BSIS and the entire operation using BSIS is stuck. Ultimately this is a service outage (although some smart service managers will still dare to call it a partial outage).

To tackle such situation Oracle has an option of creation of index online and in parallel (use if your production system has multiple CPUs/Cores – nowadays are very normal). SAP also recommends to create the index first using database utility only (at least SQL*Plus in case of oracle) and then transport from development so that only the header comes and there is no service outage (refer to SAP Note 334224). There is an option of by passing the redolog option by using no log, but I am seriously against it. Besides if you use parallel option then the improvement using nolog option is negligible.

index creation SAP oracle

Index creation in a huge table in SAP landscape.


Ultimately a good week ends with a successful event. I always wonder, what if suddenly one need to create an index in an SAP OLTP landscape to spped up one of his customiZed report program? Consider this index is being created on a table which is huge in size? More than a GB which may be on a table like BSIS or VBAK or so? Which is always been used by your users 24X7?

You transport this index from your development system to production…As because your table contains only a few hundreds of records in it may less than 1 MB even in size, you didn’t face any problem transporting the same in your quality system where quality check is done with a Gala Success?

On your dismay, when the same is transported into your production, suddenly you will listen a hue and cry from everyone,,, the system gets stuck…..And a basis person is a scapegoat….

So what is the lesson learned? Mainly three……

  1. Basis consultant, before starting a transport must look into the object, whether the same contains any index….
  2. Management of a SAP consultancy should stop blue eying  such functional or ABAP consultant who without disclosing the fact (the impact on availability of live system) simply release a request for transport which contain a deadly index. This is a sheer nonsense practise.
  3. SAP prescribed 3 system landscape do not help you put a guarantee on the availability of a production system.

I am in a hurry now, may be I will come back to update this port or write a new one how to tackle this kind of  scenario.
index creation SAP oracle