Performance Tuning For Lazy DBA

“Why would I want (to be) a lazy DBA?”      

“Good engineers are lazy.” - Andy Leonard

A lazy person can do same task in a way that is more efficient, he/she would explore to reach the goal with minimum effort and while doing so they end up discovering unexplored paths.

Nature of performance tuning is exhaustive and always remain a mystery. Because we do not have common answer to the problems and solutions are different based on given scenarios.


Before you, start tuning a system these questions might cross your mind.

          Is there a general guideline to tune the system?

          What is performance-tuning process?

          What are the set of rules for performance tuning?

There are no generic answers.


Being said that is it “Really”?

If you could codify the repetitive steps then performance tuning would be easy.

 do

      {

            steps :1

            steps :2

            steps :3

            steps :n

       } While (repeat until solved)


Performance tuning is an experience in itself and an individual is made of unique experiences that is why sometimes a difficult problem needs different perception. As if it was detective Holmes, asking for doctor Watson’s input, what he thinks of the crime scene.

Performance tuning demands a lot of experience. Many of you would agree with it, but I would ask, what about entry-level folks? Where to start with? How this art of tuning can be acquired without any formal training and shelling $$?

Gone are the days when this was true, what if database itself tells you, “Hey! This is my problem” and applies the fix by itself. Common example is SQL Plan Management from Oracle Database 11g Release 1, but how many of us dare to enable this in extremely sensitive production line, who would take the risk? If it were 100% safe then it would have been enable by default.

My perspective is little offbeat.

If [ Somebody can do ] {

    then

printf  “ I can do “;

if [ I can do ] {

then

printf “Anybody can do”  ; AND

printf “Every time I do it -- it is different” ;

 }

}

 

An individual with good command on subject is rare to find in industry, because it comes with hard work, regular practice and constant effort towards the subject. Most of us are too busy in day-to-day activity we seldom forget to explore additional fields apart from our assignments. Very few gets lucky and accidentally gets assign to a project of their interest and they develop a zeal to reach to the top of the pyramid.


 My Performance Tuning experience


                People want answers fast

There is a funny person I came across, who in heated call announces, “System looks more than healthy ever”. That is a strong statement to make especially when you just logged in into the system.

          It took us hours to figure it out

Database is end of the food chain and receives enormous blames across the vertical. I am sure every one of you have come across the complaint “Hey your database is slow”, “Database is hung”. Is it really? How many times it came out to be true. In addition, database is a complex system wherein a number of hardware bound together by very sophisticated software to achieve a common goal. We need to narrow down further, is it Redo? Is it Locks? Or Memory or any other subsystems performing sub optimally. 

          Where the buck stops

Do we have the right artifacts to point out the problem? Can we redirect the investigation into right direction without taking the blame, especially when high priority tickets attracts penalty.

 

Think outside the box

This is minuscule effort to make an efficient process of utilizing automation; this will drastically reduce resource consumption, no more writing/referring nasty scripts, and no manual intervention will eliminate human errors.


Optimization

Once an OCM told me that, every good DBA has handy scripts and they are so fast in using there repository. Some organization pays to purchase the handmade scripts and deploys in common location in each server. In both cases, we need to remember some keywords or script names to call when in need. In addition, you have to remember the views, joins and formatting which is challenging. However, one thing is definite, the less you type the less mistake you make.

   “How do we speed up this process?”

   “How to make this process more efficient?”

    “How to avoid conflict?”

Put a stop to P1; no more justification to management later; divert investigation into right direction.

Above all, how can we optimize our effort first, before optimizing the performance of database?

I introduce PERFORMANCE TROUBLESHOOTING TOOL [PTT]

One stop shop, no more juggling with notes and google. Feel free to download from github and go through read me.

 


I have not automated the performance tuning, for that, you have to opt for autonomous database.

It is similar to algebraic formulas you once used in school days, you have to think how and where to substitute to get desired results .This script would give you some quick and easy results, I have made little tweaks such as:

51) AWR – will create a snapshot first and will collect reports for last 4 snaps and send it over email.

38) COE – this will always create profile with FORCE_MATCH=> TRUE

39) Create SPB – My personal favorite, try it yourself to uncover secretes.

Remember -- each experience will be different from the last and very different from the next.

Sit Back Relax and let the script do the ugly work for you

History and behavior of system really comes handy when you are digging into unknown space, this script will not only help improving the individual performance but also help in bookkeeping, and logs will be saved and can be cascaded to multiple mails.

Then Good-Bad-Ugly snapshot is just few clicks away, currently it is interactive mode, I am planning to take it to next level for GUI experience.

Feel free to comment and report bugs, I shall continue working towards improvement.

          Introduce AI - human readable o/p

          Mail in html format

          Dark mode - expert

          ADD help for each query function – Beginner

          Integration with Ayehu for GUI experience

“So.. , Am I lazy ? Or just ready to pounce into action. Thank You


"Don't show off your knowledge, share it .. it grows ... it really does ...

 

 


Comments