2.7

Table Of Contents
Add Pre-Action and Post-Action Scripts to the DBVM for Selected
Agents
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.
n
Post-action scripts to create, clone, and restore databases.
n
Pre-action and post-action scripts to take snapshots and create backups of databases.
Prerequisites
Log in to the database virtual machine to which you need to add scripts.
Procedure
1 Create a pre-action or post-action script in the following format.
u
Pre-action script.
pre_${
lower_class_name
}_${
lower_method_name
}
u
Post-action script.
post_${
lower_class_name
}_${
lower_method_name
}
u
For a post-action script to create a database, the script name must be post_dbctl_createdb.
u
For a post-action script to restore, clone, repair, and import a database, the script name is
post_dbctl_recover.
u
For a pre-action script to take a snapshot or perform an external backup of a database, the script name
is pre_dbctl_startbackup.
u
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.
Chapter 12 Safeguarding Data
VMware, Inc. 161