You can use templates to store commonly used operations, which allows you to avoid repeated work when an operation is applicable to more than a single virtual dataset. You manage templates through the Delphix Management application.

Hook Operations Templates Not Available via CLI

Hook operation templates cannot be fully utilized from the CLI. Manage and use hook operations through the Delphix Management application.

Creating a Hook Operation Template

The provisioning wizard still imports hook operations from templates.
  1. Login to the Delphix Management application.
  2. Click Manage.
  3. Select Operation Templates.
  4. Click the Plus icon to add a new operation template.
  5. Enter a Name for the template.
  6. Select an operation Type.
  7. Enter a Description detailing what the operation does or how to use it.
  8. Enter operation Contents to implement the operation partially or fully.
  9. Click Create.

Importing a Hook Operation Template

To import a hook operation template:

  1. In the Datasets panel, select a dataset.
  2. Click the Configuration tab.
  3. Within the Configuration tab, click the Hooks tab.
  4. Select the hook to edit.
  5. Click the Plus icon to add a new operation.
  6. Click Import.
  7. Select the template to import.
  8. Click Import.
  9. When you have set all hook operations, click Check to save the changes.

Exporting a Hook Operation Template

To export a hook operation template:

  1. In the Datasets panel, select a dataset.
  2. Click the Configuration tab.
  3. Within the Configuration tab, click the Hooks tab. 
  4. Select the hook to edit.
  5. Click the Plus icon to add a new operation.
  6. Select the type of operation.
  7. Click the text area and edit the contents of the operation.
  8. Click Export.
  9. Enter a Name for the template.
  10. Enter a Description detailing what the operation does or how to use it.
  11. Click Export.

Considerations for Delphix Hook Operations on Oracle RAC VDBs

When performing data management operations like SnapSync, refresh, and so on with Delphix data sources such as VDB and dSources, Delphix offers "hooks" as an ability to perform tasks prior to and after these data management operations. 

Mostly the above article discusses shell operations within the hooks. But sometimes you might need to run a SQL script within the hook to capture or alter the database state before or after a Delphix operation on that source. In a sample scenario, we might be connecting to the database and running some SQL script that does the operations and perhaps generates some files for later use. 

In such a case, there is no need to set the Oracle environment in the script, and in fact, setting the ORACLE_SID value in the script can be a problem for RAC instances. From the article linked above, these are the details of hook operations as they relate to RAC VDBs:

Oracle RAC

When linking from, or provisioning to Oracle RAC environments, hook operations will not run once on each node in the cluster. Instead, the Delphix Engine picks a node in the cluster at random and guarantees all operations within any single hook will execute serially on this node.

The Delphix Engine does not guarantee the same node is chosen for the execution of every hook but does guarantee that Pre-/Post- hook pairs (such as Pre-Sync and Post-Sync) will execute on the same node.

If the data source (or VDB) is a single instance Oracle, explicitly setting variables in the script should not be a problem, since the local listener will be aware of the SID in the connect string. But for a RAC, since we will not be sure which node the hook will run against beforehand, do not statically allocate the variables, the engine will determine the connection string based on the databases section of the environments page of the admin app GUI.


Hook operations do not work for Delphx RAC installations.


Remove any oracle environment setting parameters in the script and consider that the hook will run arbitrarily against any of the RAC nodes. Validate that the connect string works for the Environment>Databases section for the dSource in question. 

Additional Information

For more information about validating and setting connection strings refer to, Adding JDBC Connection String.

Related Topics