Setting a monitor model lifecycle step to a consistent state using the setModelStep method

You might encounter an error condition when trying to uninstall a monitor model. The error occurs when the META_MODEL_STEP_T table does not match the current state of the model. For example, you try to run the delete schema script, but the script cannot run because the step table indicates that the schema has not been created, even though the schema does exist. To resolve the error condition, you can invoke an MBean method that forces the lifecycle step into a consistent state. Use the setModelStep method with the parameters modelID, versionDate, stepName, and isComplete to set the state of the step.

The setModelStep method has four parameters:
  • modelID: the model name
  • versionDate: the model version timestamp
  • stepName: the name of the lifecycle step that will be updated in the META_MODEL_STEP_T table.
    Note: The stepName parameter is case-sensitive.
  • isComplete: sets the value of the IS_COMPLETE column in the META_MODEL_STEP_T table to one (1) or zero (0), where 1 is equivalent to true, and 0 is equivalent to false.
The value of the stepName parameter indicates which lifecycle step will be updated. The most frequently-used stepNames are:
  • configureCEIDistribution
  • confirmInstall
  • confirmUninstall
  • disableDashboards
  • enableDashboards
  • rebootCEI
  • runCreateDMSScript
  • runCreateSchemaScript
  • runDeleteSchemaScript
Important: Before invoking the setModelStep method, make sure that the monitor model has been stopped.

In the following example, you deleted the schema for a model version, but the monitor models version page reports that the schema still exists. This is indicated by a green check mark next to the Schema Created deployment step on the monitor models page in the administrative console. To force the Schema Created lifecycle step into the correct state, use wsadmin and the setModelStep MBean method as shown in the example code.

To start wsadmin, use this command:
wsadmin -lang <lang_type> -wsadmin_classpath <WAS_home>/plugins/com.ibm.wbimonitor.lifecycle.spi.jar
where lang_type is either jython or jacl. The path specified for wsadmin_classpath uses forward slashes for all operating systems.
Jacl example for invoking the setModelStep method:
set lcMbean [$AdminControl queryNames type=LifecycleServices,*]
$AdminControl invoke $lcMbean setModelStep {MyModelID 20100629113451 runCreateSchemaScript 0 }
Jython example for invoking the setModelStep method:
lcMbean=AdminControl.queryNames('WebSphere:type=LifecycleServices,*')
AdminControl.invoke(lcMbean, 'setModelStep', '[MyModelID 20100629113451 runCreateSchemaScript 0]')