Creating hook operations

Hook operations typically run on the production or staging server. Exercise caution when you create hook operations as they can inadvertently alter the state of a production database.

Below is the behavior for various data sources:

  • Oracle: hook scripts run on the production host for regular data sources. For staging push dSources, the hook scripts run on the staging server.

  • SQL Server: hook scripts run on the staging server for both regular and staging push dSources.

  • SAP ASE: Pre Sync and Post Sync hook scripts run on the production host. Pre and Post Validated Sync hooks run on the staging server.

Creating hook operations via the Delphix Continuous Data Engine UI

Hook operations can be configured either during the provisioning process or on existing virtual datasets.

During provisioning

  1. In the Add dSource or Add VDB wizards, go to the Hooks tab.

  2. Select the Operation Type, enter a Name, and input the Script.

  3. To remove an operation, click the Trash icon next to it.

  4. After setting all operations, click Next to proceed with provisioning.

To edit on existing virtual datasets

  1. Log in to the Delphix Management application.

  2. In the Datasets panel, select the virtual dataset.

  3. Navigate to Configuration > Hooks.

  4. Select a hook and click the Pencil icon to edit.

  5. Use the + icon to add or the Trash icon to remove operations.

  6. Save changes by clicking the checkmark icon.

Creating hook operations via the administrative Command-Line Interface (CLI)

To define hook operations

  • During linking: Edit the array in LinkingParameters > Source > Operations.

  • During provisioning: Edit the array in ProvisionParameters > Source > Operations.

  • On existing dSources: Edit Source > Operations.

  • On existing virtual datasets: Edit Source > Operations.

Detailed documentation on these CLI objects is available in the Help menu of the Delphix Management application, including LinkedSourceOperations, VirtualSourceOperations, RunCommandOnSourceOperation, and RunExpectOnSourceOperation API.

Example of editing hook operations through the CLI

To modify operations for a source, use the following commands:

  1. Navigate to VirtualSourceOperations for the source.

  2. Select a hook to edit. Example commands:

    Copy
    delphix> source
    delphix source> select "pomme"
    delphix source "pomme"> update
    delphix source "pomme" update *> edit operations
    delphix source "pomme" update operations *> edit postRefresh
  3. To add an operation:

    Copy
    delphix source "pomme" update operations postRefresh *> add
    delphix source "pomme" update operations postRefresh 0 *> set type=RunCommandOnSourceOperation
    delphix source "pomme" update operations postRefresh 0 > set command="echo Refresh completed."
    delphix source "pomme" update operations postRefresh 0 > ls
    Properties
     type: RunCommandOnSourceOperation ()
     command: echo Refresh completed. ()
    delphix source "pomme" update operations postRefresh 0 *> commit
  4. To delete an operation:

    Copy
    delphix source "pomme" update operations postRefresh *> unset 1
    delphix source "pomme" update operations postRefresh *> commit