DB2 LUW Field story - shell scripting - I
SARBJIT GILL
Blockchain Advocate, Enterprise Data Architect, DevOps Engineer, Senior Software Engineer, IT Research Mentor
When we talk about shell scripting, a broader scene pops up in my mind. There are may shells, there are many platforms, moreover, there are many dialects.
So, narrowing down, I am talking about KSH ( they pronounce kash, not me!!), obviously, it is db2 v 10.5 and AIX 6.1. Korn shell is available for all *nix, I have dealt with Solaris, HP-UX, Red-Hat and AIX. Believe me or not shells are slightly varying based on the OS as well.
My scripting first project was with Shoppers Drug Mart, in 2011. They wanted dynamic set of scripts. It was call Remediation Project, where we (actually I only) were to give them one script for all-in-one solution.
Here the story does not belong to this project, it belongs to Physical DBA role with Farmers Insurance Data Warehouse AIX Power System ISAS 7700, Infosphere 10.5, 65 TB 48 data nodes. By the mistake of one SysAdmin the file permissions db2 engine were lost as the SysAdmin used wrong recursion switch as he was trying to change permission of one file.
My role was Physical DBA and I was not part of the incident. Running database engine continued as normal , but it refused to take new loads. The workloads were lengthy, so Managers wanted to fix it in-place without having to bring it down, update and start back.
DBAs were lucky, should I had been the manager I should have sent one DBA home, only SysAdmin was treated.
There is no record of file permissions down the tree, and we were required to fix it without update instance command as it needs restart.
Here is the plan:
1) From a healthy Instance : copy all permissions down from SQLLIB folder. all files , registries and catalogs etc. to a text file.
2) To affected Instance : Apply these text file contained permissions to affected engine.
Write two scripts above , hand it over to Lead SysAdmin ,tell him to apply, Voila you are good in all respects. Database engine is good again.
Hint: I am sure experts will tend to mix Bash commands with KSH, also that platform matters, it is AIX 6.1.
Try it , keep in mind that DB2 Engine uses sticky bit quite a times.
Meanwhile I would search my Technical reference for the scripts used. The solution was developed and applied within 32 minutes.