DB2 LUW Field story - shell scripting - I


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.

要查看或添加评论,请登录

SARBJIT GILL的更多文章

  • Can Pakistan still survive? The answer is YES

    Can Pakistan still survive? The answer is YES

    Rather any failed state can still survive. We will have a specific look at a failed state ‘Pakistan’.

  • Are you a hard worker? Good to know!!

    Are you a hard worker? Good to know!!

    A common thought across the horizon, hard worker are the winners. Since my childhood (rather the babyhood) I have been…

    1 条评论
  • DB2 Index Monitoring - taming the tiger

    DB2 Index Monitoring - taming the tiger

    DB2 Index Monitoring Most DBAs would agree with the point that in most DBMS perform very well initially when a new…

  • Yo DBAs, I am write a script – III

    Yo DBAs, I am write a script – III

    Scripting: Which language which OS which interpreter ? When it comes to the playground, there are many languages, many…

  • Yo DBAs, I am write a script – II

    Yo DBAs, I am write a script – II

    Scripting: how is it different than programming? Basically, all scripting languages are programming languages. The…

  • Yo DBAs, I am write a script

    Yo DBAs, I am write a script

    Scripting: What is it, by the way! Basically, let me start writing. What if I say “let me start scripting”.

  • Hadoop - is it OLAP or OLTP

    Hadoop - is it OLAP or OLTP

    OLAP & OLTP are the techniques used in digital information retrieval and processing. OLTP which is Online Transaction…

    1 条评论
  • DBA – Transactional Replication - How it works

    DBA – Transactional Replication - How it works

    In relational database model, replication refers to a process that stores local database changes and sends these…

  • DBA Career – Canada and Overseas - hurdles and remedies -2

    DBA Career – Canada and Overseas - hurdles and remedies -2

    All career tracks have hardships, especially when you put yourself in global community. In previous article we had…

  • DBA Career – Canada and Overseas - hurdles and remedies

    DBA Career – Canada and Overseas - hurdles and remedies

    All career tracks have hardships, especially when you put yourself in global community. To understand it easily, let us…

社区洞察

其他会员也浏览了