Database Monitors are started and stopped in two different ways: manually through the Admin Console, or from a Business Process task. The monitor must be deployed before activation can take place.
What happens to the database trigger when the monitor starts and stops? Each time a Database Monitor starts, a trigger is created on the target database; this same trigger will be removed from the database when the monitor is stopped from Clarify.
These steps takes place in Admin Console | Resource Monitors.
- Under the Resource Monitor Types section, select Database Monitor. All deployed monitors appear in the Resource Monitors section. Any monitor that has already been started has a green indicator, while red indicators show that a monitor is not started.
- From the Resource Monitor section, select the Monitor you wish to start and click Start ().
When a Database Monitor is promoted (bundled and deployed) to a server, so too will any dependent objects. Always make sure these related objects exist and are complete before deploying the monitor. A good practice is to make your monitor one of the last objects you create.
From a Business Process
Database Monitors can be started and stopped when called with the ControlDatabaseMonitor Business Process task. Another task, GetDatabaseMonitorState can also be helpful to check whether your Monitors are started or stopped. A typical use case may be to use the "Get" task to check for state, and then the "Control" task to enable the Monitor if found to be disabled.
Relationship between Deployment, Activation, and Triggers
Database Monitors behave differently than other monitors in Clarify, especially when part of a Project that has been deployed to a remote server. This is mainly due to its associated trigger on an external database.
Deployment and monitor activationWhen deploying a Project (containing a Database Monitor), the monitor will need to be started before the trigger is created on the database. When un-deploying a Project (containing a Database Monitor) from a server, the Database Monitor will stop, and the trigger on the database will be removed. This behavior is the same for a remote Clarify server or the Local Test server.
Updating a monitor when part of a deployed Project (re-deploy)
When a started monitor is updated to a deployed Project, any update to the trigger takes effect immediately. When a stopped monitor is updated to a deployed Project, any update to the trigger will not take effect until the monitor is started.
For Local Test, the behavior is different. The Database Monitor must be re-started from the Resource Monitors view in order for changes to take effect.
Other differences with the Local Test Server and Database Monitors
If choosing to delete the local runtime workspace (from the Server Projects section of the Projects view), all deployed Database Monitors must first be stopped before doing so, otherwise triggers will still exist on the database.
If using the Project Clean feature within the Clarify Workbench, all deployed Database Monitors will stop, and thereby remove the trigger from the database.
How deployment and activation affect the trigger on the databaseA trigger will be removed from the database when the Database Monitor is:
However a trigger will not be removed from the database when the following occurs:
- Stopped from the Admin Console (Resource Monitor view).
- A server stops or suspends (either through the Admin Console or ebi_ctl).
- An updated Database Monitor is added back into a deployed Project.
- A Receiver Node fails (failover).