• Yet Another DBA (5/6/2015)


    Been writing my release scripts like this for years. Like you I didnt know there was a specific term for it.

    As one co-worker said: "write it like this [ed: idemptent] then no one will notice if you release a script half asleep or whether you got distracted, you just run it again".

    When Fire fighting an issue and the pointy-haired-boss starts asking damn fool questions an idempotent script does reduce a lot of risks.

    I write database scripts, but someone in production control deploys them. If the script fails in production, then I may have to wait until the next deployment window to resubmit a corrected version. Therefore I have to write scripts that simply work: no errors, no weird messages or warnings, no confusing instructions, and advanced notice if I expect the script to run longer than a few minutes.

    "Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho