SQL Server Hooks

provision hook screen

For those of you using Delphix with Oracle you’ve probably already had some exposure to Hooks; when you create a VDB via the GUI you always hit a hook screen during the provision process. I don’t intend to explain in detail what hooks are in this post but I will say they can be extremely useful to implement specific requirements where Delphix does not support them natively. A good example for Oracle is database account passwords. Lets take a quick look at what I mean.

Your non-prod VDB is most likely a copy from production and the passwords for all accounts will be identical to those in production. These passwords, especially for privileged accounts, will be held in a password repository where you can retrieve them when required (some production incident or planned change) and, in the case of password repositories that can automatically control accounts, will be changed to some random password at the end of a predefined time frame, thus ensuring no one can gain privileged access to the database unless authorised.

So the scenario is we now have a VDB, lets assume it is a Jet Stream container VDB to be consumed by a developer, with account passwords unknown. The obvious way around this is for the Dev to contact the DBA and ask them to change the password for all the accounts the Dev needs to do their job. Well that sounds like manual labour to me! Cue Delphix Hooks…

Just like in the physical world, if we were automating the refresh of dev databases, we can write a short shell script that can update these accounts changing the password to something known. Hooks have several trigger points (Pre-Refresh, Post-Refresh, Pre-Start, Post-Start to name a few) that gives us the ability for this use case to extract the existing passwords (hashed obviously) from the VDB prior to refresh and then reset the accounts to this password after the refresh.

Well this all sounds very useful and you can probably think of many great uses for hooks but if you are working with SQL Server you’re out of luck… well actually, not quite.

Continue reading “SQL Server Hooks”