You can add pre-action and post-action scripts in the DBVM for selected agents (APIs). You can create scripts to create, clone, and restore databases, and to take snapshots and create backups.

The following types of scripts are supported.

Post-action scripts to create, clone, and restore databases.

Pre-action and post-action scripts to take snapshots and create backups of databases.

Log in to the database virtual machine to which you need to add scripts.

1

Create a pre-action or post-action script in the following format.

Pre-action script.

pre_${lower_class_name}_${lower_method_name}

Post-action script.

post_${lower_class_name}_${lower_method_name}

For a post-action script to create a database, the script name must be post_dbctl_createdb.

For a post-action script to restore, clone, repair, and import a database, the script name is post_dbctl_recover.

For a pre-action script to take a snapshot or perform an external backup of a database, the script name is pre_dbctl_startbackup.

For a post-action script to take a snapshot or perform an external backup of a database, the script name is post_dbctl_stopbackup.

2

Put the scripts in the following folder in the DBVM.

${AgentHome}/plugin/${ACTIVATED_PLUGIN}/user_script/
3

Set execute permissions on the script for the user agent.