This guide covers advanced VDB and dSource automation strategies, including the use of hooks to run custom scripts at key points in the data lifecycle.
Hooks
Hooks are custom scripts that execute automatically at specific points during VDB and dSource operations. Common uses include updating passwords after a refresh, dropping or adding tables, and installing database extensions.
VDB hook points
| Hook | When it runs |
|---|---|
pre_refresh
|
Before refreshing the VDB from its parent. |
post_refresh
|
After refreshing the VDB from its parent. |
pre_self_refresh
|
Before refreshing the VDB with data from itself. |
post_self_refresh
|
After refreshing the VDB with data from itself. |
pre_rollback
|
Before rewinding the VDB. |
post_rollback
|
After rewinding the VDB. |
pre_start
|
Before starting the VDB. |
post_start
|
After starting the VDB. |
pre_stop
|
Before stopping the VDB. |
post_stop
|
After stopping the VDB. |
post_snapshot
|
After snapshotting the VDB. |
dSource hook points
| Hook | When it runs |
|---|---|
ops_pre_sync
|
Before syncing the dSource. Can be used to quiesce data prior to ingestion. |
ops_pre_log_sync
|
After syncing the dSource and before running LogSync. |
ops_post_sync
|
After syncing the dSource. |
Hook input structure
All hooks accept an array of operations in the following JSON format:
[
{
"name": "<OPERATION_NAME>",
"shell": "<SHELL|BASH|PS|EXPECT>",
"command": "<COMMAND_TO_RUN>"
}
]
Example: Provision Oracle VDB with a post-refresh hook
The following provisions an Oracle single-tenant VDB and runs update_passwords.sh automatically after every successful refresh:
dct-toolkit provision_vdb_by_snapshot oracle \
name=<NEW_VDB_NAME> \
source_data_id=<DSOURCE_ID_OR_NAME> \
environment_id=<TARGET_ENVIRONMENT_ID> \
post_refresh='[{"name":"Update Passwords", "shell":"shell", "command":"./update_passwords.sh"}]'
Multiple hooks can be chained in the array. Use dct-toolkit provision_vdb_by_snapshot oracle -h to see all available hook arguments for a given database type.
Last updated
Oct 8, 2026